MCP server for Langsmith SDK integration
Project description
LangSmith MCP Server
[!WARNING] LangSmith MCP Server is under active development and many features are not yet implemented.
A production-ready Model Context Protocol (MCP) server that provides seamless integration with the LangSmith observability platform. This server enables language models to fetch conversation history and prompts from LangSmith.
Installation and Testing
Prerequisites
-
Install uv (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
Development Setup
-
Create a virtual environment and install dependencies:
uv sync -
View available MCP commands:
uv run mcp
-
For development, run the MCP inspector:
uv run mcp dev langsmith_mcp_server/server.py
- This will start the MCP inspector on a network port
- Install any required libraries when prompted
- The MCP inspector will be available in your browser
- Set the
LANGSMITH_API_KEYenvironment variable in the inspector - Connect to the server
- Navigate to the "Tools" tab to see all available tools
MCP Client Setup
Option 1: Using uv commands
-
Install the MCP server for Claude Desktop:
uv run mcp install langsmith_mcp_server/server.py
-
Run the server:
uv run mcp run langsmith_mcp_server/server.py
Option 2: Using absolute paths (recommended)
If you encounter any issues with the above method, you can configure the MCP server using absolute paths. Add the following configuration to your Claude Desktop settings:
{
"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"
}
}
}
}
Replace the following placeholders:
/path/to/uv: The absolute path to your uv installation (e.g.,/Users/username/.local/bin/uv). You can find it runningwhich uv./path/to/langsmith-mcp-server: The absolute path to your langsmith-mcp project directoryyour_langsmith_api_key: Your LangSmith API key
Example configuration:
{
"mcpServers": {
"LangSmith API MCP Server": {
"command": "/Users/mperini/.local/bin/uv",
"args": [
"--directory",
"/Users/mperini/Projects/langsmith-mcp-server/langsmith_mcp_server",
"run",
"server.py"
],
"env": {
"LANGSMITH_API_KEY": "lsv2_pt_1234"
}
}
}
}
Copy this configuration in Cursor > MCP Settings.
Example Use Cases
The server enables conversation history retrieval and prompt management such as:
- "Fetch the history of my conversation with the AI assistant from thread 'thread-123' in project 'my-chatbot'"
- "Get all public prompts in my workspace"
- "Find private prompts containing the word 'joke'"
- "Pull the template for the 'legal-case-summarizer' prompt"
- "Get the system message from a specific prompt template"
Contributing
Install all the dependencies (including dev dependencies):
uv sync
Install pre-commit hooks:
uv run pre-commit install
Before pushing your changes, run the following commands:
make lint
make format
License
This project is distributed under the MIT License. For detailed terms and conditions, please refer to the LICENSE file.
Made with ❤️ by LangChain Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langsmith_mcp_server-0.0.2.tar.gz.
File metadata
- Download URL: langsmith_mcp_server-0.0.2.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b35258dbcc0ffda84c0f372a975737ad52a22fc5f8db87e7626a907b1193065c
|
|
| MD5 |
25c465e5dbdafc58728bfe4ee05609c0
|
|
| BLAKE2b-256 |
95e31ad0eae4b0cc70da0572f13c144826d1fe69c8ae15e6369677e5df69ee51
|
File details
Details for the file langsmith_mcp_server-0.0.2-py3-none-any.whl.
File metadata
- Download URL: langsmith_mcp_server-0.0.2-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fba5c55cbe4c42eb7fee66957a38185ce0420aa8974ff13c51a7e0377305145c
|
|
| MD5 |
b44ab2bb0ad09f6720002a895a7867af
|
|
| BLAKE2b-256 |
4299d31ced618d9e55490f4e0a9f493f5e2ab86d22cac4ce22ca4662b6f0c054
|