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.

📋 Overview

The LangSmith MCP Server bridges the gap between language models and the LangSmith platform, enabling advanced capabilities for conversation tracking, prompt management, and analytics integration.

🛠️ Installation Options

📝 General 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-server
    

🔌 MCP Client Integration

Once you have the LangSmith MCP Server, you can integrate it with various MCP-compatible clients. You have two installation options:

📦 From PyPI

  1. Install the package:

    uv run pip install --upgrade langsmith-mcp-server
    
  2. Add to your client MCP config:

    {
        "mcpServers": {
            "LangSmith API MCP Server": {
                "command": "/path/to/uvx",
                "args": [
                    "langsmith-mcp-server"
                ],
                "env": {
                    "LANGSMITH_API_KEY": "your_langsmith_api_key"
                }
            }
        }
    }
    

⚙️ From Source

Add the following configuration to your MCP client settings:

{
    "mcpServers": {
        "LangSmith API MCP Server": {
            "command": "/path/to/uvx",
            "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/uvx",
            "args": [
                "langsmith-mcp-server"
            ],
            "env": {
                "LANGSMITH_API_KEY": "lsv2_pt_1234"
            }
        }
    }
}

Copy this configuration in Cursor > MCP Settings.

LangSmith Cursor Integration

🧪 Development and Contributing 🤝

If you want to develop or contribute to the LangSmith MCP Server, follow these steps:

  1. Create a virtual environment and install dependencies:

    uv sync
    
  2. To include test dependencies:

    uv sync --group test
    
  3. View available MCP commands:

    uvx langsmith-mcp-server
    
  4. 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
  5. Before submitting your changes, run the linting and formatting checks:

    make lint
    make format
    

🚀 Example Use Cases

The server enables powerful capabilities including:

  • 💬 Conversation History: "Fetch the history of my conversation with the AI assistant from thread 'thread-123' in project 'my-chatbot'"
  • 📚 Prompt Management: "Get all public prompts in my workspace"
  • 🔍 Smart Search: "Find private prompts containing the word 'joke'"
  • 📝 Template Access: "Pull the template for the 'legal-case-summarizer' prompt"
  • 🔧 Configuration: "Get the system message from a specific prompt template"

📄 License

This project is distributed under the MIT License. For detailed terms and conditions, please refer to the LICENSE file.

Made with ❤️ by the 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.3.tar.gz (10.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.3-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langsmith_mcp_server-0.0.3.tar.gz
  • Upload date:
  • Size: 10.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.3.tar.gz
Algorithm Hash digest
SHA256 46e5e1b6eedd0c8da7fa433ec4aa726726cc61f64527c4c2448f1770851aeb3d
MD5 4ee19166b6feea3d9d75486443d1ae14
BLAKE2b-256 34a46aee89057a0adcdc4cf4fc075f87035d289a83caf6575b1d8d75413b4b2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langsmith_mcp_server-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 34c3a7195ae8ec8f1f00200c8853e6f7781cdc94f9fa922c7c6bf21969d566d0
MD5 319b42aba3e4fcd143d76d7cbadb8633
BLAKE2b-256 1b22a22c50586fbdf59465052c19fbb615940978baf8133e128e9a5d1ee6c13a

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