Token导航 LogoToken导航

MCP Server · 开发工具

Trace Agent

轻量级Python可观测性SDK,用于分布式追踪和Span管理,无需外部收集器。

stdio官方级别未说明来源级核验工具 3
可观测性Python性能监控

快速开始

作者 / 组织
TECHKNOWMAD-LABS
提供方
TECHKNOWMAD-LABS

工具数量

3

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Trace Agent 属于开发工具类 MCP Server,公开资料标注 3 个工具,通过stdio 本地进程接入,客户端适配情况以官方文档为准,有可以直接复制的安装命令;接入前先确认权限范围。

分类

开发工具

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

pip install traceagent # production

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 对应的运行时,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 3 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

示踪剂

用于分布式跟踪和跨度管理的轻量级Python可观测性SDK。不需要外部收集器。

______________________________________________________________________

特性

  • 上下文管理器跨度 --开始和结束跨度 with tracer.start_span(...),自动捕获开始/结束时间和持续时间。
  • 装饰仪器 --用以下命令包裹任何同步或异步函数 @trace / @trace_async;捕获异常,并将范围标记为ERROR。
  • 可插拔存储 --船舶与 InMemoryStorage (默认)和 FileStorage 用于持久的、文件支持的跟踪。
  • MCP服务器 --通过模型上下文协议公开实时跟踪数据 list_traces, get_trace,以及 get_stats 工具。
  • 丰富的终端仪表板 --使用以下工具在终端中呈现跟踪和聚合统计信息 dashboard 模块。
  • 线程和异步安全 --通过螺纹锁保护存储;主动跨度跟踪用途 contextvars.ContextVar 以实现正确的异步隔离。

______________________________________________________________________

安装

pip install traceagent          # production
pip install "traceagent[dev]"   # includes pytest, pytest-asyncio, ruff

或来源:

git clone https://github.com/techknowmad/trace-agent.git
cd trace-agent
pip install -e ".[dev]"

______________________________________________________________________

快速开始

from traceagent import get_tracer, trace, trace_async

# --- Context manager ---
tracer = get_tracer()

with tracer.start_span("db.query", attributes={"table": "users"}) as span:
    span.add_event("cache_miss")
    rows = fetch_rows()          # your code here

# --- Sync decorator ---
@trace(name="process-request")
def handle(request):
    return {"ok": True}

# --- Async decorator ---
@trace_async(name="fetch-data")
async def fetch(url: str):
    async with httpx.AsyncClient() as client:
        return await client.get(url)

# --- Persistent storage ---
from traceagent import FileStorage, Tracer

tracer = Tracer(storage=FileStorage("/tmp/traces"))

with tracer.start_span("batch-job") as span:
    span.set_attribute("records", 1_000)

______________________________________________________________________

MCP服务器

from traceagent.mcp_server import MCPServer

server = MCPServer()

# List all recorded traces
traces = server.call_tool("list_traces")

# Retrieve a specific trace by ID
trace  = server.call_tool("get_trace", {"trace_id": ""})

# Aggregate statistics
stats  = server.call_tool("get_stats")

______________________________________________________________________

建筑

traceagent/
├── models.py        # Span, Trace, SpanStatus — pure dataclasses, no I/O
├── tracer.py        # Tracer — span lifecycle, ContextVar active-span tracking
├── storage.py       # InMemoryStorage, FileStorage — thread-safe backends
├── decorators.py    # @trace, @trace_async — wraps functions, captures errors
├── mcp_server.py    # MCPServer — MCP-protocol tool surface over live storage
└── dashboard.py     # Rich-powered terminal renderer for traces and stats

数据流:

caller
  └─ Tracer.start_span()
       ├─ creates Span (model)
       ├─ sets ContextVar (active span)
       └─ on __exit__ / exception
            ├─ records end_time, duration_ms, SpanStatus
            └─ Storage.save_span()
                  ├─ InMemoryStorage  →  dict in process memory
                  └─ FileStorage      →  JSON files on disk

MCPServer
  └─ reads from Storage → serves list_traces / get_trace / get_stats

______________________________________________________________________

发展

# Run all tests
pytest -v

# Lint
ruff check .

# Run a single test module
pytest tests/test_tracer.py -v

______________________________________________________________________

贡献

看 贡献.md 用于分支约定、代码风格和拉取请求指南。

______________________________________________________________________

许可证

麻省理工学院 ©2026 TechKnowMad实验室私人有限公司

______________________________________________________________________

建造于 TechKnowMad实验室

工具与能力

工具数量

3

资源数量

0

提示词数量

0

能力标签

分布式追踪Python本地部署Span管理可观测性PythonSDK性能监控

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 3 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 运行环境,换机器要重新装一遍。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Trace Agent

MCP World · 本页

3stdio有1 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Trace Agent 怎么安装?

公开资料给出的安装命令是 pip install traceagent # production,运行环境为 未标注。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Trace Agent 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

Trace Agent 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Trace Agent 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Trace Agent 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP