/ 目录 / 演练场 / langsmith-fetch-skill
● 社区 OthmanAdi ⚡ 即开即用

langsmith-fetch-skill

作者 OthmanAdi · OthmanAdi/langsmith-fetch-skill

Debug LangChain / LangGraph agents from your terminal — fetches LangSmith Studio traces into Claude Code and analyzes failures, latency, tool calls.

A focused observability skill. When you ask Claude to debug an agent, it runs langsmith-fetch against LangSmith Studio, pulls trace data, analyzes execution patterns, and surfaces failures, root causes, latency hotspots, and tool-call issues. Export sessions for later review.

为什么要用

核心特性

实时演示

实际使用效果

langsmith-fetch-skill.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "langsmith-fetch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/OthmanAdi/langsmith-fetch-skill",
        "~/.claude/skills/langsmith-fetch-skill"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "langsmith-fetch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/OthmanAdi/langsmith-fetch-skill",
        "~/.claude/skills/langsmith-fetch-skill"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "langsmith-fetch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/OthmanAdi/langsmith-fetch-skill",
        "~/.claude/skills/langsmith-fetch-skill"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "langsmith-fetch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/OthmanAdi/langsmith-fetch-skill",
        "~/.claude/skills/langsmith-fetch-skill"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "langsmith-fetch-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/OthmanAdi/langsmith-fetch-skill",
        "~/.claude/skills/langsmith-fetch-skill"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "langsmith-fetch-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/OthmanAdi/langsmith-fetch-skill",
          "~/.claude/skills/langsmith-fetch-skill"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add langsmith-fetch-skill -- git clone https://github.com/OthmanAdi/langsmith-fetch-skill ~/.claude/skills/langsmith-fetch-skill

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: langsmith-fetch-skill

Diagnose a slow agent without opening LangSmith UI

👤 LangChain/LangGraph devs ⏱ ~20 min intermediate

何时使用: An agent that used to be snappy is now slow; you want root cause.

前置条件
  • LangSmith API key — smith.langchain.com -> Settings -> API Keys
  • Skill installed — git clone https://github.com/OthmanAdi/langsmith-fetch-skill ~/.claude/skills/langsmith-fetch-skill
步骤
  1. Ask Claude to diagnose
    Why is my agent <name> slow? Pull the last 20 traces from LangSmith and find the hotspot.✓ 已复制
    → Skill fetches traces; reports latency by step
  2. Drill in
    Focus on trace <id> — break down tool-call times.✓ 已复制
    → Per-tool latency with the outlier called out

结果: A specific step to optimize, not a hunch.

注意事项
  • Optimizing the average when tail latency is the problem — Ask for p95/p99 specifically
搭配使用: filesystem

Root-cause an agent failure from a trace id

👤 Anyone running LangGraph in production ⏱ ~15 min intermediate

何时使用: A user reported an error; you have the trace id.

步骤
  1. Fetch + analyze
    Debug trace <id>. What was the immediate error, what's the root cause in the graph?✓ 已复制
    → Error step + upstream decision that led to it

结果: A fix targeting the actual decision point, not the symptom.

Find which node burns the most tokens

👤 Teams optimizing LLM spend ⏱ ~30 min intermediate

何时使用: Monthly review of agent spend.

步骤
  1. Aggregate token usage
    Across last 7 days' traces, rank graph nodes by total token usage.✓ 已复制
    → Ranked table with % share
  2. Propose tightening
    For the top 3, propose prompt-compression or model downgrade options.✓ 已复制
    → Targeted opt list

结果: Measurable spend reduction without chasing tiny savings.

组合

与其他 MCP 搭配,撬动十倍杠杆

langsmith-fetch-skill + filesystem

Save exports alongside the agent code for lineage

Export the debugging session to debugging/traces/<date>.json.✓ 已复制
langsmith-fetch-skill + github

Attach trace summary to a bug report

Summarize trace <id> and post as comment on GitHub issue #42.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
fetch_recent project, limit Broad diagnosis LangSmith quota
fetch_trace trace_id Deep dive on one run LangSmith quota
analyze_failures traces Post-fetch analysis 0
export_session traces Archive for later 0

成本与限制

运行它的成本

API 配额
LangSmith: depends on plan; Studio has generous quotas
每次调用 Token 数
Low — traces are structured
费用
Free skill; LangSmith free tier covers most devs
提示
Use fetch_recent with a narrow window, not full history

安全

权限、密钥、影响范围

最小权限: LangSmith: read on your project(s)
凭据存储: LANGCHAIN_API_KEY in env
数据出站: Only to LangSmith (where the traces already live)
切勿授予: Write to LangSmith — skill only reads

故障排查

常见错误与修复

langsmith-fetch: command not found

Install LangSmith CLI or ensure it's on PATH

验证: which langsmith-fetch
Empty results

Check project name and time window; traces are project-scoped

替代方案

langsmith-fetch-skill 对比其他方案

替代方案何时用它替代权衡
LangSmith web UIYou prefer clickingNo Claude analysis

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills