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

Cannot run latest Demo server in Claude Desktop - FastMCP, python-SDK v1.2.0 #128

Closed
wanderingnature opened this issue Jan 4, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@wanderingnature
Copy link

Describe the bug
Trying out latest Python-SDK with FastMCP, error connecting to Claude.

To Reproduce
Steps to reproduce the behavior:
Follow the example at: https://github.com/modelcontextprotocol/python-sdk

created server.py

# server.py
from mcp.server.fastmcp import FastMCP

# Create an MCP server
mcp = FastMCP("Demo")

# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"

@mcp.resource("config://app")
def get_config() -> str:
    """Static configuration data"""
    return "App configuration here"

@mcp.resource("users://{user_id}/profile")
def get_user_profile(user_id: str) -> str:
    """Dynamic user data"""
    return f"Profile data for user {user_id}"

Note: I added the two resources to the example to test resources (static) and resource_templates...

Expected behavior
It works.... (I can run in inspector with 'mcp dev server.py')
Claude Desktop connection not possible:
Screenshots
Monosnap Claude 2025-01-04 08-57-39

Used 'mcp install server.py' and receive error at startup of desktop client.
No messages are logged in mcp-server-Demo.log

Desktop (please complete the following information):

  • OS: Monterey 12.7.6
  • Browser Chrome

Additional context
Claude Congfiguration: (unchanged)
"Demo": {
"command": "uv",
"args": [
"run",
"--with",
"mcp",
"mcp",
"run",
"/Volumes/Dev12TB/fastmcp-servers-dev/fastmcp-test/server.py"
]
}

The same command, e.g. uv with arguments 'run --with mcp mcp run server.py' are used in inspector

@dsp-ant dsp-ant added the bug Something isn't working label Jan 5, 2025
@dsp-ant
Copy link
Member

dsp-ant commented Jan 6, 2025

Thanks for the report. I can reproduce this.

@dsp-ant
Copy link
Member

dsp-ant commented Jan 6, 2025

More clarification in the docs now as well how to start the server appropriately: modelcontextprotocol/docs#104

dsp-ant added a commit that referenced this issue Jan 6, 2025
During `mcp install` we are generating a config
that relies on `mcp run`. However `mcp` is only available
as a CLI command if we use the `cli` feature.

We need to specify that we want to install mcp
with the cli feature.

Fixes #128
@gyger
Copy link

gyger commented Jan 7, 2025

I think that warrants to release 1.2.1, because all examples are broken. My temporary fix is to use
mcp = FastMCP("Echo", dependencies=["mcp[cli]"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants