Skip to content

Conversation

chris-sanders
Copy link
Owner

Summary

This PR implements standardized MCP argument schemas by removing the non-standard args wrapper that was automatically added by FastMCP. This change ensures compatibility with PydanticAI and other MCP clients that expect standard schema formats.

Changes Made

Core Implementation:

  • Transformed all 6 tool functions to use direct parameters instead of Args classes
  • Updated initialize_bundle: source, force, verbosity parameters
  • Updated list_available_bundles: include_invalid, verbosity parameters
  • Updated kubectl: command, timeout, json_output, verbosity parameters
  • Updated list_files: path, recursive, verbosity parameters
  • Updated read_file: path, start_line, end_line, verbosity parameters
  • Updated grep_files: pattern, path, recursive, glob_pattern, case_sensitive, max_results, max_results_per_file, max_files, verbosity parameters

Test Updates:

  • Updated all unit tests (187 tests pass)
  • Updated all integration tests (51 tests pass)
  • Updated all e2e direct tests (10 tests pass)
  • Added schema validation regression test to prevent future args wrapper usage

Before and After

Before (Non-standard):

{
  "properties": {
    "args": {
      "$ref": "#/$defs/InitializeBundleArgs"
    }
  },
  "required": ["args"],
  "title": "initialize_bundleArguments",
  "type": "object"
}

After (Standard MCP):

{
  "properties": {
    "source": {"type": "string", "title": "Source"},
    "force": {"type": "boolean", "default": false, "title": "Force"},
    "verbosity": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Verbosity"}
  },
  "required": ["source"],
  "title": "initialize_bundleArguments", 
  "type": "object"
}

Tool Calls

Before (Non-standard):

{
  "name": "initialize_bundle",
  "arguments": {
    "args": {
      "source": "bundle.tar.gz",
      "force": false
    }
  }
}

After (Standard MCP):

{
  "name": "initialize_bundle", 
  "arguments": {
    "source": "bundle.tar.gz",
    "force": false
  }
}

Quality Assurance

  • ✅ All code formatting (ruff format) passes
  • ✅ All linting (ruff check) passes
  • ✅ All type checking (mypy) passes
  • ✅ 187 unit tests pass
  • ✅ 51 integration tests pass
  • ✅ 10 direct e2e tests pass
  • ✅ Schema validation regression test added

Compatibility

This change ensures compatibility with:

  • PydanticAI MCP clients
  • Claude Code MCP integration
  • Standard MCP protocol implementations
  • Any MCP client expecting standard schema formats

All existing functionality is preserved while enabling broader MCP ecosystem compatibility.

…d format

- Transform all 6 tool functions to use direct parameters instead of Args classes
- Update initialize_bundle: source, force, verbosity parameters
- Update list_available_bundles: include_invalid, verbosity parameters
- Update kubectl: command, timeout, json_output, verbosity parameters
- Update list_files: path, recursive, verbosity parameters
- Update read_file: path, start_line, end_line, verbosity parameters
- Update grep_files: pattern, path, recursive, glob_pattern, case_sensitive, max_results, max_results_per_file, max_files, verbosity parameters

- Clean up import statements to remove unused Args classes
- Update all unit tests (187 tests pass)
- Update all integration tests (51 tests pass)
- Update all e2e direct tests (10 tests pass)
- Add schema validation regression test to prevent future args wrapper usage

Tool schemas now generate standard MCP format without args wrapper:
{
  "properties": {
    "source": {"type": "string"},
    "force": {"type": "boolean", "default": false}
  },
  "required": ["source"]
}

Instead of non-standard format:
{
  "properties": {
    "args": {"": "#//InitializeBundleArgs"}
  },
  "required": ["args"]
}

This enables compatibility with PydanticAI and other MCP clients.
@chris-sanders chris-sanders merged commit 9f35162 into main Jul 29, 2025
6 checks passed
@chris-sanders chris-sanders deleted the task/standardize-mcp-schemas branch July 29, 2025 20:23
chris-sanders added a commit that referenced this pull request Aug 11, 2025
* Start task: standardize-mcp-schemas

* Implement MCP schema standardization: Remove args wrapper for standard format

- Transform all 6 tool functions to use direct parameters instead of Args classes
- Update initialize_bundle: source, force, verbosity parameters
- Update list_available_bundles: include_invalid, verbosity parameters
- Update kubectl: command, timeout, json_output, verbosity parameters
- Update list_files: path, recursive, verbosity parameters
- Update read_file: path, start_line, end_line, verbosity parameters
- Update grep_files: pattern, path, recursive, glob_pattern, case_sensitive, max_results, max_results_per_file, max_files, verbosity parameters
chris-sanders added a commit that referenced this pull request Aug 11, 2025
* Start task: standardize-mcp-schemas

* Implement MCP schema standardization: Remove args wrapper for standard format

- Transform all 6 tool functions to use direct parameters instead of Args classes
- Update initialize_bundle: source, force, verbosity parameters
- Update list_available_bundles: include_invalid, verbosity parameters
- Update kubectl: command, timeout, json_output, verbosity parameters
- Update list_files: path, recursive, verbosity parameters
- Update read_file: path, start_line, end_line, verbosity parameters
- Update grep_files: pattern, path, recursive, glob_pattern, case_sensitive, max_results, max_results_per_file, max_files, verbosity parameters
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.

1 participant