
Observe Instrument Mcp
io.github.alanzha2由 GitHub 账号 alanzha2 发布v0.1.2更新于 Oct 24, 2026
Add OpenTelemetry tracing to Python AI agents. Supports LangGraph, LlamaIndex, CrewAI, OpenAI SDK.
概览
一个 MCP 服务器,通过改写 Python AI 代理代码来添加基于 OpenTelemetry 的追踪、指标和日志。
- 可以做什么
- 它提供两个工具:instrument_agent 读取 Python 代理文件,应用完整的 ioa-observe-sdk 插桩,写回文件并返回变更摘要;check_instrumentation 在不修改文件的情况下审计缺失的插桩。支持 LlamaIndex、LangGraph、CrewAI 和原生 OpenAI SDK。修改前会创建 .bak 备份。
- 适用场景
- 当你有一个基于受支持框架构建的 Python AI 代理,并希望以最少的手动编辑添加基于 OpenTelemetry 的追踪、指标和日志时使用。它也适合审计现有代理文件,查看缺少哪些插桩。
- 运行要求
- 作为本地 stdio 进程运行,从 PyPI 安装(pip install observe-instrument-mcp 或 uv add observe-instrument-mcp)。需要所选 LLM 提供商的 API 密钥:ANTHROPIC_API_KEY(默认)、OPENAI_API_KEY、GEMINI_API_KEY 或 GROQ_API_KEY;Ollama 不需要密钥。LLM_MODEL 用于选择模型。插桩后,项目需要 ioa-observe-sdk 以及 OTel Collector 和 ClickHouse 栈。
安装
在 SourceWeft 中
- 打开 控制台中的 Observe Instrument Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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.
Installation
Requires 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:
Cursor
Add to .cursor/mcp.json in your project:
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Examples
Ready-to-use uninstrumented agent files are included in the examples/ folder:
Usage
Once configured, ask your AI assistant:
Environment variables
Supported providers
After instrumentation
Install the SDK in your project:
Start the observability stack (OTel Collector + ClickHouse):
Run your agent:
Query traces:
Development
License
Apache-2.0
来源:README.md,提交 4c7ab11
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。