mcpstat
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcpstatShow me the usage statistics for this server."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcpstat
Usage tracking and analytics for MCP servers. Pure Python, zero required dependencies.
Track which tools get called, how often, and keep an audit trail - all in 3 lines of code.
Installation
pip install mcpstatWith MCP SDK:
pip install "mcpstat[mcp]"Related MCP server: MCP Pulse
Quick Start
from mcp.server import Server
from mcpstat import MCPStat
app = Server("my-server")
stat = MCPStat("my-server")
@app.call_tool()
@stat.track # ← One decorator does everything!
async def handle_tool(name: str, arguments: dict):
# Your logic here - latency tracked automatically
return await my_logic(arguments)Then ask your AI assistant: "Give me MCP usage stats"
Features
SQLite-backed - Stats persist across restarts
Built-in MCP tools -
get_tool_usage_stats,get_tool_catalogTag system - Categorize and filter tools
Token tracking - Estimate or record actual token usage
Latency tracking - Measure execution duration, identify slow tools
File logging - Optional timestamped audit trail
Async-first - Thread-safe via
asyncio.Lock
Documentation
Full Documentation - Quick start, API reference, examples
Quick Start - Get running in 5 minutes
Configuration - Customize paths, logging, presets
API Reference - Complete method reference
Token Tracking - Cost analysis features
Latency Tracking - Performance monitoring
Examples
# Clone and run example server
git clone https://github.com/tekkidev/mcpstat.git
cd mcpstat
pip install -e ".[mcp]"
python examples/example_server.pySee examples/ for minimal and full integration patterns.
Contributing
See CONTRIBUTING.md. Run tests with:
pip install "mcpstat[dev]"
pytest tests/License
MIT - see LICENSE for details.
MCP is a trademark of its respective owners. This project is not affiliated with or endorsed by any trademark holders.
This server cannot be deployed
Maintenance
Related MCP Connectors
Analytics for MCP servers. Query your tool calls, first-call success, retries and schema cost.
Analytics for MCP servers. Find out which of your tools agents get wrong. MCPulse shows you which tools AI agents retry, which come back empty, and which they never call at all. Two lines inside your own server. It never sees your arguments or your results. getmcpulse.com
- AgentCatOAuthcom.agentcat
Analytics and debugging for your MCP server — explore usage and sessions, then root-cause errors.
Agent Cost Allocator MCP — multi-tenant LLM cost attribution for chargeback billing. Companion to
Related MCP Servers
- AlicenseAqualityDmaintenanceA MCP server for tracking AI usage metrics and structured logs across applications. Monitor model calls, analyze usage patterns, track costs, and debug AI interactions.59 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables sharing MCP servers with clients, storing tool calls in PostgreSQL, and providing usage analytics via an admin dashboard and API.-
- AlicenseAqualityAmaintenanceAn MCP server that records agent execution metrics and exposes a Context Window Explorer to visualize exactly what entered the model's context window across sessions, tokens, and tool calls.83MIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server for querying AI usage metrics (exact tokens, cost, latency, errors, productivity) from a local SQLite database, enabling charts and analysis in Claude Code and Cursor.-