Token导航 LogoToken导航TokenDH.com
Langsmith MCP logo
运维云端stdio官方级别未说明来源级核验

Langsmith MCP

MCP Server

LangSmith MCP 服务器是一个用于 LangSmith 可观察性集成的工具,提供会话历史检索、提示管理、跟踪分析和使用情况追踪功能。

工具数

13

提示词数

0

GitHub Stars

0

资源数

0
Python云端部署Docker

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

lesleslie

提供方

lesleslie

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e .

详细介绍

LangSmith MCP服务器

![Code style: crackerjack](https://github.com/lesleslie/crackerjack) ![Runtime: oneiric](https://github.com/lesleslie/oneiric) ![Framework: FastMCP](https://github.com/jlowin/fastmcp) ![uv](https://github.com/astral-sh/uv) ![Python: 3.13+](https://www.python.org/downloads/)

MCP服务器 朗匠 可观测性集成。提供用于检索对话历史记录、管理提示、分析跟踪和跟踪使用情况的工具。

特性

类别工具目的
对话历史get_thread_history使用基于字符的分页检索线程消息历史记录
提示管理list_prompts, get_prompt, push_prompt使用版本控制管理LangSmith提示
痕迹与奔跑fetch_runs, list_projects调试LLM调用,分析执行跟踪
数据集list_datasets, get_dataset, list_examples, create_dataset, create_examples评估数据集管理
实验list_experiments, get_experimentA/B测试和评估结果
计费get_billing_usage成本跟踪和使用指标
健康health_check服务器运行状况和连接状态

安装

# Using uv (recommended)
uv pip install -e .

# Or with pip
pip install -e .

配置

环境变量

# Required
export LANGSMITH_API_KEY="your-api-key-here"

# Optional
export LANGSMITH_WORKSPACE_ID="your-workspace-id"
export LANGSMITH_API_ENDPOINT="https://api.smith.langchain.com"

配置文件

编辑 settings/langsmith.yaml 对于持久配置:

server_name: "LangSmith MCP Server"
api_endpoint: "https://api.smith.langchain.com"

pagination:
  max_chars_per_page: 25000

features_enabled:
  - conversation
  - prompts
  - traces
  - datasets
  - experiments
  - billing

用法

启动MCP服务器

# Using the CLI
langsmith-mcp start

# Or directly
python -m langsmith_mcp

MCP工具

获取线程历史记录

# Retrieve conversation history with pagination
result = await get_thread_history({
    "thread_id": "thread_abc123",
    "project_name": "my-project",
    "page_number": 1,
    "max_chars_per_page": 25000
})

管理提示

# List all prompts
prompts = await list_prompts(limit=100)

# Get specific prompt
prompt = await get_prompt({
    "prompt_identifier": "my-prompt",
    "version": "v1.0.0"  # Optional
})

# Push new prompt version
result = await push_prompt({
    "prompt_identifier": "my-prompt",
    "content": "You are a helpful assistant...",
    "metadata": {"category": "system"}
})

分析痕迹

# List projects
projects = await list_projects()

# Fetch runs/traces
runs = await fetch_runs({
    "project_id": "proj_abc123",
    "limit": 100
})

管理数据集

# List datasets
datasets = await list_datasets()

# Create dataset
dataset = await create_dataset({
    "name": "Test Dataset",
    "description": "Evaluation dataset",
    "data_type": "kv"
})

# Add examples
examples = await create_examples({
    "dataset_id": "ds_abc123",
    "examples": [
        {"input": "Hello", "output": "Hi there!"},
        {"input": "Goodbye", "output": "See you later!"}
    ]
})

轨道使用情况

# Get billing usage
usage = await get_billing_usage({
    "start_date": "2024-01-01",
    "end_date": "2024-01-31"
})

与Mahavishnu生态系统的整合

LangSmith MCP与博大生态系统整合:

组件集成
马哈维什努成本跟踪→ 路由指标预算警报
阿科沙痕迹分析→ LLM调用中的模式检测
会话伙伴线程历史记录→ 会话关联

示例:与Mahavishnu的成本整合

# In Mahavishnu's CostOptimizer
async def aggregate_costs(self) -> dict:
    """Combine routing costs + LangSmith billing."""
    routing_costs = await self.get_routing_costs()

    # Call LangSmith MCP for billing data
    langsmith_result = await langsmith_mcp.get_billing_usage({})
    langsmith_costs = langsmith_result.get("data", {})

    return self._merge_cost_reports(routing_costs, langsmith_costs)

发展

运行测试

pytest
pytest --cov=langsmith_mcp

代码质量

ruff check langsmith_mcp/
ruff format langsmith_mcp/
pyright langsmith_mcp/

建筑

langsmith-mcp/
├── langsmith_mcp/
│   ├── __init__.py       # Package exports
│   ├── __main__.py       # Oneiric CLI entry point
│   ├── config.py         # LangSmithSettings (mcp-common)
│   ├── client.py         # LangSmith API client
│   └── main.py           # FastMCP server + tools
├── settings/
│   └── langsmith.yaml    # Oneiric configuration
├── pyproject.toml
└── README.md

许可证

BSD-3条款

目录标签

目录标签

Python云端部署Docker会话历史本地部署提示管理跟踪分析使用情况追踪LangSmith集成

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

13

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

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

来源信息

继续浏览同类 MCP