Skip to content

Conversation

Copy link

Copilot AI commented Dec 1, 2025

  • Rename types.py to mcp_types.py to avoid conflict with Python's types module
  • Create strongly typed Tool dataclass with name, description, input_schema, output_schema
  • Create typed ToolError class with error_type (enum), message, and details
  • Update ListToolsObservation to use typed List[Tool] instead of List[Dict[str, Any]]
  • Update CallToolObservation to make fields required and use typed ToolError class
  • Update all imports across the codebase that reference types.py
  • Update __init__.py to export new types (Tool, ToolError, ToolErrorType)
  • Add pytest pythonpath configuration to pyproject.toml
  • Run code review and fix feedback
  • Run security analysis (CodeQL) - no issues found
  • Add comprehensive tests for MCP types (21 tests for Tool, ToolError, observations)
  • Fix test directory structure to avoid import conflicts
  • All 23 tests pass

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@meta-cla
Copy link

meta-cla bot commented Dec 1, 2025

Hi @copilot!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copilot AI and others added 2 commits December 1, 2025 21:30
…nd ToolError classes

Co-authored-by: Darktex <890615+Darktex@users.noreply.github.com>
Co-authored-by: Darktex <890615+Darktex@users.noreply.github.com>
Copilot AI changed the title [WIP] Add basic local MCP server and MCP client support Add strongly typed MCP types: Tool, ToolError, rename types.py to mcp_types.py Dec 1, 2025
Copilot AI requested a review from Darktex December 1, 2025 21:33
Copilot finished work on behalf of Darktex December 1, 2025 21:33
Copy link
Contributor

@Darktex Darktex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add tests to validate that these changes are working as intended. Run the tests and show me

Co-authored-by: Darktex <890615+Darktex@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 1, 2025

@copilot add tests to validate that these changes are working as intended. Run the tests and show me

Added comprehensive tests in commit 4843088. Here are the test results:

23 tests passed in 1.12s

Tests added for:
- Tool: creation, serialization, equality
- ToolError: creation, details, serialization  
- ToolErrorType: all enum values, from-string parsing
- ListToolsObservation: empty, with tools, serialization
- CallToolObservation: success, with error, serialization
- Actions: ListToolsAction, CallToolAction
- MCPEnvironment: typed tools, error handling

Run the tests with:

python -c "
import sys
sys.path.insert(0, 'src')
import pytest
pytest.main(['-v', 'tests/core/test_mcp_module/'])
"

Copilot AI requested a review from Darktex December 1, 2025 22:04
Copilot finished work on behalf of Darktex December 1, 2025 22:04
@Darktex Darktex marked this pull request as ready for review December 1, 2025 22:17
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.

2 participants