fastmcp icon indicating copy to clipboard operation
fastmcp copied to clipboard

Multi-server Clients don't block for server initialization

Open strawgate opened this issue 7 months ago • 3 comments

Description

[05/23/25 00:14:53] INFO     Starting MCP server 'Local Filesystem Operations MCP' with transport 'stdio'             server.py:747
2025-05-23 00:14:54,262 - mcp_server_tree_sitter.language.registry - WARNING - Skipping pre-loading of languages due to missing dependencies
2025-05-23 00:14:54,285 - mcp_server_tree_sitter.server - INFO - Starting MCP Tree-sitter Server
2025-05-23 00:14:54,293 - mcp.server.lowlevel.server - INFO - Processing request of type ListToolsRequest
[05/23/25 00:14:55] INFO     Starting MCP server 'Local References' with transport 'stdio'                            server.py:747
5.24s - Error on build_exception_info_response.
Traceback (most recent call last):
  File "/Users/bill.easton/.cursor/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 1477, in build_exception_info_response
    stack_str = ''.join(stack_summary.format())
                        ~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/bill.easton/.local/share/uv/python/cpython-3.13.3-macos-aarch64-none/lib/python3.13/traceback.py", line 757, in format
    formatted_frame = self.format_frame_summary(frame_summary, colorize=colorize)
  File "/Users/bill.easton/.local/share/uv/python/cpython-3.13.3-macos-aarch64-none/lib/python3.13/traceback.py", line 561, in format_frame_summary
    last_line = all_lines_original[frame_summary.end_lineno - frame_summary.lineno]
                ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Example Code

mcp = FastMCP(name="mcp-oops")

    config_contents = Path(mcp_config).read_text(encoding="utf-8")
    config = yaml.safe_load(config_contents)

    client = Client(config)

    async with client:
        
        await client.ping()
        await client.list_tools() <---- ERROR

        proxy = FastMCP.as_proxy(client)

Version Information

2.4.0

Additional Context

No response

strawgate avatar May 23 '25 05:05 strawgate

actually i think a server is just failing to start and not giving me any info on why

strawgate avatar May 23 '25 05:05 strawgate

Looks like maybe NPX servers arent supported via config dicts yet?

  git:
    command: "npx"
    args: ["-y", "@cyanheads/git-mcp-server"]
    description: "Perform git-related actions"

strawgate avatar May 23 '25 05:05 strawgate

That's weird they should be! Will have to look into it

jlowin avatar May 23 '25 11:05 jlowin