Registry / ai-ml / fastmcp-slim

fastmcp-slim

JSON →
library3.4.2pypypiunverified

FastMCP (slim variant) is a Python framework for building MCP (Model Context Protocol) servers quickly and with minimal dependencies. It provides a high-level abstraction over JSON-RPC and Streamable HTTP transports, allowing you to define tools, resources, and prompts with simple decorators. Version 3.4.2, active development.

ai-ml
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from fastmcp import FastMCP

Minimal FastMCP server with one tool.

from mcp.server.fastmcp import FastMCP import os mcp = FastMCP("My App") if os.environ.get('MCP_API_KEY'): mcp.auth = os.environ['MCP_API_KEY'] @mcp.tool() def add(a: int, b: int) -> int: return a + b if __name__ == "__main__": mcp.run()
Debug
Known footguns
gotchaImport path: Use 'from mcp.server.fastmcp import FastMCP'. The package name 'fastmcp-slim' does not match the import path.
breakingVersion 3.x moved to asynchronous core. Sync tools are wrapped; async is preferred. Some decorators changed.
gotchaTransport defaults: FastMCP now defaults to 'streamable-http' (JSON-RPC over HTTP) instead of stdio. If you need SSE, set transport='sse'.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
11 hits · last 30 days
gptbot
3
bingbot
1
mj12bot
1
ahrefsbot
1
Resources