Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Model Context Protocol (MCP) support #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ErikBjare
Copy link
Owner

@ErikBjare ErikBjare commented Nov 26, 2024

Implements MCP server functionality allowing gptme to be used through the Model Context Protocol.

  • Add core MCP types and transport layer
  • Implement MCP server with tool/resource support
  • Add CLI entry point (gptme-mcp-server)
  • Add documentation and examples
  • Add tests for MCP implementation

Part of #286

@TimeToBuildBob wrote this.


Important

Adds Model Context Protocol (MCP) server support to gptme, including core types, transport, server implementation, CLI entry point, documentation, and tests.

  • Behavior:
    • Implements MCP server functionality in gptme/mcp/__init__.py, allowing gptme to be used through the Model Context Protocol.
    • Adds CLI entry point gptme-mcp-server in gptme/mcp/cli_server.py.
  • Core Components:
    • Defines core MCP types in gptme/mcp/types.py.
    • Implements transport layer in gptme/mcp/transport.py.
    • Implements server functionality in gptme/mcp/server.py.
  • Documentation:
    • Updates README.md to include MCP support.
    • Adds docs/mcp.rst and docs/examples/mcp.rst for detailed MCP documentation and examples.
  • Testing:
    • Adds tests for MCP implementation in tests/test_mcp.py.
  • Misc:
    • Updates pyproject.toml to include new CLI entry point and test dependencies.

This description was created by Ellipsis for 51f2b7c. It will automatically update as commits are pushed.

Implements MCP server functionality allowing gptme to be used through the Model Context Protocol.

- Add core MCP types and transport layer
- Implement MCP server with tool/resource support
- Add CLI entry point (gptme-mcp-server)
- Add documentation and examples
- Add tests for MCP implementation

Part of #286
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 51f2b7c in 1 minute and 2 seconds

More details
  • Looked at 1092 lines of code in 12 files
  • Skipped 2 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. gptme/mcp/__init__.py:43
  • Draft comment:
    Consider retrieving the version dynamically from the package metadata to avoid hardcoding it here.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The version number is hardcoded, which can lead to inconsistencies if the package version changes.
2. gptme/mcp/server.py:92
  • Draft comment:
    Consider providing a more descriptive error message here to aid in debugging.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The error message should be more descriptive to help with debugging.
3. gptme/mcp/transport.py:119
  • Draft comment:
    Consider providing a more descriptive error message here to aid in debugging.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The error message should be more descriptive to help with debugging.
4. gptme/mcp/transport.py:128
  • Draft comment:
    Consider providing a more descriptive error message here to aid in debugging.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The error message should be more descriptive to help with debugging.

Workflow ID: wflow_DbQdwxicefmDSX6g


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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