Skip to content

Standardize MCP interface to match canonical specification#12

Merged
SamMorrowDrums merged 5 commits intomainfrom
copilot/standardize-mcp-interface-python
Jan 21, 2026
Merged

Standardize MCP interface to match canonical specification#12
SamMorrowDrums merged 5 commits intomainfrom
copilot/standardize-mcp-interface-python

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Aligns Python implementation with canonical MCP interface for cross-language consistency. Changes parameter naming convention from snake_case to camelCase and adds schema metadata required by spec.

Tools

Parameters: Renamed to camelCase and added title/description via Pydantic Field:

  • task_nametaskName, max_tokensmaxTokens
  • locationcity, topicquestion
  • Added destructive parameter to confirm_action
  • Added steps parameter to long_task

Descriptions: Updated to single-line format without trailing periods per spec.

def hello(
    name: Annotated[str, Field(title="Name", description="Name of the person to greet")]
) -> str:
    """Say hello to a person"""

Resources

Updated URIs and display names:

  • info://aboutabout://server (name: "About")
  • file://example.mddoc://example (name: "Example Document")

Resource Templates

Updated URIs and display names:

  • data://items/{item_id}item://{id} (name: "Item Data")
  • greeting://{name} (name: "Personalized Greeting")

Prompts

Added title/description to all arguments via Pydantic Field.

Note: Python SDK's PromptArgument model lacks title field support (only name, description, required). This is a known SDK limitation documented in code.

Configuration

Updated pyproject.toml to allow camelCase parameter names (ignore = ["N803"]) for cross-language consistency.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Standardize MCP interface for cross-language consistency</issue_title>
<issue_description>## Overview

This issue ensures the Python starter matches the canonical MCP interface shared across all language implementations.

Canonical Interface Reference

See the full specification: https://github.com/SamMorrowDrums/mcp-starters/blob/main/CANONICAL_INTERFACE.md

Changes Required for Python

✅ Tools (Already has all 7 - needs schema updates)

Python has all required tools. Changes needed:

Tool Current Issue Required Change
hello Uses title only Add description to name property
get_weather Uses title only Add description to city property
long_task task_name (snake_case), title only Rename to taskName, add description
ask_llm max_tokens (snake_case), title only Rename to maxTokens, add description
confirm_action Uses title only Add description to properties
get_feedback Uses title only Add description to question property
load_bonus_tool ✅ OK No changes needed

Tool Descriptions

Update to concise single-line format:

Tool Current Target
ask_llm Multi-line with Args section Ask the connected LLM a question using sampling
confirm_action Multi-line Request user confirmation before proceeding
get_feedback Multi-line Request feedback from the user
long_task Multi-line Simulate a long-running task with progress updates

⚠️ Resources (Need renaming)

Current Target
about_resource About
example_file Example Document
file://example.md/ doc://example

⚠️ Resource Templates (Need renaming)

Current Target
greeting_template Personalized Greeting
item_data Item Data

⚠️ Prompts (Need description on arguments)

Add both title and description to all prompt arguments:

# code_review prompt arguments
{
    "name": "code",
    "title": "Code",
    "description": "The code to review",
    "required": True
}

# greet prompt arguments  
{
    "name": "name",
    "title": "Name", 
    "description": "Name of the person to greet",
    "required": True
},
{
    "name": "style",
    "title": "Style",
    "description": "Greeting style (formal/casual)",
    "required": False
}

Schema Convention Summary

All properties must have BOTH:

  • title: Human-readable label (e.g., "Task Name")
  • description: Model-readable explanation (e.g., "Name for this task")

Use camelCase for parameter names: taskName, maxTokens (not task_name, max_tokens)


Part of cross-language consistency effort. See mcp-starters#3</issue_description>

<agent_instructions>CRITICAL: Cross-Language Consistency

These are all MCP starter repositories that should have MINIMAL interface differences. The public API must be identical across all language implementations where language constraints allow.

Primary Reference: https://github.com/SamMorrowDrums/mcp-starters/blob/main/CANONICAL_INTERFACE.md - This is the AUTHORITATIVE source for all API decisions.

Context: See SamMorrowDrums/mcp-starters#3 for the full diff report showing current discrepancies.

Key Requirements:

  1. Follow CANONICAL_INTERFACE.md exactly for tool names, descriptions, parameter names (camelCase), and schema structure
  2. All properties must have BOTH title AND description fields
  3. Use concise single-line descriptions (no multi-line docstrings with Args sections)
  4. If something cannot be implemented identically due to language constraints, add a clear comment explaining why
  5. The goal is that running the diff tool should show ZERO differences between implementations</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 21, 2026 10:15
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot AI changed the title [WIP] Standardize MCP interface for Python cross-language consistency Standardize MCP interface to match canonical specification Jan 21, 2026
Copilot AI requested a review from SamMorrowDrums January 21, 2026 10:23
@SamMorrowDrums
Copy link
Owner

@copilot I've added copilot-setup-steps.yml and copilot-instructions.md to help you with linting, building, and testing. Please continue implementing the canonical interface changes. Make sure to:

  1. Run the format/lint commands before committing
  2. Verify the build passes
  3. Run tests to ensure everything works

The canonical interface spec is at: https://github.com/SamMorrowDrums/mcp-starters/blob/main/CANONICAL_INTERFACE.md

Copy link
Contributor Author

Copilot AI commented Jan 21, 2026

@copilot I've added copilot-setup-steps.yml and copilot-instructions.md to help you with linting, building, and testing. Please continue implementing the canonical interface changes. Make sure to:...

I've verified all canonical interface changes using the new setup files:

Format/Lint: uv run ruff format . and uv run ruff check . - All checks passed
Tests: uv run pytest - No test failures (no tests defined)
Server: uv run mcp-python-starter - Starts successfully
Interface: All 7 tools with camelCase parameters, 2 resources with canonical URIs, 2 templates, 2 prompts

All changes from commits ef22140, 313ee0d, and b58fe00 are complete and validated.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@SamMorrowDrums SamMorrowDrums marked this pull request as ready for review January 21, 2026 12:37
@SamMorrowDrums SamMorrowDrums merged commit 2c684fd into main Jan 21, 2026
7 checks passed
@SamMorrowDrums SamMorrowDrums deleted the copilot/standardize-mcp-interface-python branch January 21, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize MCP interface for cross-language consistency

2 participants