- Home
- MCP servers
- LangSmith
LangSmith
- python
56
GitHub Stars
python
Language
3 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
LangSmith MCP Server lets language models fetch conversation history, prompts, and related data from LangSmith, enabling seamless integration for tracking conversations, managing prompts, and analytics. It supports both HTTP-streamable and local stdio connections so clients can choose the integration method that fits their workflow.
How to use
You connect an MCP client to LangSmith MCP Server either over HTTP or by running the server locally and using a stdio transport. Once connected, you can list prompts, fetch prompt details, push prompts, and retrieve runs, projects, experiments, datasets, and examples. Use the HTTP option when you want a remote, URL-based MCP endpoint. Use the stdio options when you prefer to run the server locally and communicate via a process I/O stream. The tools provided let you manage prompts and query LangSmith data to build richer, context-aware applications.
How to install
Prerequisites: you should have Python available and a tool to run MCP transports. You will use one of two installation paths: from PyPI to run the server via a lightweight runtime, or from source to run directly with the source code.
# Prerequisite: ensure you have uv installed
curl -LsSf https://astral.sh/uv/install.sh | sh
From PyPI (stdio transport)
Install the LangSmith MCP Server package and configure a stdio MCP connection that starts the server when invoked by your MCP client.
{
"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"
}
}
}
}
# Optional: install the runtime and start via the client config above
From source (stdio transport)
Run the server directly from source using a stdio transport. This path starts the server with the local code and a specified working directory.
{
"mcpServers": {
"LangSmith API MCP Server": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/langsmith-mcp-server/langsmith_mcp_server",
"run",
"server.py"
],
"env": {
"LANGSMITH_API_KEY": "your_langsmith_api_key",
"LANGSMITH_WORKSPACE_ID": "your_workspace_id",
"LANGSMITH_ENDPOINT": "https://api.smith.langchain.com"
}
}
}
}
Configuration and environment variables
LangSmith MCP Server relies on a few environment variables for authentication and routing. The required key is LANGSMITH_API_KEY. You may optionally set LANGSMITH_WORKSPACE_ID and LANGSMITH_ENDPOINT to narrow scope or customize the API endpoint.
HTTP-Streamable deployment (remote access)
You can deploy the server as an HTTP endpoint to be accessed by clients using the HTTP-streamable transport. Connect by sending requests to the MCP path and provide the API key in headers.
# Example health check for the HTTP server
curl http://localhost:8000/health
# Example client setup (high-level sketch; adapt to your MCP client)
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.
Health check and troubleshooting
The MCP server exposes a health endpoint that you can query without authentication to verify the service is running.
curl http://localhost:8000/health
Development and contributing
If you want to contribute, you can set up a development environment, install dependencies, and run the MCP inspector for interactive testing.
Notes and caveats
LangSmith MCP Server is under active development and not all features may be implemented yet. Ensure you provide a valid LangSmith API key and workspace ID if your API key spans multiple workspaces.
Available tools
list_prompts
Fetch prompts from LangSmith with optional filtering by visibility and limit.
get_prompt_by_name
Retrieve a specific prompt by its exact name, including details and template.
push_prompt
Documentation-oriented tool for creating and pushing prompts to LangSmith (documentation-only).
fetch_runs
Fetch LangSmith runs, traces, tools, chains, and related data with filters and constraints.
list_projects
List LangSmith projects with optional filtering and detail level control.
list_experiments
List LangSmith experiment projects with mandatory dataset filtering and key metrics.
list_datasets
Fetch LangSmith datasets with filtering by ID, type, name, or metadata.
list_examples
Fetch examples from LangSmith datasets with advanced filtering.
read_dataset
Read a specific LangSmith dataset by ID or name.
read_example
Read a specific example from LangSmith with optional version information.
create_dataset
Documentation-oriented tool for creating datasets in LangSmith (documentation-only).
update_examples
Documentation-oriented tool for updating dataset examples (documentation-only).
run_experiment
Documentation-oriented tool for running experiments and evaluations (documentation-only).