Skip to content

MCP Server Does Not Expose /run Endpoint with sse Transport (Returns Not Found#) #229

Open
@grahama1970

Description

@grahama1970

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

  1. Install mcp[cli] version 1.3.0 using uv:

    uv pip install "mcp[cli]==1.3.0"
  2. 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
    
  3. 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
  4. Run the server:

    python simple_mcp.py
  5. Query the /run endpoint using curl:

    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

  1. Verified that mcp[cli] version is 1.3.0.
  2. Confirmed that tools are registered by logging mcp.tools.
  3. Tested alternate endpoints (/tools/list, /tools/call) — all return Not Found#.
  4. 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
  5. Checked port binding — no conflicts on port 8000.

Please provide guidance on how to expose and query endpoints when using HTTP (sse) transport.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions