Skip to content

Conversation

@jlowin
Copy link
Owner

@jlowin jlowin commented Oct 5, 2025

This pull request refactors and standardizes the internal API and method naming conventions for MCP handlers. Specifically, it takes what used to be two methods and a JIT-generated handler and refactors them into three handlers:

_list_tools_mcp: previously _mcp_list_tools, this method is the registered handler with the low-level MCP server and returns the handler result in MCP-native format
_list_tools_middleware: previously _list_tools, this method applies MCP middleware
_list_tools: previously generated dynamically in _list_tools_middleware, this is the core handler that is responsible for listing tools

This makes it more clear where responsibility lies and avoids dynamically generating new functions unnecessarily, which made debugging more difficult.

In addition, an internal parameter via_server was renamed to apply_filtering.

@marvin-context-protocol marvin-context-protocol bot added enhancement Improvement to existing functionality. For issues and smaller PR improvements. server Related to FastMCP server implementation or server-side functionality. labels Oct 5, 2025
@jlowin jlowin merged commit 91af3cd into main Oct 5, 2025
10 checks passed
@jlowin jlowin deleted the mcp-refactor branch October 5, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to existing functionality. For issues and smaller PR improvements. server Related to FastMCP server implementation or server-side functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants