Server data from the Official MCP Registry
mcpstat documentation and demo server with local usage statistics, a tool catalog, and conversions.
About
mcpstat documentation and demo server with local usage statistics, a tool catalog, and conversions.
Security Report
Valid MCP server (3 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.
5 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: OTEL_SDK_DISABLED
Environment variable: OTEL_PROPAGATORS
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"mcpstat": {
"command": "uvx",
"args": [
"mcpstat==0.3.1"
],
"env": {
"OTEL_PROPAGATORS": "your-otel-propagators-here",
"OTEL_SDK_DISABLED": "your-otel-sdk-disabled-here"
}
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
mcpstat
Python observability and usage analytics for MCP (Model Context Protocol) servers.
Track tool, prompt, and resource calls, successful and failed invocations, and execution latency in local SQLite storage. Add tracking to your existing Python MCP server and expose its statistics as MCP tools that an assistant can query. Optional file logging provides an audit trail.
Installation
pip install mcpstat
pip install "mcpstat[server]" # Includes the SDK for the example below
Quick Start
from mcp.server import MCPServer
from mcpstat import MCPStat, disable_sdk_tracing
app = MCPServer("my-server")
disable_sdk_tracing(app)
stat = MCPStat("my-server")
@app.tool()
@stat.track(name="echo")
async def echo(message: str) -> str:
"""Return a message, tracking usage and latency automatically."""
return message
@app.tool()
async def get_tool_usage_stats() -> dict:
"""Return cumulative MCP usage statistics."""
return await stat.get_stats()
if __name__ == "__main__":
try:
app.run()
finally:
stat.close()
Connect your assistant to this server, then ask: "Give me MCP usage stats"
For a complete request-to-statistics example, follow the weather server walkthrough. It demonstrates successful calls, an intentional failure, unused tools, and statistics that persist after restarting the server.
Choose Your Integration
| Use case | Installation | What it tracks |
|---|---|---|
| Add tracking to an existing Python server | pip install mcpstat | The handlers you instrument with the SDK-independent library; keep your server's MCP SDK installed separately. |
| Run the bundled documentation and demonstration server | pip install "mcpstat[server]" | Its own temperature conversion tools and other registered handlers. |
The decorator records usage; register a statistics tool such as get_tool_usage_stats
to query that data from Claude Code, VS Code, or another MCP client. The standalone
server does not automatically observe other MCP servers.
Use mcpstat for Visual Studio Code to view calls, errors, latency and handler usage. Your server records the statistics. The extension reads them through VS Code's MCP tools, an HTTP endpoint, or directly from a SQLite database.
Features
- SQLite-backed - Stats persist across restarts
- Built-in MCP tools -
get_tool_usage_stats,get_tool_catalog - Tag 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 - Database operations run in worker threads with serialized transactions
Install mcpstat for the SDK-independent tracking library. The [server] extra includes
the SDK and the runnable mcpstat documentation and demonstration server. The standalone
server tracks its own calls; integrate the library into each server you want to monitor.
Documentation
Full Documentation - Quick start, API reference, examples
- Quick Start - Measure MCP usage and view statistics
- Configuration - Customize paths, logging, presets
- API Reference - Complete method reference
- Token Tracking - Cost analysis features
- Latency Tracking - Performance monitoring
- Agent Documentation Index - Links to plain Markdown guides and examples
- Full Agent Reference - Detailed integration and API summaries
Examples
# Clone and run example server
git clone https://github.com/tekkidev/mcpstat.git
cd mcpstat
pip install -e ".[dev]"
python examples/example_server.py
See examples/ for minimal and full integration patterns.
Contributing
See CONTRIBUTING.md. From a repository checkout, run tests with:
python -m pip install -e ".[dev]"
python -m 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.
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Rea
Freeby Morluto · Developer Tools
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Paperclip
Freeby Paperclipai · Developer Tools
Trending hip-hop artist momentum scores across four cultural dimensions.
Scrapling
Freeby D4Vinci · Developer Tools
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
Server Time
Freeby Modelcontextprotocol · Developer Tools
Current time lookup and conversion between IANA timezones
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
