small-mcp
A minimal FastMCP server in Python demonstrating all four MCP primitives with tools for arithmetic, word counting, time, and logging, resources for server info and code snippets, and prompts for summarization and code review.
README
small-mcp
A minimal FastMCP server in Python that demonstrates all four MCP primitives: tools, resources, resource templates, and prompts — including how to use the context object for logging and progress reporting.
Requirements
- uv (package manager)
- Python 3.14+
Setup
uv sync
Run
uv run python main.py
The server starts in stdio mode, ready to be connected to any MCP client.
Primitives
Tools
Functions the LLM can call to perform actions.
| Tool | Description |
|---|---|
add(a, b) |
Add two numbers |
word_count(text) |
Count words, characters, and lines |
current_time(timezone) |
Return the current UTC time |
log_message(message) |
Log a message via MCP context (demonstrates progress + logging) |
Resources
Static data the LLM can read.
| URI | Description |
|---|---|
resource://server/info |
Basic info about this server |
resource://snippets/hello-world |
A Python Hello World snippet |
Resource Templates
Dynamic resources resolved from a URI pattern.
| Template | Description |
|---|---|
resource://snippets/{language}/hello |
Hello World snippet for python, javascript, go, or rust |
Prompts
Reusable prompt templates the LLM can request by name.
| Prompt | Args | Description |
|---|---|---|
summarize |
text, style |
Ask for a summary in a given style |
code_review |
code, language |
Request a code review |
explain_concept |
concept, audience |
Explain a concept to a target audience |
Context
The log_message tool shows how to inject ctx: Context into a tool to:
- Send log messages back to the client via
ctx.info() - Report progress via
ctx.report_progress(progress, total)
Inspect with MCP Inspector
uv run fastmcp dev inspector main.py
Then open the URL printed in the terminal to browse and call tools, read resources, and render prompts interactively.
Connect to Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"small-mcp": {
"command": "uv",
"args": ["run", "--directory", "/Users/nishantbhagat/Study/Projects/small mcp", "python", "main.py"]
}
}
}
Project Structure
small mcp/
├── main.py # MCP server (all primitives in one file)
├── pyproject.toml # uv project config
└── uv.lock
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.