Releases: tekkidev/mcpstat
Releases · tekkidev/mcpstat
v0.2.2
Added
- Latency Tracking: Track execution duration for each tool call
@stat.trackdecorator for automatic latency tracking (recommended)async with stat.tracking(name, type)context manager alternativeduration_msparameter inrecord()for manual timing- New latency columns:
total_duration_ms,min_duration_ms,max_duration_ms latency_summaryinget_stats()response with total duration- Per-tool
avg_latency_ms,min_duration_ms,max_duration_msmetrics
Changed
- Database schema bumped to v3 with latency tracking columns
get_stats()response now includeslatency_summaryobject- Each stat item now includes latency fields
- API Improvement:
@stat.trackdecorator is now the recommended way to track calls- Eliminates the "first line" requirement
- Automatic latency measurement
- Never fails user code
Migration
- Automatic database migration from v2 to v3
- Preserves all existing data
- New latency columns default to 0/NULL for existing records
v0.2.1
Added
- Token Tracking: New feature to track response sizes and estimate token usage
response_charsparameter inrecord()for automatic token estimationinput_tokensandoutput_tokensparameters for actual token tracking- New
report_tokens()method for deferred token reporting - Token summary in
get_stats()response with totals and averages
- Schema Migration: Automatic database migration from v1 to v2
- Adds token tracking columns with backward compatibility
- Preserves all existing data
- Documentation: Added new and updated guides, API references, and examples
Changed
- Database schema bumped to v2 with new columns:
total_input_tokens,total_output_tokenstotal_response_chars,estimated_tokens
get_stats()response now includestoken_summaryobject- Each stat item now includes token fields and
avg_tokens_per_call
v0.1.2
Added
- GitHub community files: CONTRIBUTING.md, SECURITY.md, issue/PR templates
- Tags System documentation with filtering examples
- Expanded API Reference with complete code examples
- Test coverage improved
Changed
- Improved README.md structure and navigation with collapsible MCP client configs
- Enhanced llms.txt for better AI agent consumption
v0.1.1
v0.1.0
Initial release.
Added
- Core:
MCPStatclass - unified API for usage tracking and analytics - Database:
MCPStatDatabase- SQLite-backed storage with async-safe operations - Logging:
MCPStatLogger- optional file-based audit logging (pipe-delimited format) - Built-in tools for exposing stats to MCP clients:
get_tool_usage_stats: Query tool usage statistics with filteringget_tool_catalog: Browse registered tools with tags, search, and metadata
- Prompts:
generate_stats_prompt()for LLM-friendly usage reports - Helpers:
build_tool_definitions()andbuild_prompt_definition()for easy MCP registration - Handler:
BuiltinToolsHandlerclass for handling built-in tool calls - Utils:
normalize_tags()with stopword filtering,derive_short_description()utilities - Metadata enrichment system with tags and descriptions
sync_tools(),sync_prompts(),sync_resources()for automatic metadata sync from MCP objectstype_filterparameter inget_tool_usage_statsfor filtering by primitive type- Environment variable configuration support (
MCPSTAT_DB_PATH,MCPSTAT_LOG_PATH,MCPSTAT_LOG_ENABLED) - Async-first design with thread-safe internals
- No required dependencies (pure Python stdlib)
- Optional
mcpextra for MCP SDK integration - Full type annotations with strict mypy compliance (
py.typedmarker included) - Comprehensive test suite