Model Context Protocol (MCP) 1 · Python server

Expose a resource

Share read-only data that clients can load into context, here with a URI template.

@mcp.resource("greeting://{name}")
def greeting(name: str) -> str:
    """Greet someone by name."""
    return f"Hello, {name}!"

Official Model Context Protocol (MCP) 1 documentation

More python server commands

All python server commands · Model Context Protocol (MCP) 1 cheatsheet

Was this page helpful?