LangSmith MCP Server
About
An MCP server for fetching conversation history and prompts from the LangSmith observability platform.
Details
- Author
- langchain-ai
- Categories
- Developer Tools, Infrastructure, AI, Other
Jump to
Setup
Install LangSmith MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/langchain-ai/langsmith-mcp-server
Follow the installation instructions in the repository README, then restart your MCP client.
An MCP server for fetching conversation history and prompts from the LangSmith observability platform.
A production-readyModel Context Protocol(MCP) server that provides seamless integration with theLangSmithobservability platform. This server enables language models to fetch conversation history, prompts, runs and traces, datasets, experiments, and billing usage from LangSmith.
The server enables powerful capabilities including:
- 💬Conversation History: "Fetch the history of my conversation from thread 'thread-123' in project 'my-chatbot'" (paginated by character budget)
- 📚Prompt Management: "Get all public prompts in my workspace" / "Pull the template for the 'legal-case-summarizer' prompt"
- 🔍Traces & Runs: "Fetch the latest 10 root runs from project 'alpha'" / "Get all runs for trace <uuid> (page 2 of 5)"
- 📊Datasets: "List datasets of type chat" / "Read examples from dataset 'customer-support-qa'"
- 🧪Experiments: "List experiments for dataset 'my-eval-set' with latency and cost metrics"
- 📈Billing: "Get billing usage for September 2025"
Ahosted versionof the LangSmith MCP Server is available over HTTP-streamable transport, so you can connect without running the server yourself:
- URL:https://langsmith-mcp-server.onrender.com/mcp
- Hosting:Render, built from this public repo using the project's Dockerfile.
Use it like any HTTP-streamable MCP server: point your client at the URL and send your LangSmith API key in theLANGSMITH-API-KEYheader. No local install or Docker required.
{ "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(same as in theDocker Deploymentsection below).
Note:This deployed instance is intended forLangSmith Cloud. If you use aself-hostedLangSmith instance, run the server yourself and point it at your endpoint—see theDocker Deploymentsection below.
The LangSmith MCP Server provides the following tools for integration with LangSmith.
Several tools usestateless, character-budget paginationso responses stay within a size limit and work well with LLM clients:
- Where it’s used:get_thread_historyandfetch_runs(whentrace_idis set).
- Parameters:You sendpage_number(1-based) on every request. Optional:max_chars_per_page(default 25000, cap 30000) andpreview_chars(truncate long strings with "… (+N chars)").
- Response:Each response includespage_number,total_pages, and the page payload (resultfor messages,runsfor runs). To get more, call again withpage_number = 2, then3, up tototal_pages.
- Why it’s useful:Pages are built by JSON character count, not item count, so each page fits within a fixed size. No cursor or server-side state—just integer page numbers.
-
Installuv(a fast Python package installer and resolver):
curl -LsSf https://astral.sh/uv/install.sh | sh
Clone this repository and navigate to the project directory:
git clone https://github.com/langchain-ai/langsmith-mcp-server.git cd langsmith-mcp-server
Once you have the LangSmith MCP Server, you can integrate it with various MCP-compatible clients. You have two installation options:
uv run pip install --upgrade langsmith-mcp-server
{ "mcpServers": { "LangSmith API MCP Server": { "command": "/path/to/uvx", "args": [ "langsmith-mcp-server" ], "env": { "LANGSMITH_API_KEY": "your_langsmith_api_key", "LANGSMITH_WORKSPACE_ID": "your_workspace_id", "LANGSMITH_ENDPOINT": "https://api.smith.langchain.com" } } } }
Add the following configuration to your MCP client settings (run from theproject rootso the package is found):
{ "mcpServers": { "LangSmith API MCP Server": { "command": "/path/to/uv", "args": [ "--directory", "/path/to/langsmith-mcp-server", "run", "langsmith_mcp_server/server.py" ], "env": { "LANGSMITH_API_KEY": "your_langsmith_api_key", "LANGSMITH_WORKSPACE_ID": "your_workspace_id", "LANGSMITH_ENDPOINT": "https://api.smith.langchain.com" } } } }
- /path/to/uv: The absolute path to your uv installation (e.g.,/Users/username/.local/bin/uv). You can find it withwhich uv.
- /path/to/langsmith-mcp-server: The absolute path to theproject root(the directory containingpyproject.tomlandlangsmith_mcp_server/).
- your_langsmith_api_key: Your LangSmith API key (required).
- your_workspace_id: Your LangSmith workspace ID (optional, for API keys scoped to multiple workspaces).
- https://api.smith.langchain.com: The LangSmith API endpoint (optional, defaults to the standard endpoint).
{ "mcpServers": { "LangSmith API MCP Server": { "command": "/path/to/uvx", "args": ["langsmith-mcp-server"], "env": { "LANGSMITH_API_KEY": "lsv2_pt_your_key_here", "LANGSMITH_WORKSPACE_ID": "your_workspace_id", "LANGSMITH_ENDPOINT": "https://api.smith.langchain.com" } } } }
Copy this configuration into Cursor → MCP Settings (replace/path/to/uvxwith the output ofwhich uvx).
When connecting overHTTP(e.g. streamable HTTP or a hosted MCP endpoint), the server usesheadersfor authentication and configuration. Your MCP client must send these with each request; no environment variables are required for tool invocation.
Optional headers used only whenserver monitoringis enabled (for grouping traces by session):
Stdio transport:When running the server over stdio (e.g.uvx langsmith-mcp-server), there are no headers. The server falls back to theenvironment variablesLANGSMITH_API_KEY,LANGSMITH_WORKSPACE_ID, andLANGSMITH_ENDPOINTin the process environment so that tool invocation still works.
Environment variables arenotused for tool invocation when using HTTP (headers are). They are used for:
- Stdio transport– fallback for credentials when no headers exist (see above).
- Load tests– e.g.tests/load_test_sessions.pyreadsLANGSMITH_API_KEYfrom the environment (or a.envfile at the project root).
- Optional server monitoring– tracing tool calls to a second LangSmith instance (see below).
Optional: Tool-call monitoring to a second LangSmith instance
You can log every MCP tool call (with inputs and outputs) to aseparateLangSmith project for monitoring and analytics. Set these in your environment (e.g. in a.envfile at the project root; the server loads.envviapython-dotenv):
Each tool run is traced withrun_type="tool"and asession_idin metadata (from themcp-session-id,x-session-id, orx-request-idheader when using HTTP, or generated per request).
If you use thehostedLangSmith MCP Server, anonymous usage data is sent to a separate LangSmith project so we can iterate and improve the product.
The LangSmith MCP Server can be deployed as an HTTP server using Docker, enabling remote access via the HTTP-streamable protocol.
docker run -p 8000:8000 langsmith-mcp-server
The API key is provided via theLANGSMITH-API-KEYheader when connecting, so no environment variables are required for HTTP-streamable protocol.
Connecting with HTTP-Streamable Protocol
Once the Docker container is running, you can connect to it using the HTTP-streamable transport. The server accepts authentication via headers:
- LANGSMITH-API-KEY: Your LangSmith API key
- LANGSMITH-WORKSPACE-ID: Workspace ID for API keys scoped to multiple workspaces
- LANGSMITH-ENDPOINT: Custom endpoint URL (for self-hosted or EU region)
from mcp import ClientSession from mcp.client.streamable_http import streamablehttp_client headers = { "LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here", # Optional: # "LANGSMITH-WORKSPACE-ID": "your_workspace_id", # "LANGSMITH-ENDPOINT": "https://api.smith.langchain.com", } async with streamablehttp_client("http://localhost:8000/mcp", headers=headers) as (read, write, _): async with ClientSession(read, write) as session: await session.initialize() # Use the session to call tools, list prompts, etc.
To add the LangSmith MCP Server to Cursor using HTTP-streamable protocol, add the following to yourmcp.jsonconfiguration file:
{ "mcpServers": { "HTTP-Streamable LangSmith MCP Server": { "url": "http://localhost:8000/mcp", "headers": { "LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here" } } } }
{ "mcpServers": { "HTTP-Streamable LangSmith MCP Server": { "url": "http://localhost:8000/mcp", "headers": { "LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here", "LANGSMITH-WORKSPACE-ID": "your_workspace_id", "LANGSMITH-ENDPOINT": "https://api.smith.langchain.com" } } } }
Make sure the server is running before connecting Cursor to it.
The server provides a health check endpoint:
This endpoint does not require authentication and returns"LangSmith MCP server is running"when the server is healthy.
- Python3.10+ (3.11+ recommended)
- uv– install withcurl -LsSf https://astral.sh/uv/install.sh | sh
- LangSmith API key– fromsmith.langchain.com
- Node.js(optional) – only if you want to useMCP Inspectorto test the server (stdio or streamable-http)
git clone https://github.com/langchain-ai/langsmith-mcp-server.git cd langsmith-mcp-server uv sync # Install dependencies uv sync --group test # Include test dependencies (pytest, ruff, mypy) uvx langsmith-mcp-server # Verify CLI runs (stdio)
- Edit codeinlangsmith_mcp_server/ortests/.
- Format and lint(required before committing):
make format make lint
make test # Or a single file: make test TEST_FILE=tests/tools/test_dataset_tools.py
You can test the server withMCP Inspectorusing eitherstdioorstreamable-http.
npx @modelcontextprotocol/inspector@latest
Openhttp://localhost:6274in your browser.
- Stdio:Choose stdio transport and configure the server command (e.g.uv run langsmith-mcp-server) and setLANGSMITH_API_KEYin the environment.
- Streamable HTTP:Start the server first (uv run uvicorn langsmith_mcp_server.server:app --host 0.0.0.0 --port 8000or Docker), then choose streamable-http, URLhttp://localhost:8000/mcp, and add headerLANGSMITH-API-KEY= your API key.
Asession-basedload test opens many MCP sessions and calls thelist_promptstool in each, usinglangchain-mcp-adapters. Run from the CLI (no UI). The server must be running first.
uv sync --group load # Terminal 1: start the server uv run uvicorn langsmith_mcp_server.server:app --host 0.0.0.0 --port 8000 # Terminal 2: run the load test uv run python tests/load_test_sessions.py --sessions 20 --calls-per-session 3
Use--report PATHto write a JSON report after the test (e.g.--report load_test_reportcreatesload_test_report.jsonwith config, summary, per-session results, and first error).
uv run python tests/load_test_sessions.py --sessions 5 --report load_test_report # Creates: load_test_report.json (in current directory)
- make formatandmake lintpass
- make testpasses
- New tools or behavior are documented (e.g. inCLAUDE.mdif you change architecture or tools)
- Error handling in tools returns{"error": "..."}rather than raising
For more detail (adding tools, code standards, troubleshooting), seeCLAUDE.md.
This project is distributed under the MIT License. For detailed terms and conditions, please refer to the LICENSE file.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
MCP server for Langfuse — query traces, debug errors, analyze sessions and prompts from any AI agent
Provides access to OpenTelemetry traces and metrics through Logfire.
Paid remote MCP for AI agent run monitoring, failure detection, tool-call incident replay, SLA receipts, and client status exports.
Access and interact with your Kibana instance using natural language or programmatic requests.
Crowdsourced MCP server reliability scoring — 615+ servers monitored, 2.17M+ health checks, real-time reliability data
MCP server for Tessera's LLM cost-optimization layer. Anchored spend, drift detection, recommendations as typed tools.
Tickerr — Live AI Tool Status & API Pricing
Real-time status monitoring, uptime tracking, incident history, and API pricing for 42+ AI tools including ChatGPT, Claude, Gemini, Cursor, GitHub Copilot, Perplexity, DeepSeek, and Groq. No API key required. Data updated every 5 minutes from independent monitoring infrastructure.
Expose data observability, lineage, test results & incidents to AI agents via MCP
The Datadog MCP Server acts as a bridge between your observability data in Datadog and any AI agents that support the Model Context Protocol (MCP).
Behavioral trust scoring for 14,820+ MCP servers. Check reliability, latency, and success rates before tool calls.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




