LangSmith MCP Server
Provides read-only access to LangSmith traces that contain LangGraph auto-instrumented configuration, including graph_id, thread_id, and model information, enabling inspection of LangGraph runs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LangSmith MCP Serverlist recent runs from project 'my-app'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LangSmith MCP Server
FastMCP-based MCP server exposing LangSmith read-only tools for querying existing traces (runs, children, URLs) without extra instrumentation.
Tools
ls_list_runs(project_name, is_root=True, limit=50, select?)— List recent runs with filteringls_read_run(run_id, hydrate_children=False, child_limit=100)— Read single run with optional childrenls_get_run_url(run_id)— Generate shareable LangSmith URLsls_list_children(parent_run_id, limit=100)— List child spans for parent run
Related MCP server: Langfuse MCP Server
Requirements
Python 3.10+
LANGSMITH_API_KEYin your environmentOptional:
LANGSMITH_ENDPOINTfor on-prem deployments
Quick Start
# Clone and setup
git clone <repo-url>
cd langsmith-mcp-server
# Install dependencies (uv manages environment automatically)
uv sync
export LANGSMITH_API_KEY="lsv2_pt_..."
# Run smoke test
uv run python tests/smoke_test.py
# Run unit tests
uv run pytest tests/test_server.py -vRun as MCP Server
Local Development
Recommended (using fastmcp.json for configuration):
# FastMCP auto-detects fastmcp.json in current directory
fastmcp run
# Or via uv
uv run fastmcp run fastmcp.jsonAlternative (direct Python):
uv run python src/server.pyFastMCP Cloud Deployment
Deploy to FastMCP Cloud for free hosting:
Push to GitHub:
don-aie-cohort8/langsmith-mcp-serverSign in to https://fastmcp.cloud
Create new project:
Repository:
don-aie-cohort8/langsmith-mcp-serverBranch:
mainEntrypoint:
src/server.py:app
Add environment variable:
LANGSMITH_API_KEYDeploy!
Auto-deploys on every push to main.
MCP Client Configuration
Local Development
Add to your MCP client config (Claude Desktop, Claude Code, etc.):
{
"mcpServers": {
"langsmith-local": {
"command": "uv",
"args": [
"run",
"--with", "fastmcp",
"fastmcp",
"run",
"/absolute/path/to/langsmith-mcp-server/src/server.py:app"
]
}
}
}Note: Replace /absolute/path/to/langsmith-mcp-server with your actual project path.
Why this pattern?
Uses
uv run --with fastmcpper official FastMCP recommendationsCreates isolated environment with clean dependency management
Avoids dependency on global
fastmcpinstallationRuntime dependencies pulled from
pyproject.tomlvia editable installNo need to list all dependencies in MCP config
FastMCP Cloud
For cloud deployment:
{
"mcpServers": {
"langsmith-cloud": {
"url": "https://langsmith-mcp-server.fastmcp.app/mcp"
}
}
}Project Structure
Following FastMCP and Python best practices:
langsmith-mcp-server/
├── src/
│ └── server.py # MCP server implementation (~190 lines)
├── tests/
│ ├── smoke_test.py # Startup validation
│ ├── test_server.py # Unit tests
│ ├── test_integration.py # Integration tests
│ └── README.md # Testing documentation
├── scripts/
│ ├── integration_demo.py # Demo script for testing tools
│ └── claude-agent-sdk-testing/ # Claude Agent SDK integration
├── docs/
│ ├── PRODUCTION_READINESS.md # Production deployment guide
│ ├── MCP_FIX_REPORT.md # Historical fix documentation
│ ├── SERIALIZATION_FIX.md # Pydantic compatibility fixes
│ └── TESTING_REPORT.md # Testing results
├── notebooks/ # Jupyter notebooks for exploration
├── fastmcp.json # Deployment configuration
├── pyproject.toml # Package metadata and dependencies
└── README.md # This fileDependency Management
This project uses a dual-file approach for dependencies:
pyproject.toml: Defines all Python dependencies (runtime + dev)
fastmcp.json: Deployment configuration that references pyproject.toml via
"editable": ["."]
When you run uv sync, dependencies are installed from pyproject.toml. FastMCP automatically loads them via the editable install.
Usage Tips
Use
select=["id","name","error","extra"]for minimal payloadsLangGraph auto-instrumented config appears under
run.extra(e.g.,graph_id,thread_id,research_model)All tools are read-only by design (no create/update/delete operations)
References
Client:
Server:
Available Tools
5 toolsls_get_run_urlA
Generate a shareable LangSmith UI URL for a run.
Args: run_id: Run ID to generate URL for (required)
Returns: Shareable LangSmith URL (e.g., https://smith.langchain.com/o/.../runs/...)
Inputs: run_id (required). Returns: result
ls_list_childrenA
List child spans for a given parent run.
Args: parent_run_id: Parent run ID (required) limit: Maximum children to return (default: 100, range: 1-500)
Returns: List of child run objects with id, name, run_type, timing, and error info
Inputs: parent_run_id (required), limit. Returns: Result from ls_list_children containing list of child runs.
ls_list_projectsA
List projects from LangSmith workspace.
Args: limit: Maximum projects to return (default: 10, range: 1-200)
Returns: List of project objects with id, name, start_time, tenant_id, and optional statistics
Inputs: limit. Returns: Result from ls_list_projects containing list of projects.
ls_list_runsA
List recent runs from LangSmith (root-only by default).
Args: project_name: LangSmith project name (required) is_root: Only return root runs when true (default: True) run_type: Filter by run type (e.g., 'llm', 'chain', 'tool') error: Filter by error status - True=failed only, False=successful only, None=all start_minutes_ago: Lookback window in minutes (default: 1440 = 24 hours, min: 1) limit: Maximum runs to return (default: 50, range: 1-200) select: List of fields to return (default: id, name, run_type, start_time, end_time, error, tags, extra)
Inputs: project_name (required), error, limit, select, +3 more. Returns: Result from ls_list_runs containing list of runs.
ls_read_runA
Read a single run with optional children hydration.
Args: run_id: Run ID to fetch (required) hydrate_children: Include child spans in response (default: False) child_limit: Maximum children to return when hydrate_children=True (default: 100, range: 1-500)
Inputs: run_id (required), child_limit, hydrate_children. Returns: Result from ls_read_run containing run data, optional children, and URL.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 5 tools
Each tool targets a distinct resource and action: listing runs, reading a single run, generating a URL, listing children, and listing projects. There is no ambiguity or overlap between them.
All tools share a consistent 'ls_' prefix, but the verbs mix 'list', 'read', and 'get', creating a slight inconsistency. The pattern is still readable and predictable, but not as uniform as a pure verb_noun convention.
Five tools is a well-scoped set for exploring LangSmith runs and projects. Each tool serves a specific purpose without redundancy or bloat.
The set covers all essential read-only workflows for runs, children, and projects. Minor gaps exist, such as no direct project detail tool or search/filter beyond what's offered, but these are workarounds and not dead ends.
Related MCP Connectors
Experiment tracking for coding agents: read your team's ML runs, metrics and lineage. Read-only.
Query Honeycomb observability data: traces, events, metrics, SLOs, triggers, and boards.
Run read-only GraphQL queries and list documents and media assets in Caisy.
LLM API discovery: access conditions, dated costs, sampled checks and keyless configs. Read-only.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and MCP clients to query and debug Langfuse traces, sessions, exceptions, prompts, datasets, annotation queues, scores, and metrics, with selective tool loading and read-only mode.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and MCP clients to query and debug Langfuse traces, sessions, observations, exceptions, prompts, datasets, metrics, and scores locally. It supports read-only mode and selective tool loading for safer, more efficient observability workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to query and debug trace, session, exception, prompt, dataset, score, and metric data, with selective tool loading and read-only operation for safer local observability workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and developers to query trace, session, exception, routing, prompt, dataset, score, and metrics data for debugging, triage, and observability, with selective tool loading and a read-only mode.-