Description
Description
When running an MCP server using FastMCP
with sse
transport, the expected /run
endpoint is not exposed. Any HTTP requests to /run
, /tools/list
, or /tools/call
return a 404 Not Found#
response. This happens even with a minimal example script.
I’ve tested this both locally (outside of Docker) and in Docker, and neither setup works. The issue persists even when using a simple example.
Steps to Reproduce
-
Install
mcp[cli]
version1.3.0
usinguv
:uv pip install "mcp[cli]==1.3.0"
-
Confirm the installed version:
uv pip show mcp
Output:
Name: mcp Version: 1.3.0 Location: /home/grahama/workspace/experiments/mcp-server-arangodb/.venv/lib/python3.10/site-packages Requires: anyio, httpx, httpx-sse, pydantic, pydantic-settings, sse-starlette, starlette, uvicorn Required-by: arango-mcp
-
Create a minimal MCP server script (
simple_mcp.py
):from mcp.server.fastmcp import FastMCP mcp = FastMCP("Echo") @mcp.tool() def echo(message: str) -> str: """Echo back the input message.""" return f"Echo: {message}" if __name__ == "__main__": mcp.run(transport="sse") # Use SSE transport for HTTP
-
Run the server:
python simple_mcp.py
-
Query the
/run
endpoint usingcurl
:curl -X POST http://localhost:8000/run \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "echo", "arguments": { "message": "Hello, MCP!" } }, "id": 1 }'
Expected Behavior
The server should expose the /run
endpoint, and querying it with a valid JSON-RPC request should return a response like this:
{
"jsonrpc": "2.0",
"id": 1,
"result": "Echo: Hello, MCP!"
}
Actual Behavior
The server responds with:
Not Found#
This happens for any requests to /run
, /tools/list
, or /tools/call
.
Environment
-
Python Version: 3.10.16
-
MCP Version: 1.3.0 (installed via
uv
) -
OS: Ubuntu 22.04 (local environment)
-
Dependency Manager:
uv
-
pyproject.toml:
[project] name = "arango_mcp" version = "0.1.0" description = "ArangoDB MCP Server" authors = [ {name = "Graham Anderson", email = "[email protected]"} ] dependencies = [ "python-arango>=7.9.1", "loguru>=0.7.3", "mcp[cli]==1.3.0", ] requires-python = ">=3.10.16" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [project.scripts] arango-mcp = "arango_mcp.main:main"
-
Running Locally: Yes (outside Docker), but Docker also fails.
Debugging Steps Taken
- Verified that
mcp[cli]
version is1.3.0
. - Confirmed that tools are registered by logging
mcp.tools
. - Tested alternate endpoints (
/tools/list
,/tools/call
) — all returnNot Found#
. - Switched to
stdio
transport — this works as expected:(echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "echo", "arguments": {"message": "Hello, MCP!"}}, "id": 1}'; cat) | python simple_mcp.py
- Checked port binding — no conflicts on port
8000
.
Please provide guidance on how to expose and query endpoints when using HTTP (sse
) transport.