Conversation
483ef34 to
1235912
Compare
perdy
reviewed
Mar 24, 2026
3334a95 to
86cb3fd
Compare
86cb3fd to
de20507
Compare
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive support for the Model Context Protocol (MCP) over JSON-RPC in the Flama framework. It adds new modules, endpoints, routing, protocol error handling, and response types to enable extensible and standards-compliant machine learning model interaction. The changes also generalize JSON-RPC support across the framework, including new exception handling and endpoint base classes.
Major enhancements and new features:
Model Context Protocol (MCP) Integration
MCPModule, which manages one or more MCP servers, and provides decorators and methods to register tools, resources, and prompts for model interaction. (flama/mcp/module.py,flama/applications.py) [1] [2] [3] [4]MCPServerandMCPRouteclasses, allowing MCP servers to be mounted at specific paths and routed via HTTP POST requests. (flama/mcp/server.py,flama/mcp/routing.py)MCPEndpoint, which defines the MCP API over JSON-RPC, including methods for initialization, tool/resource/prompt management, and protocol-compliant responses. (flama/mcp/endpoint.py)JSON-RPC Support
JSONRPCEndpointbase class for handling JSON-RPC requests, including method dispatch, error handling, and response formatting. (flama/endpoints/jsonrpc.py,flama/endpoints/__init__.py) [1] [2]JSONRPCExceptionfor protocol-specific error reporting, and integrated it into the debug middleware for consistent error handling. (flama/exceptions.py,flama/debug/middleware.py) [1] [2] [3] [4]JSON-RPC Response Types
JSONRPCResponseandJSONRPCErrorResponseclasses for standard-compliant JSON-RPC responses, along with aJSONRPCStatusenum for protocol error codes. (flama/http.py) [1] [2] [3]Other improvements:
flama/endpoints/http.py)flama/mcp/__init__.py)These changes lay the foundation for robust, extensible, and standards-based model serving and interaction within Flama, making it easier to build interoperable AI systems.