Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
grahama1970 opened this issue Feb 22, 2025 · 1 comment

Comments

@grahama1970
Copy link

grahama1970 commented Feb 22, 2025

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.

@wangheng0206
Copy link

1.you need use http get endpoint

Image

Image
  1. and then you can use result to get tools
Image
  1. you can use command "mcp dev server.py" and find paramters
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants