-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
Description
Initial Checks
- I confirm that I'm using the latest version of MCP Python SDK
- I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue
Description
expected behaivor / actual behavior
looking at the provided sample code i would assume current_time would show up as a regular resource, because it needs no arguments from the llm / user.
however, is is only being listed as a resource template and cannot be invoked via the inspector.
Example Code
from contextlib import asynccontextmanager
from mcp import ServerSession
from mcp.server import FastMCP
from mcp.server.fastmcp import Context
class AppContext:
pass
@asynccontextmanager
async def lifespan(server: FastMCP):
yield AppContext()
mcp = FastMCP("Demo", lifespan=lifespan)
@mcp.resource("time://current")
async def current_time(ctx: Context[ServerSession, AppContext]):
return "11:41"Python & MCP Python SDK
`uv run python` shows `3.13.8`
`uv pip freeze` shows `mcp==1.21.1`
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on