LangSmith MCP Server
Click on "Install 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 Serverget billing usage for September 2025"
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 (TypeScript)
A TypeScript implementation of the Model Context Protocol (MCP) server for LangSmith. This is a full port of the official Python LangSmith MCP Server with 100% functional parity.
Example Use Cases
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"
Quick Start
LANGSMITH_API_KEY=your-key npx langsmith-mcp-serverAvailable Tools
The LangSmith MCP Server provides the following tools for integration with LangSmith.
Conversation & Threads
Tool Name | Description |
| Retrieve message history for a conversation thread. Uses char-based pagination: pass |
Prompt Management
Tool Name | Description |
| Fetch prompts from LangSmith with optional filtering by visibility (public/private) and limit. |
| Get a specific prompt by its exact name, returning the prompt details and template. |
| Documentation-only: how to create and push prompts to LangSmith. |
Traces & Runs
Tool Name | Description |
| Fetch LangSmith runs (traces, tools, chains, etc.) from one or more projects. Supports filters (run_type, error, is_root), FQL ( |
| List LangSmith projects with optional filtering by name, dataset, and detail level (simplified vs full). |
Datasets & Examples
Tool Name | Description |
| Fetch datasets with filtering by ID, type, name, name substring, or metadata. |
| Fetch examples from a dataset by dataset ID/name or example IDs, with filter, metadata, splits, and optional |
| Read a single dataset by ID or name. |
| Read a single example by ID, with optional |
| Documentation-only: how to create datasets in LangSmith. |
| Documentation-only: how to update dataset examples in LangSmith. |
Experiments & Evaluations
Tool Name | Description |
| List experiment projects (reference projects) for a dataset. Requires |
| Documentation-only: how to run experiments and evaluations in LangSmith. |
Usage & Billing
Tool Name | Description |
| Fetch organization billing usage (e.g. trace counts) for a date range. Optional workspace filter; returns metrics with workspace names inline. |
Pagination (char-based)
Several tools use stateless, character-budget pagination so responses stay within a size limit and work well with LLM clients:
Where it's used:
get_thread_historyandfetch_runs.Parameters: You send
page_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 includes
page_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.
Installation
From npm
npx langsmith-mcp-serverMCP Client Integration
Cursor / Claude Code
Add to your MCP settings:
{
"mcpServers": {
"langsmith": {
"command": "npx",
"args": ["langsmith-mcp-server"],
"env": {
"LANGSMITH_API_KEY": "your-key"
}
}
}
}Environment Variables
Variable | Required | Description | Example |
| Yes | Your LangSmith API key for authentication |
|
| No | Workspace ID for API keys scoped to multiple workspaces |
|
| No | Custom API endpoint URL (for self-hosted or EU region) |
|
Notes:
Only
LANGSMITH_API_KEYis required for basic functionalityLANGSMITH_WORKSPACE_IDis useful when your API key has access to multiple workspacesLANGSMITH_ENDPOINTallows you to use custom endpoints for self-hosted LangSmith installations or the EU region
Development and Contributing
Setup
# Clone the repository
git clone https://github.com/langchain-ai/langsmith-mcp-server-js.git
cd langsmith-mcp-server-js
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
LANGSMITH_API_KEY=your-key npm run dev
# Run production build
LANGSMITH_API_KEY=your-key npm startTesting
# Run unit tests
npm testMCP Inspector
For interactive development and debugging, use the MCP Inspector:
LANGSMITH_API_KEY=your-key npx @modelcontextprotocol/inspector npx .This opens a browser UI where you can browse all tools, inspect their schemas, and invoke them interactively.
Verify the server responds
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}}}' | LANGSMITH_API_KEY=test npx . 2>/dev/nullArchitecture
This is a direct port of the Python LangSmith MCP Server with the same module structure:
src/
index.ts # Entry point (stdio transport)
server.ts # McpServer setup
common/
helpers.ts # Client creation, data conversion utilities
pagination.ts # Char-based stateless pagination
formatters.ts # Message extraction and formatting
services/
register-tools.ts # MCP tool registration with Zod schemas
tools/
prompts.ts # Prompt management tools
traces.ts # Trace/run/project tools
datasets.ts # Dataset and example tools
experiments.ts # Experiment listing tools
usage.ts # Billing/usage REST API toolsContributing
This TypeScript implementation is a community port of the official Python LangSmith MCP Server by LangChain.
Contributions are welcome! Please open an issue or pull request on GitHub.
License
This project is distributed under the MIT License. For detailed terms and conditions, please refer to the LICENSE file.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/amitrechavia/langsmith-mcp-server-js'
If you have feedback or need assistance with the MCP directory API, please join our Discord server