Cover image
Try Now
2025-03-31

A lightweight TypeScript middleware for MCP SDK servers that delivers analytics. Captures request metrics, performance data, and usage patterns with minimal overhead. Features real-time monitoring, configurable data collection, and detailed reporting - all with full type safety.

3 years

Works with Finder

2

Github Watches

1

Github Forks

1

Github Stars

MCP Analytics Middleware

npm version npm downloads

A simple way to track and visualize how your MCP server is being used. See which tools are most popular, catch errors early, and understand your server's performance.

Features

  • 🔍 Track all tool calls and resource requests
  • 📊 See performance metrics and error rates
  • 🌐 Web dashboard for live analytics
  • 💾 SQLite database for persistent storage

Quick Start

  1. Install the package:
yarn add mcp-analytics-middleware
  1. Add it to your MCP server:
import { McpAnalytics } from 'mcp-analytics-middleware';

let server = new McpServer({ 
name: 'Sample MCP Server with Analytics',
version: '1.0.0'
});

const analytics = new McpAnalytics('analytics.db');

server = analytics.enhance(server); // override tool and resource function implementation to record usage in sqlite

Live Analytics

Want to see a dashboard for a Tyescript SDK MCP Server making use of this middleware? You can directly provide a live dashboard using

npx -p mcp-analytics-middleware web-viewer --db-path analytics.db

The web dashboard will open at http://localhost:8080 and show you live analytics!

You'll see:

  • Total tool calls and resource requests
  • Error rates and performance metrics
  • Most used tools and slowest operations

Example Implementations

Example implementatinos of the analytics middleware can be found.

  1. Dummy Caluclator Server Example src/server.ts
  2. Ethereum RPC MCP Server with Analytics server/index.ts_
  3. Forked Verision of the Google Maps MCP Server with additional Analytics Middleware src/google-maps/index.ts

Running with Inspector

If you're using the MCP Inspector, just add the analytics flag:

yarn inspector --analytics --db-path analytics.db

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Lists Tailwind CSS classes in monospaced font

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • jae-jae
  • MCP server for fetch web page content using Playwright headless browser.

    Reviews

    5 (1)
    Avatar
    user_LkxlCcdJ
    2025-04-16

    As a dedicated user of mcp-analytics-middleware, I highly recommend it for anyone looking to streamline their data analytics processes. Developed by the talented Phillip-Kemper, this middleware integrates seamlessly with various applications, enhancing your data management capabilities. The user-friendly interface and robust functionality have significantly improved my workflow. Check it out on GitHub: https://github.com/Phillip-Kemper/mcp-analytics-middleware.