
LangSmith MCP Server
by amitrechavia
Connect AI agents to LangSmith — query traces, manage prompts, read datasets, run experiment queries, and track billing usage via MCP.
What it does
Bridges your AI coding environment directly to LangSmith — LangChain's observability and evaluation platform. Ask your AI agent to fetch trace runs from a project, inspect conversation thread history, manage prompt templates, explore evaluation datasets, and review billing usage, all without leaving your editor.
This is a TypeScript port of the official Python LangSmith MCP Server with 100% functional parity and char-based stateless pagination so responses stay within LLM context limits.
Tools
- get_thread_history — Retrieve message history for a conversation thread with char-budget pagination
- list_prompts — Fetch prompts with optional public/private visibility filter
- get_prompt_by_name — Get a specific prompt template by exact name
- push_prompt — Documentation tool: how to create and push prompts to LangSmith
- fetch_runs — Fetch traces/tool runs/chains from one or more projects with FQL filter support and auto-pagination
- list_projects — List LangSmith projects with optional name/dataset filtering
- list_datasets — Fetch datasets filtered by ID, type, name, or metadata
- list_examples — Read dataset examples with optional version (
as_of) and split filters - read_dataset / read_example — Read a single dataset or example by ID or name
- create_dataset / update_examples — Documentation tools for dataset creation and updates
- list_experiments — List experiment projects for a dataset with latency/cost/feedback metrics
- run_experiment — Documentation tool: how to run evaluations in LangSmith
- get_billing_usage — Fetch org billing usage (trace counts) for a date range with optional workspace filter
Installation
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"langsmith": {
"command": "npx",
"args": ["langsmith-mcp-server"],
"env": {
"LANGSMITH_API_KEY": "your-key"
}
}
}
}
Cursor / Claude Code (.cursor/mcp.json or MCP settings):
{
"mcpServers": {
"langsmith": {
"command": "npx",
"args": ["langsmith-mcp-server"],
"env": {
"LANGSMITH_API_KEY": "your-key"
}
}
}
}
Optional env vars: LANGSMITH_WORKSPACE_ID (multi-workspace API keys) and LANGSMITH_ENDPOINT (self-hosted or EU region).
Supported hosts
Claude Desktop, Cursor, Claude Code (any stdio-compatible MCP client).
Quick install
npx langsmith-mcp-server