Registry / llm-agents / langsmith-mcp-server

langsmith-mcp-server

JSON →
library0.1.1jsnpmunverified

The `langsmith-mcp-server` package provides a TypeScript implementation of the Model Context Protocol (MCP) server, designed to integrate with LangSmith, a platform for developing, evaluating, and monitoring large language model (LLM) applications. This server acts as a gateway, exposing LangSmith's rich data (including conversation history, prompts, traces, runs, datasets, and experiments) through a standardized protocol. It offers functional parity with its official Python counterpart and is currently at version 0.1.7, indicating active development with potential for non-stable API changes before a 1.0 release. The package is primarily intended to be run as a standalone service, leveraging environment variables for configuration, though it also provides programmatic interfaces for embedding or advanced customization. Its key differentiators include native TypeScript support, a comprehensive set of tools for accessing LangSmith data, and standardized char-based pagination for large data fetches.

npm install langsmith-mcp-server
INSTALL
IMPORT
SIG · LANGSMITH-MCP-SERV
L
langsmith-mcp-server
llm-agentsjavascriptv0.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

startServer
import { startServer } from 'langsmith-mcp-server'
const { startServer } = require('langsmith-mcp-server')
Primarily an ESM library. Use named imports. The `startServer` function initializes and runs the MCP server.
LangSmithMcpServer
import { LangSmithMcpServer } from 'langsmith-mcp-server'
import LangSmithMcpServer from 'langsmith-mcp-server'
The main class for programmatic server instantiation. Named import is required.
ServerOptions
import type { ServerOptions } from 'langsmith-mcp-server'
import { ServerOptions } from 'langsmith-mcp-server'
Import the `ServerOptions` interface using `import type` for type-only imports in TypeScript.

Demonstrates how to programmatically start the LangSmith MCP Server, setting configuration options like port and the LangSmith API key from environment variables.

import { startServer } from 'langsmith-mcp-server'; // Ensure LANGSMITH_API_KEY and other environment variables are set // or passed via options if starting programmatically. // Example: process.env.LANGSMITH_API_KEY = 'your_key_here'; async function runMcpServer() { try { console.log('Starting LangSmith MCP Server...'); const server = await startServer({ port: process.env.PORT ? parseInt(process.env.PORT) : 8000, langsmithApiKey: process.env.LANGSMITH_API_KEY ?? '' // Recommended: use env var }); console.log(`LangSmith MCP Server running on port ${server.address()?.port}`); // Keep the server running until explicitly stopped // For a real application, you might want graceful shutdown handling } catch (error) { console.error('Failed to start LangSmith MCP Server:', error); process.exit(1); } } runMcpServer();
langsmith-mcp --version
Debug
Known issues
breakingAs the package is pre-1.0 (currently 0.1.7), its API and behavior are subject to change without strict adherence to semantic versioning. Breaking changes may occur in minor or patch releases.
fix
Always review release notes when updating and consider pinning to exact patch versions in production environments.
affects: <1.0.0
gotchaData fetching tools like `get_thread_history` and `fetch_runs` utilize character-based pagination instead of item-based pagination. Users must account for `max_chars_per_page` and `total_pages` when iterating through results, which differs from typical array-based pagination.
fix
Refer to the documentation for each tool regarding `page_number`, `max_chars_per_page`, `preview_chars`, and `total_pages` to correctly paginate through results.
affects: >=0.1.0
gotchaThe server requires Node.js version 18 or higher. Running with older Node.js versions will result in startup failures or unexpected behavior.
fix
Upgrade your Node.js environment to version 18 or newer using a version manager like `nvm` or by installing a recent LTS release.
affects: <18.0.0
gotchaThe `LANGSMITH_API_KEY` environment variable is essential for authentication with LangSmith. Failure to set it will prevent the server from accessing LangSmith resources and can lead to authentication errors or failures to fetch data.
fix
Ensure `LANGSMITH_API_KEY` is set in your environment before starting the server, e.g., `LANGSMITH_API_KEY=your_key npx langsmith-mcp-server` or `process.env.LANGSMITH_API_KEY = '...'` for programmatic use.
affects: >=0.1.0
Errors
Common errors & fixes
Error: LANGSMITH_API_KEY is not set. Please set the LANGSMITH_API_KEY environment variable.
The server failed to find the required LangSmith API key for authentication.
fix
Set the `LANGSMITH_API_KEY` environment variable before running the server, e.g., `export LANGSMITH_API_KEY='your-secret-key'` or pass it in the `ServerOptions` when starting programmatically.
TypeError: 'fetch' is not a function
This error typically indicates that the Node.js version being used is too old and does not natively support the `fetch` API.
fix
Upgrade your Node.js environment to version 18 or higher. Node.js 18+ includes the native `fetch` API which this server relies upon.
Error: listen EADDRINUSE: address already in use :::8000
The default port (8000) or a specified port is already being used by another process on your system.
fix
Stop the conflicting process, or specify a different port for the LangSmith MCP Server using the `PORT` environment variable (e.g., `PORT=8001 npx langsmith-mcp-server`) or in programmatic `ServerOptions`.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
langsmith-mcp-server — npm install langsmith-mcp-server · libregistry