Skip to main content

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.

LangSmith MCP Hero

License: MIT Python 3.10

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

  1. Install uv (a fast Python package installer and resolver):

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. 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

  1. Create a virtual environment and install dependencies:

    uv sync
    
  2. View available MCP commands:

    uv run mcp
    
  3. 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_KEY environment 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

  1. Install the MCP server for Claude Desktop:

    uv run mcp install langsmith_mcp_server/server.py
    
  2. 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 running which uv.
  • /path/to/langsmith-mcp-server: The absolute path to your langsmith-mcp project directory
  • your_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.

LangSmith Cursor Integration

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langsmith_mcp_server-0.0.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langsmith_mcp_server-0.0.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file langsmith_mcp_server-0.0.1.tar.gz.

File metadata

  • Download URL: langsmith_mcp_server-0.0.1.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

Hashes for langsmith_mcp_server-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ea7a8512b75299da39ab8d7df9021c4864fc37bd3c25fed729720e5a5a78f5b7
MD5 a7cf3a492c51f5c6e2c64c9080130d3f
BLAKE2b-256 eed6d4eed6146394c258c7897e8d6373cde43c104d5def08606d239b179fa2b1

See more details on using hashes here.

File details

Details for the file langsmith_mcp_server-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for langsmith_mcp_server-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c135097d0ff4cc0494c12bd2107c27cbfc9ba7d801a59e6e7d59026f5acc48b9
MD5 1b97f8a17125602ab6d76ef881fba016
BLAKE2b-256 1ba2566b86c197f088aad54a30d50a2c287b8a3d3deef0bb8546a3089b284851

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page