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 |
/.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:- The client opens an authorization URL in your browser.
- You log in to LangSmith (or use an existing session) and consent.
- The client receives an access token and refresh token.
- The access token is automatically refreshed by the client when it expires.
API key
Send a LangSmith API key in theX-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.
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):
/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.
-
In the Deep Agents Code TUI, run
/mcp, select langsmith, and follow the login prompt. -
From your shell, run:
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 Cursormcp.json:
LangSmith CLI
The LangSmith CLI authenticates against this same OAuth server, solangsmith auth login logs you in via the OAuth device flow—no API key required:
~/.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 theX-Api-Key header and the built-in http (Streamable HTTP) transport:
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 theX-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
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.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_commandwithsandbox_idandcommand. Itscommand_idis optional and supports idempotency. Passshell,run_config,stdin, andtimeout_secondsonly to this tool. - Read output: Call
get_sandbox_command_outputwithsandbox_idand the requiredcommand_id. Passstdout_offsetandstderr_offsetonly to this tool. These optional, nonnegative byte offsets default to zero. Use the offsets from the previous response. Larger offsets can discard unread output.
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 athttps://<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 whenconfig.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:
/api/mcp become live. Verify with:
LANGSMITH_ENDPOINT at your self-hosted instance.
Connect these docs to your agent of choice via MCP for real-time answers.

