
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 分
請在儲存庫或註冊中心條目中宣告授權條款。