You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# server.pyfrommcp.server.fastmcpimportFastMCP# Create an MCP servermcp=FastMCP("Demo")
# Add an addition tool@mcp.tool()defadd(a: int, b: int) ->int:
"""Add two numbers"""returna+b# Add a dynamic greeting resource@mcp.resource("greeting://{name}")defget_greeting(name: str) ->str:
"""Get a personalized greeting"""returnf"Hello, {name}!"@mcp.resource("config://app")defget_config() ->str:
"""Static configuration data"""return"App configuration here"@mcp.resource("users://{user_id}/profile")defget_user_profile(user_id: str) ->str:
"""Dynamic user data"""returnf"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
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):
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
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
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
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):
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
The text was updated successfully, but these errors were encountered: