Skip to main content
Glama

mcp-run-python

Official
by pydantic
mcp_server.py679 B
from typing import Any from mcp.server.fastmcp import Context, FastMCP from mcp.server.session import ServerSessionT from mcp.shared.context import LifespanContextT, RequestT mcp = FastMCP('Pydantic AI MCP Server') @mcp.tool() async def echo_deps(ctx: Context[ServerSessionT, LifespanContextT, RequestT]) -> dict[str, Any]: """Echo the run context. Args: ctx: Context object containing request and session information. Returns: Dictionary with an echo message and the deps. """ deps: Any = getattr(ctx.request_context.meta, 'deps') return {'echo': 'This is an echo message', 'deps': deps} if __name__ == '__main__': mcp.run()

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pydantic/pydantic-ai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server