observe-instrument-mcp
Supports automatic instrumentation of agents built with the CrewAI framework, adding OpenTelemetry tracing.
Allows the MCP server to use Google Gemini models for generating instrumentation code.
Supports automatic instrumentation of agents built with the LangGraph framework, adding OpenTelemetry tracing.
Allows the MCP server to use local LLMs via Ollama for generating instrumentation code with no API key required.
Allows the MCP server to use OpenAI's models for generating instrumentation code, and supports instrumenting agents built with the OpenAI SDK.
The instrumented agents emit OpenTelemetry-compatible traces, metrics, and logs for observability.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@observe-instrument-mcpAdd observe SDK instrumentation to my_agent.py"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
observe-instrument-mcp
An MCP server that automatically instruments Python AI agents with the ioa-observe-sdk — adding OpenTelemetry-based tracing, metrics, and logs with zero manual effort.
Works with any MCP-compatible AI coding assistant: Claude Desktop, Cursor, Windsurf, and others.
What it does
Two tools:
instrument_agent — reads a Python agent file, applies full observe SDK instrumentation, writes it back, and returns a summary of changes. Creates a .bak backup before modifying.
check_instrumentation — audits a file for missing instrumentation without modifying it.
Supported frameworks: LlamaIndex, LangGraph, CrewAI, raw OpenAI SDK.
Related MCP server: cursor-otel
Installation
pip install observe-instrument-mcp
# or
uv add observe-instrument-mcpRequires an API key for your chosen LLM provider. Defaults to Claude (ANTHROPIC_API_KEY). See supported providers below.
Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"observe-instrument": {
"command": "uvx",
"args": ["observe-instrument-mcp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"observe-instrument": {
"command": "uvx",
"args": ["observe-instrument-mcp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"observe-instrument": {
"command": "uvx",
"args": ["observe-instrument-mcp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Examples
Ready-to-use uninstrumented agent files are included in the examples/ folder:
examples/
single-agent/
openai-sdk-example.py # OpenAI SDK customer support agent
langgraph-example.py # LangGraph currency converter
llama-index-example.py # LlamaIndex math agent
crewai-example.py # CrewAI research crew
multi-agent/
openai-sdk-multi-agent-example.py # OpenAI SDK orchestrator pipeline
langgraph-multi-agent-example.py # LangGraph supervisor pattern
llama-index-multi-agent-example.py # LlamaIndex research + writing pipeline
crewai-multi-agent-example.py # CrewAI research + publishing crewsUsage
Once configured, ask your AI assistant:
Instrument my agent with the observe SDK: path/to/my_agent.pyCheck what observe SDK instrumentation is missing from path/to/my_agent.pyEnvironment variables
Variable | Description |
| Model to use (default: |
| Required for Anthropic models |
| Required for OpenAI models |
| Required for Google Gemini models |
| Required for Groq models |
Supported providers
Provider | Key variable |
|
Anthropic |
|
|
OpenAI |
|
|
Google Gemini |
|
|
Groq |
|
|
Ollama (local, free) | none |
|
After instrumentation
Install the SDK in your project:
pip install ioa-observe-sdk
# or
uv add ioa-observe-sdkStart the observability stack (OTel Collector + ClickHouse):
cd path/to/observe/deploy
docker compose up -dRun your agent:
OPENAI_API_KEY=sk-... OTLP_HTTP_ENDPOINT=http://localhost:4318 python my_agent.pyQuery traces:
docker exec -it clickhouse-server clickhouse-client --user admin --password adminSELECT SpanName, ServiceName, Duration / 1000000. AS ms, Timestamp
FROM otel_traces
ORDER BY Timestamp DESC
LIMIT 20;Development
git clone https://github.com/alanzha2/observe-instrument-mcp
cd observe-instrument-mcp
pip install -e .
# Test the server locally
mcp dev observe_instrument_mcp/server.pyLicense
Apache-2.0
Available Tools
2 toolscheck_instrumentationARead-onlyIdempotent
Audit a Python AI agent file for missing ioa-observe-sdk instrumentation.
Read-only — does not modify the file. Use instrument_agent to apply changes.
Args: file_path: Path to the Python file to audit.
Returns: Audit report: what is present, what is missing, and specific recommendations.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds context about the audit scope (missing instrumentation) and the return content (audit report with specifics), which goes beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences: purpose, read-only note with sibling link, and args/returns. Front-loaded main purpose, no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given one parameter, implied output schema, and sibling tool, the description covers purpose, behavior, parameters, and return value. No missing context for proper use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description's 'Args' section explains that 'file_path' is 'Path to the Python file to audit', adding meaning beyond the schema's type and title.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Audit' and resource 'Python AI agent file', specifying the scope 'for missing ioa-observe-sdk instrumentation'. It clearly distinguishes from the sibling tool 'instrument_agent' by stating 'Read-only — does not modify the file'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states 'Read-only — does not modify the file' and 'Use instrument_agent to apply changes', providing clear when-to-use and when-not-to-use guidance with an explicit alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
instrument_agentA
Read a Python AI agent file, add ioa-observe-sdk instrumentation, and write it back.
Adds Observe.init(), SDK imports, @tool/@agent/@graph/@workflow decorators, and session_start() — covering LlamaIndex, LangGraph, CrewAI, and raw OpenAI SDK agents. Creates a .bak backup before modifying the file.
Args: file_path: Path to the Python file to instrument. app_name: Optional app name for Observe.init(). Inferred from file if omitted.
Returns: Summary of all changes made, the diff, and next steps.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| app_name | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate non-read-only, non-destructive, non-idempotent, non-open-world. The description adds behavioral details: creating a .bak backup, modifying the file by adding imports and decorators, and returning a summary. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a main purpose sentence, followed by details and an Args section. It is concise (6 sentences) but front-loads key information appropriately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists and the description covers the return (summary, diff, next steps) and backup behavior, it is largely complete. Minor gaps like error handling or file existence prerequisites are absent but not critical.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description fully compensates. It explains 'file_path' as the path to the Python file and 'app_name' as an optional app name for Observe.init() inferred from the file if omitted, adding meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's action: reading a Python AI agent file, adding instrumentation, and writing it back. It specifies the resource (Python AI agent file) and lists supported frameworks (LlamaIndex, LangGraph, CrewAI, raw OpenAI SDK), distinguishing it from the sibling tool 'check_instrumentation'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit guidance on when to use this tool versus alternatives like 'check_instrumentation'. It implies usage for instrumenting a file but lacks when-not-to-use conditions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.1.2- First observed
check_instrumentation - First observed
instrument_agent
TDQS
The two tools have clearly distinct purposes: one audits for missing instrumentation (read-only), the other applies the instrumentation (modifies the file). There is no overlap or ambiguity.
Both tools follow a consistent verb_noun snake_case pattern: check_instrumentation and instrument_agent. The naming is clear and predictable.
With only 2 tools, the server is minimal but appropriately scoped for its specific workflow of auditing and instrumenting Python AI agent files. It is slightly below the typical 3-15 range but still well-focused.
The tool set covers the full lifecycle for the stated purpose: check for missing instrumentation and apply it. There is no obvious gap—the backup creation in instrument_agent provides a safety net.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for AI dialogue using various LLM models via AceDataCloud
One connector for 15,000+ MCP servers plus your team's private MCPs, from any AI client.
- ArcjetOAuthcom.arcjet
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides comprehensive monitoring and observability for MCP server ecosystems with real-time health checks, performance metrics, distributed tracing, anomaly detection, and automated performance reports using OpenTelemetry and Prometheus.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that instruments Cursor AI agent interactions with OpenTelemetry traces and logs to monitor agent turns and performance. It enables tracking of user queries, assistant responses, and tool usage through GenAI-compliant telemetry spans.MIT
- AlicenseAqualityDmaintenanceMCP server that gives AI agents access to your application's OpenTelemetry traces for querying, analysis, and debugging.5162MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that demonstrates comprehensive observability with Sentry, OpenTelemetry, and Braintrust, providing tools for file, data, and HTTP operations along with real-time status and configuration resources.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/alanzha2/observe-instrument-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server