LangSmith MCP Server
Official MCP server for LangSmith. Access traces, runs, prompts, datasets, experiments, and billing usage from the LangSmith observability platform.
The LangSmith MCP Server is the official Model Context Protocol integration maintained by LangChain AI for the LangSmith observability platform. It lets AI agents and MCP clients query LangSmith data directly: conversation thread histories, prompts in the prompt hub, traces and runs from projects, datasets and examples, experiment results, and organization billing usage. The server is built in Python and distributed via PyPI, Docker, or a free hosted endpoint on Render.
The server exposes tools across six functional areas. Conversation tools fetch thread message histories with character-based pagination. Prompt tools list and retrieve prompts by name. Trace tools fetch runs with FQL (filter query language) support and list projects. Dataset tools cover listing, reading, and example management. Experiment tools surface metrics across datasets, and billing tools return usage metrics for date ranges. A few tools (push_prompt, create_dataset, update_examples, run_experiment) are documentation-only and return instructions rather than executing the action.
Notable aspects: it is the canonical implementation from the LangChain AI org (MIT licensed, actively released), supports both stdio and HTTP-streamable transports, and offers a free hosted endpoint at langsmith-mcp-server.onrender.com/mcp so users can connect without local installation. Self-hosted LangSmith instances still require running the server locally with a custom LANGSMITH_ENDPOINT.
Tools
| Tool | Description |
|---|---|
get_thread_history |
Retrieve message histories for a thread using character-based pagination. |
list_prompts |
Fetch prompts from the LangSmith prompt hub with visibility filtering. |
get_prompt_by_name |
Retrieve a specific prompt by its name. |
push_prompt |
Documentation-only helper that returns instructions for creating prompts. |
fetch_runs |
Retrieve runs (traces) with filtering and FQL (filter query language) support. |
list_projects |
List LangSmith projects with optional filtering. |
list_datasets |
List datasets in the workspace. |
list_examples |
List examples within a dataset. |
read_dataset |
Read metadata for a specific dataset. |
read_example |
Read a specific example by ID. |
create_dataset |
Documentation-only helper returning instructions for creating datasets. |
update_examples |
Documentation-only helper returning instructions for updating dataset examples. |
list_experiments |
Retrieve experiment projects with associated metrics for a dataset. |
run_experiment |
Documentation-only helper returning instructions for running experiments. |
get_billing_usage |
Fetch organization usage metrics for a given date range. |
Prerequisites
- Python 3.10+ (3.11+ recommended)
uvpackage installer- A LangSmith API key from smith.langchain.com
Option 1: Hosted server (no install)
Point your MCP client at the free hosted endpoint on Render:
{
"mcpServers": {
"LangSmith MCP (Hosted)": {
"url": "https://langsmith-mcp-server.onrender.com/mcp",
"headers": {
"LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here"
}
}
}
}
Optional headers: LANGSMITH-WORKSPACE-ID, LANGSMITH-ENDPOINT.
Option 2: Local install via PyPI
uv run pip install --upgrade langsmith-mcp-server
Then add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"LangSmith API MCP Server": {
"command": "/path/to/uvx",
"args": ["langsmith-mcp-server"],
"env": {
"LANGSMITH_API_KEY": "your_key",
"LANGSMITH_WORKSPACE_ID": "workspace_id",
"LANGSMITH_ENDPOINT": "https://api.smith.langchain.com"
}
}
}
}
Option 3: Docker
docker build -t langsmith-mcp-server .
docker run -p 8000:8000 langsmith-mcp-server
Environment variables
LANGSMITH_API_KEY(required): API key from your LangSmith accountLANGSMITH_WORKSPACE_ID(optional): needed for multi-workspace API keysLANGSMITH_ENDPOINT(optional): custom endpoint for self-hosted LangSmith
- Debug a failing LLM chain by fetching the most recent error traces from a specific LangSmith project and summarizing common failure patterns.
- Audit prompt versions in the LangSmith prompt hub before a release, listing all public prompts and pulling the latest by name.
- Inspect dataset examples used for evaluation, comparing experiment metrics across model versions to pick the best variant.
- Reconstruct a conversation thread from production traces to reproduce a bug or generate a regression test case.
- Monitor LangSmith billing usage over a date range to detect spikes in trace volume or unexpected cost growth.
- "Fetch the last 20 failed runs from the
prod-agentproject and group the errors by type." - "Show me the conversation history for thread
abc-123in projectsupport-botand summarize the user's intent." - "List all public prompts in our LangSmith workspace and pull the latest version of
rag-system-prompt." - "Compare experiment metrics across the
eval-set-v2dataset and tell me which model variant had the highest accuracy." - "What was our total LangSmith trace usage between April 1 and April 30?"
- Official server maintained by LangChain AI (MIT licensed, actively released on PyPI).
- Broad coverage of LangSmith primitives: traces, prompts, datasets, experiments, threads, and billing.
- Multiple deployment options including a free hosted endpoint, stdio, Docker, and HTTP-streamable transport.
- Supports LangSmith's FQL filter language for precise run queries.
- Several write tools (push_prompt, create_dataset, update_examples, run_experiment) are documentation-only and do not execute the action.
- Requires a LangSmith account and API key; self-hosted LangSmith users must run the server locally with a custom endpoint.
- Python-only implementation, so Node-based MCP setups need
uv/uvxavailable in the environment.
- Langfuse MCP server: similar observability access for the open-source Langfuse platform.
- Arize Phoenix: tracing and evaluation tooling for LLM apps with community MCP integrations.
- Direct use of the LangSmith Python/TypeScript SDK if you need full read/write coverage beyond what the MCP server exposes.