MCP Tool Server
MCP Tool Server
A production-oriented MCP (Model Context Protocol) server that exposes tools to AI agents, built on FastMCP + FastAPI, with Docker support.
Built as a learning/portfolio project referencing the architecture of PrefectHQ/fastmcp, extended with several original pieces:
Auto-discovery tool registry — drop a file with a
register(mcp)function intoapp/tools/and it's picked up automatically. No manual wiring inmain.py.Per-client rate limiting — in-memory token bucket, keyed by API key.
API key auth on the HTTP surface (
/tools/*endpoints), independent from the raw MCP protocol endpoint.Structured logging with per-request IDs and timing.
/health and /metrics endpoints for basic observability.
Tools included
Tool | Description |
| Current weather for a lat/lon (Open-Meteo API) |
| Live FX conversion between currencies |
| Word/sentence count + estimated reading time for text |
| Server introspection (uptime, platform, python version) |
Running locally
pip install -r requirements.txt
python -m app.mainServer starts on http://localhost:8000.
MCP protocol clients connect to
http://localhost:8000/mcpHTTP clients can call
POST /tools/{tool_name}/invokewith headerx-api-key: <key>
Running with Docker
docker compose up --buildAdding a new tool
Create app/tools/my_tool.py:
def register(mcp) -> str:
@mcp.tool()
def my_tool(x: int) -> int:
"""Doubles a number."""
return x * 2
return "my_tool"That's it — no changes to main.py needed, it's discovered on startup.
Tests
pytest tests/Environment variables
Variable | Default | Description |
| 8000 | Server port |
| (empty = no auth) | Comma-separated allowed API keys |
| 20 | Max burst requests per client |
| 2 | Token refill rate per second |
| INFO | Logging verbosity |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Akhiljoshi03/Mcp-tool'
If you have feedback or need assistance with the MCP directory API, please join our Discord server