Skip to main content

zymtrace MCP Server

zymtrace exposes GPU and Profiling data directly to AI agents through the Model Context Protocol (MCP).
This turns your performance profiles into an interactive, AI-driven workspaceβ€”where you can query flamegraphs, investigate regressions, and get optimization recommendations directly in your IDE or terminal.

MCP is an open standard that enables AI agents to securely connect to external data sources and tools. With zymtrace's MCP server, you can analyze profiles using natural language.

Demo​

Here's a demo on Claude code optimized Pytorch thermal simulation application, making it 7.5x faster.

Quick Start​

Step 1: Check Prerequisites​

Ensure you have:

  • zymtrace backend running (version 25.11.0 or higher)
  • MCP-compatible AI assistant (Claude Desktop/Code, Cursor, Cody, etc.)
  • Authentication credentials (if auth is enabled)

Step 2: Find Your MCP Endpoint​

Your MCP server endpoint is your zymtrace gateway URL + /mcp:

https://zymtrace.company.com/mcp

Step 3: Generate Authentication (If Required)​

For basic auth, encode your credentials:

echo -n "your-username:your-password" | base64

Step 4: Configure Your AI Assistant​

Choose your AI assistant and follow the setup:

Claude Desktop/Code​

With authentication:

claude mcp add zymtrace \
--transport http \
https://your-zymtrace-instance.com/mcp \
--header "Authorization: Basic YOUR_BASE64_STRING_HERE"

Without authentication (local development):

claude mcp add zymtrace-local \
--transport http \
http://localhost:8080/mcp

Then verify connectivity with claude mcp list

Cursor IDE​

Add to your MCP settings:

{
"mcpServers": {
"zymtrace": {
"type": "http",
"url": "https://your-zymtrace-instance.com/mcp",
"headers": {
"Authorization": "Basic YOUR_BASE64_STRING_HERE"
}
}
}
}

How to Query Your Data​

Prompt Structure​

Structure your prompts with these key components for best results:

ComponentDescriptionExamples
zymtraceAlways mention zymtrace"in zymtrace", "using zymtrace"
Profile typeSpecify CPU or GPU"CPU flamegraphs", "GPU metrics"
Analysis typeWhat you want to seeflamegraphs, top functions, top entities
Entity scopeWhere to lookcontainer, namespace, pod, script name
Time rangeWhen to analyzelast hour, 24 hours, since yesterday

Template:

"Analyze [PROFILE_TYPE] [ANALYSIS_TYPE] for [ENTITY] in zymtrace over [TIME_RANGE]"

Query Examples​

Optimization and Tuning​

"Analyze the thermal-diffusion simulation performance using GPU flamegraphs. What optimizations would you recommend based on the last 6 hours of data?"

"Identify the most expensive CUDA kernels in our vllm inference pipeline running in the vllm namespace and suggest improvements."

Performance Investigation​

"What are the top 5 CPU-intensive functions in the mortgage-api container over the last 24 hours?"

"Show me GPU utilization patterns for the ml-training pod since yesterday. What is the least optimal function and how do I fix it?"

"Which functions in the payment-service pod are consuming the most CPU over the last 1 hour?"

Troubleshooting​

Connection Issues​

MCP Server Connection Failed

  • Verify zymtrace backend is running

Token Limit Exceeded

  • For Claude Desktop/Code: Increase token limit in conversation settings
  • Environment variable: Set MAX_MCP_OUTPUT_TOKENS=500000
  • Query optimization: Use filters to reduce response size