Skip to main content
The LangSmith Remote MCP is a Model Context Protocol (MCP) server hosted by LangSmith. It exposes tools for conversation history, prompts, runs and traces, datasets, experiments, billing, and sandboxes without a separate deployment. Interactive MCP clients connect over OAuth with no API key or header configuration; programmatic clients can authenticate with a LangSmith API key via the X-Api-Key header.

Endpoints

Point your MCP client at the Remote MCP endpoint for where your LangSmith runs: one URL per region on LangSmith Cloud, or a path on your own host for BYOC and self-hosted LangSmith.

LangSmith Cloud

LangSmith region
GCP US
GCP EU
GCP APAC
AWS US
The server discovers the rest of its OAuth metadata via RFC 8414 at /.well-known/oauth-authorization-server on the same host, so a compliant MCP client only needs the URL above.

BYOC

https://<data_plane_url>/api/mcp, where <data_plane_url> is the URL of your BYOC data plane.

Self-hosted

https://<your-langsmith-host>/api/mcp, where <your-langsmith-host> is the hostname of your LangSmith instance. Requires LangSmith v0.16 or later and a signing JWKS. To turn it on, see Enabling Remote MCP. Self-hosted deployments on earlier versions should continue to use the standalone LangSmith MCP Server.

Authentication

The Remote MCP supports two authentication methods. Use OAuth for interactive MCP clients (Claude Code, Cursor, and similar), and an API key for programmatic or headless clients that can’t complete a browser-based login.

OAuth

OAuth 2.1 with Dynamic Client Registration (RFC 7591) is the default for interactive clients. Compatible MCP clients register themselves automatically on first use—there is no client ID to provision and no API key to manage. After registration:
  1. The client opens an authorization URL in your browser.
  2. You log in to LangSmith (or use an existing session) and consent.
  3. The client receives an access token and refresh token.
  4. The access token is automatically refreshed by the client when it expires.
The session is scoped to your LangSmith user and workspace permissions—calls through the MCP server can only view what your account is permitted to view.

API key

Send a LangSmith API key in the X-Api-Key header on every request. This suits backend services, scripts, and SDKs, for example, the AI SDK, where the interactive OAuth flow is not practical. Requests are authorized as the user that owns the API key, scoped to that key’s workspace and permissions—the same authorization the key has elsewhere in the LangSmith API. Tools that accept a workspace_id argument can target a specific workspace; otherwise the key’s own workspace is used.
On BYOC, the API key must be assigned to your LangSmith workspace.
The X-Api-Key header is specific to the Remote MCP. The standalone LangSmith MCP Server uses a different header, LANGSMITH-API-KEY.

Quickstart

Claude Code

Add the server to your project’s .mcp.json (or run claude mcp add --transport http -s user langsmith https://api.smith.langchain.com/mcp to install it user-wide):
Then run /mcp and select langsmith to complete the OAuth flow. Tools become available as mcp__langsmith__<tool_name>.

Deep Agents Code (dcode)

Add the server to your user-level ~/.deepagents/.mcp.json file to make it available in every Deep Agents Code project, or add it to a project-level .mcp.json file for only that project. See the Deep Agents Code MCP tools docs for discovery locations and precedence rules.
Then complete the OAuth login flow in one of two ways:
  • In the Deep Agents Code TUI, run /mcp, select langsmith, and follow the login prompt.
  • From your shell, run:
Launch dcode, or restart an active session, to load the LangSmith MCP tools. In an interactive session, run /mcp to inspect server status and loaded tools.

Cursor

Add to your Cursor mcp.json:
Cursor will prompt you to complete the OAuth flow on first use.

LangSmith CLI

The LangSmith CLI authenticates against this same OAuth server, so langsmith auth login logs you in via the OAuth device flow—no API key required:
The CLI prints an activation URL; open it, approve, and the CLI completes login and stores the token per profile in ~/.langsmith/config.json. It then works against the same projects, traces, runs, datasets, experiments, and threads as the Remote MCP server.

AI SDK

For programmatic use from the AI SDK, authenticate with an API key via the X-Api-Key header and the built-in http (Streamable HTTP) transport:
Pass tools directly to streamText or generateText. The Remote MCP is stateless and responds with JSON over the standard Streamable HTTP transport, so the built-in transport works as-is—you don’t need a custom transport.

Other clients

Any MCP client supporting the Streamable HTTP transport can connect with just the URL above—using OAuth 2.1 with dynamic client registration, or a LangSmith API key in the X-Api-Key header.

Known client incompatibilities

OpenAI Codex CLI does not work with the LangSmith Remote MCP. Codex omits the RFC 8707 resource parameter required by the MCP authorization spec during the OAuth flow, so login appears to succeed but the issued token is not bound to the LangSmith MCP and initialize fails with an auth-required error. Two upstream issues affect token exchange and authorize requests in Codex (refer to openai/codex#20729 and openai/codex#13891). In the meantime, use the LangSmith CLI from Codex. The LangSmith CLI supports the same projects, traces, runs, datasets, experiments, and threads as the MCP server, with native OAuth login.

Available tools

The Remote MCP includes these tools from the standalone server:
  • Conversation and threads: get_thread_history
  • Prompt management: list_prompts, get_prompt_by_name, push_prompt
  • Traces and runs: fetch_runs, list_projects
  • Datasets and examples: list_datasets, list_examples, read_dataset, read_example, create_dataset, update_examples
  • Experiments and evaluations: list_experiments, run_experiment
  • Billing: get_billing_usage
See the standalone server reference for parameter and pagination details for these tools.

Manage sandboxes

Sandbox tools manage sandboxes, snapshots, service URLs, and commands.
Tool availability depends on your deployment and release. This section applies only when your server’s MCP tools/list response advertises the operation-specific names below. Remote MCP availability in self-hosted LangSmith v0.16 or later does not imply availability of these sandbox tools. If your server advertises the older names, use their advertised schemas until you upgrade to a release that exposes the new names.
Each operation-specific tool has no action argument. To migrate existing calls on a server that advertises these tools, use the following mapping. Remove action and preserve the other arguments, except for the command split described below.

Start commands and read output

Command execution and output polling use separate tools. Polling cannot start a new command or send input, but it can wake a stopped sandbox. The supplied offsets also acknowledge output, freeing consumed output buffers and potentially unblocking the existing command. Polling is therefore annotated as a write operation.
  • Start execution: Call start_sandbox_command with sandbox_id and command. Its command_id is optional and supports idempotency. Pass shell, run_config, stdin, and timeout_seconds only to this tool.
  • Read output: Call get_sandbox_command_output with sandbox_id and the required command_id. Pass stdout_offset and stderr_offset only to this tool. These optional, nonnegative byte offsets default to zero. Use the offsets from the previous response. Larger offsets can discard unread output.
Both tools accept wait_seconds, max_output_bytes, and optional workspace_id context. Preserve these arguments when migrating command calls.

Re-authenticating

If a client loses its session (for example, after revoking access in your LangSmith account, or if the refresh token is invalidated), trigger re-auth from the client:
  • Claude Code: run /mcp, select langsmith, choose re-authenticate.
  • Cursor: disable and re-enable the server in MCP settings.
  • Other clients: consult the client’s MCP settings UI.

Self-hosted LangSmith

Self-hosted LangSmith deployments on v0.16 or later expose the Remote MCP at https://<your-langsmith-host>/api/mcp. Once enabled, authentication works as on LangSmith Cloud. Available tools depend on the installed release; check your server’s MCP tools/list response.

Enabling Remote MCP

The Remote MCP and its OAuth Authorization Server are wired automatically when config.hostname is set, but they stay inert (404) until you provide a signing JWKS. Follow Configure a signing JWKS, then set the installation hostname in your LangSmith values.yaml:
After upgrading, the OAuth discovery endpoints and /api/mcp become live. Verify with:
For deployments on earlier versions, run the standalone LangSmith MCP Server in your own environment and point its LANGSMITH_ENDPOINT at your self-hosted instance.