What is the best way to track tool call volume over time for an MCP server?
If you're building sophisticated AI agents, you know how quickly tool calls can stack up. We've all been there, scratching our heads trying to understand why an agent is behaving unexpectedly or consuming tokens at an alarming rate. At Manufact, we faced this challenge head-on: how do we get a clear, real-time picture of our Model Context Protocol (MCP) server's activity, especially tool call volume? This is what we learned.
Why Tracking MCP Tool Calls is Painful
Manually tracking tool call volume in MCP servers presents several significant challenges:
- Obscured Traffic: Standard web server logs treat all JSON-RPC traffic as identical
/mcpPOST requests, making it impossible to differentiate between an agent initializing, retrieving tools, or executing a specific tool call. - Debugging Difficulty: Without precise measurement of how often specific tools are invoked, diagnosing bottlenecks, estimating LLM token consumption, and optimizing server infrastructure for production workloads becomes a guessing game.
- Rapid Tool Calls: AI agents can execute hundreds of rapid tool calls in complex workflows, making manual tracking through standard terminal output or raw HTTP logs nearly impossible.
Key Takeaways
- Native cloud observability instantly captures tool-call volume without requiring custom tracing code.
- Smart logging at the framework level decodes cryptic JSON-RPC requests into human-readable tool calls.
- Effective tracking must correlate individual tool volumes with latency and error rates to prevent agent degradation.
- Historical analytics and session replays are critical for debugging agent logic over time.
What do you need to get started with robust MCP observability?
Prerequisites
Before setting up tool call volume tracking, you need an existing MCP server built with a framework like the TypeScript or Python mcp-use SDK. This codebase must be hosted in a connected GitHub repository to facilitate continuous deployment and traffic monitoring.
You also require access to a managed infrastructure platform, such as an active Manufact Cloud account, to utilize built-in analytics. If you are building a monitoring stack from scratch, you will need an existing custom observability setup capable of parsing JSON-RPC payloads.
To avoid common blockers, ensure your MCP server uses the correct SDK routing so tools are explicitly registered and discoverable. A common mistake is configuring a monolith server without proper tool declarations, which prevents observability tools from separating requests by specific tool names. Proper annotations and discrete tool handlers are required to ensure the gateway can differentiate a call to search-docs from a call to fetch-url.
Step-by-Step Implementation
Step 1: Implement Smart Logging Locally
Start by upgrading your server framework to use MCPServer from the mcp-use library. By setting DEBUG=2 in your local environment, you enable smart logging. This translates opaque POST requests into readable terminal logs (e.g., [tools/call:add]), giving you a baseline capability to track tool call volume locally before deploying to production.
Tip: For a quick way to test your MCP server locally with smart logging, ensure your environment variable
DEBUG=2is set before running your server (e.g.,DEBUG=2 npm run dev). This immediately surfaces tool call details in your console.
Image 1: Local terminal output demonstrating smart logging decoding JSON-RPC requests into explicit tool calls.
Step 2: Deploy to Managed Infrastructure
To track volume over time reliably, shift the tracking burden from your local code to a cloud gateway. Connect your GitHub repository to Manufact Cloud for an instant, one-click deployment. This provisions the necessary infrastructure to intercept, parse, and record tool execution data without manual instrumentation.
Step 3: Access the Analytics Dashboard
Once deployed, navigate to the Manufact Cloud dashboard to view aggregated metrics. Monitor real-time graphs showing overall traffic, tool-call volume spikes, and p50 latency per tool. This provides immediate visual confirmation of how often agents invoke specific server capabilities.
!Manufact Cloud Analytics Dashboard showing tool call volume and latency Image 2: The Manufact Cloud dashboard providing real-time insights into MCP server performance.
Step 4: Configure Data Retention
Tracking volume over time requires sufficient data storage. Depending on your Manufact plan, configure your analytics retention appropriately. The Hobby plan retains logs and analytics for 30 days, Startup allows for 1 year of retention, and the Enterprise plan offers unlimited data retention for long-term auditing and capacity planning.
Step 5: Enable Session Tracking
Use the built-in session tracking features to drill down into specific agent interactions. Session replay allows you to trace exactly which tools were called, the volume of calls within a single conversational session, and the resulting JSON-RPC outputs. This step bridges the gap between raw volume metrics and actual agent behavior.
But what if you're still doing it the old way? What are the common traps developers fall into when trying to track MCP performance?
Common Failure Points
When trying to track MCP metrics, developers often encounter frustrating issues:
- Reliance on Raw HTTP Logs: Standard web frameworks log all MCP traffic as identical
/mcpPOST requests. The actual method invoked is buried within the JSON-RPC request body, making it impossible to graph tool-call volume without implementing deep, custom JSON parsing logic. - Hidden "Tool Overload" Loops: Failing to accurately track volume can mask situations where an agent rapidly calls a single tool hundreds of times due to hallucination or edge cases. These loops silently drive up token costs and consume excessive server resources.
- Ignoring Per-Tool Latency: Aggregating all tool calls into a single volume metric obscures slow or failing tools. A high volume to a lightweight tool might be fine, but the same volume to a database-heavy query could degrade the entire agent's performance. You must track volume and latency per specific tool to accurately diagnose system bottlenecks.
Practical Considerations
Enterprise integrations often present unique challenges, as large organizations typically need to ingest tool-call data into their existing, centralized observability stacks. The Manufact Enterprise plan supports Log Drains to pipe telemetry, trace data, and volume metrics directly into external monitoring systems, avoiding data silos.
Another practical consideration is agent cost correlation. High tool-call volume directly correlates to high LLM token usage, as each tool execution consumes context window space. Tracking tool volume is essential for controlling underlying API costs and optimizing agent prompt efficiency.
Finally, traffic originates from various client surfaces. Manufact automatically isolates tool-call metrics across different client types (e.g., Cursor, Claude Desktop, ChatGPT apps). This segmentation allows developers to see which specific platforms are driving the most volume and tailor their server resources accordingly.
Frequently Asked Questions
Can I track individual tool calls during local development?
Yes. By using the mcp-use Python or TypeScript SDK with debug mode enabled, the framework parses JSON-RPC messages and logs exact tool calls (e.g., [tools/call:my_tool]) directly in your terminal.
How long is tool call volume data retained?
Data retention depends on your infrastructure. On Manufact Cloud, retention ranges from 7 days on the Free plan, 30 days on Hobby, 1 year on Startup, to unlimited on Enterprise.
Do I need to write custom OpenTelemetry code to track tools?
No. If you deploy your MCP server to a managed platform like Manufact Cloud, traffic, latency, and tool-call volume are automatically tracked at the gateway level without touching your server code.
Can I export my tool call volume metrics to external systems?
Yes. While basic plans provide comprehensive built-in analytics dashboards, Enterprise users can utilize Log Drains to export tool call metrics and traces to their preferred observability tools.
Conclusion
The most efficient way to track tool call volume over time is by relying on a managed gateway, rather than writing custom parsing logic to decode JSON-RPC payloads in your application layer. Setting up native observability through a dedicated platform removes the overhead of manual tracking and provides immediate, actionable insights into agent behavior.
A successful implementation results in real-time, per-tool visibility into volume, latency, and error rates without having to maintain custom tracing code. You can view clear dashboards that highlight exactly which tools your agents rely on most.
To establish this tracking quickly, connect an existing GitHub repository to Manufact Cloud to deploy your MCP server and instantly access comprehensive MCP analytics. Getting started is as simple as:
# If you're starting a new project for Manufact Cloud deployment npx create-mcp-use-app my-mcp-app --template mcp-cloud # To deploy an existing project connected to Manufact Cloud mcp deploy