Proxy to stdio MCP Server
Description
Hi,
I'm currently running a stdio MCP server locally but unable to utilize the proxy to access the MCP server. Proxy was able to correctly detect the stdio mcp transport. I've tried using a local sse server instead of local stdio and that works but for some reason the local stdio does not.
Confirmed both servers are running (the MCP and the proxy server successfully start).
Confirmed the proxy client identifies the transport
Connected to downloaded mcp server with transport: <NodeStdioTransport(command='node', args=['/app/remote-mcp-server/node_modules/forwarded/index.js'])>
Ends up hanging when calling list tools
Appreciate any guidance you can provide
Example Code
running the server with the following code
transport = infer_transport(main_file_path)
print("Connected to downloaded mcp server with transport: ", transport)
client = Client(transport=transport)
proxy = FastMCP.from_client(client, name="Downloaded MCP Proxy")
return proxy.run_sse_async(host="0.0.0.0", port=3000, log_level="debug")
Sample Client to test functionality
async def main():
base_url = "https://mcp-gksg.onrender.com/sse"
async with Client(base_url) as client:
await client.ping()
print(f"\nAvailable tools ({len(tools)}):")
tools = await client.list_tools()
for tool in tools:
print(f" - {tool.name}: {tool.description}")
if __name__ == "__main__":
asyncio.run(main())
Version Information
FastMCP version: 2.2.0
MCP version: 1.6.0
Python version: 3.12.9
Platform: macOS-15.1.1-arm64-arm-64bit
FastMCP root path: ~/.pyenv/versions/3.12.9/lib/python3.12
Additional Context
No response
I also have the issue
I have the test.py
from fastmcp import FastMCP
# Original server
original_server = FastMCP(name="Original")
@original_server.tool()
def tool_a() -> str:
"""print A"""
return "A"
# Create a proxy of the original server
proxy = FastMCP.from_client(
original_server,
name="Proxy Server"
)
# proxy is now a regular FastMCP server that forwards
# requests to original_server
proxy.run(transport="stdio")
when I run, it didn't detect tools.
python test.py
[04/29/25 08:01:01] INFO Starting server "Proxy Server"... server.py:262
@huang-sh you are passing a server to from_client(), you need to wrap it in a Client object -- FastMCP.from_client(Client(original_server))
@aghchan is it possible to provide a full script that demonstrates the issue? I think I only se eyour client test code here
Closing this issue for now, we have many examples now of proxying stdio servers. Please open a new issue with a minimum reproducible example if you run into this issue