Skip to main content
The Tool Gateway lets agents call MCP tools through LangSmith. LangSmith stores each user’s credentials for those tools and applies your agent policies on every call. This guide enables it on a self-hosted Kubernetes install using the Helm chart. For the SaaS equivalent, see Tool Gateway.
Enabling the Tool Gateway requires Helm chart version 0.18.0-rc.87 or later.

Enable the gateway

Set your hostname

The Tool Gateway runs inside the platform-backend service. The chart turns it on for every organization on the install. There is no separate enable step in the UI.Set config.hostname to the HTTPS hostname of your install. The chart builds the OAuth callback URL from it.
The chart routes /api/v1/agent-auth/, /api/v1/managed-tools/, and /api/v1/agent-policies to platform-backend through the existing frontend. No separate Ingress is required.

Allow MCP servers on your network (optional)

By default, platform-backend blocks MCP server URLs that resolve to private IP addresses. To connect MCP servers that run inside your network, add this to your Helm values:
LangSmith still requires HTTPS URLs, and still blocks cloud metadata endpoints, localhost, and *.svc.cluster.local hostnames.

Apply and verify

Apply the chart with chart version 0.18.0-rc.87 or later. See Upgrade an installation for additional instructions.
In the LangSmith UI, go to Tools, add an MCP server, and connect to it.

Find your callback URL

When a user connects an account to an MCP server that uses OAuth, the provider returns the browser to this URL. Add it as a redirect URL to every OAuth app that you register for the Tool Gateway.
If you set config.basePath, the URL becomes https://<your-hostname>/<basePath>/api/v1/agent-auth/oauth/callback.

Enable built-in tools (optional)

Built-in tools, such as Gmail, Outlook, and Slack, run on the built-in tool server. The chart deploys it by default, so you do not need to enable Fleet. Each provider that you enable needs one OAuth app.

Before you start

  • Tool server enabled: Keep fleetToolServer.enabled: true, which is the default. If you set it to false, the Tools page lists no built-in tools.
  • Provider access: Permission to create an OAuth app with each provider, and administrator approval where the provider requires it.
You configure each app one time for the install. All organizations and workspaces use the same app for a provider. Each user’s connection and tokens stay in their own workspace.Built-in tools that use an API key, such as Tavily and Exa, need no deployment configuration. Each workspace adds its key under Settings > Workspace secrets.
If you also run Fleet, the Tool Gateway callback URL is different from the Fleet OAuth callback, /host-oauth-callback/<provider-id>. If you already configured Fleet OAuth providers, add the Tool Gateway callback URL to each app as an additional redirect URL.

Create the OAuth apps

Create an app only for the providers that you enable. Each app must allow the scopes that the Tool Gateway requests. If an app does not allow a requested scope, the provider rejects the consent request.
Covers Gmail, Calendar, Drive, Docs, Sheets, Slides, Meet, and BigQuery.
  1. In the Google Cloud console, open APIs & Services > Credentials and create an OAuth client ID of type Web application.
  2. Under Authorized redirect URIs, add your callback URL.
  3. Under Enabled APIs & services, enable the APIs for the tools that you use.
  4. On the OAuth consent screen, add these scopes: openid, .../auth/userinfo.email, .../auth/userinfo.profile, .../auth/gmail.modify, .../auth/calendar.events, .../auth/calendar.freebusy, .../auth/calendar.calendarlist.readonly, .../auth/drive, .../auth/drive.file, .../auth/documents, .../auth/spreadsheets, .../auth/presentations, .../auth/meetings.space.created, .../auth/meetings.space.readonly, .../auth/bigquery
  5. Set the consent screen to Internal for one Google Workspace organization, or publish it. In Testing mode, only listed test users can connect, and their access stops after seven days.
  6. Copy the Client ID and Client secret.
If access stops after seven days, the consent screen is in Testing mode. Set it to Internal or publish it, then connect again.

Add the credentials to your Helm values

platform-backend reads each app’s credentials from these environment variables. Set both variables for each provider that you enable. If either value is empty, the provider stays unavailable and Connect shows that it is not configured.GitHub also requires FLEET_GITHUB_APP_STATE_JWT_SECRET. Without it, platform-backend logs an error and does not register the GitHub App callback and webhook routes.
  1. Create a Kubernetes Secret in the LangSmith namespace. Include only the providers that you enable, and keep the file out of version control.
  2. Add one pair of entries for each provider to platformBackend.deployment.extraEnv. Keep your existing entries.
    Do not add MANAGED_TOOLS_EMBEDDED, LANGSMITH_SIGNING_JWKS, API_KEY_SALT, or AGENT_BUILDER_ENCRYPTION_KEY through extraEnv. The chart already sets them, and a duplicate name fails the Helm render.
  3. Apply the chart. If you change only the Secret later, restart platform-backend:
  4. In the LangSmith UI, go to Tools, select a built-in tool, click Connect, and complete the consent screen.

Allow network access

  • platform-backend: Outbound HTTPS to each provider’s token endpoint, such as oauth2.googleapis.com, login.microsoftonline.com, slack.com, api.linear.app, www.linkedin.com, login.salesforce.com, and github.com.
  • Built-in tool server: Outbound HTTPS to the provider APIs that tools call, such as gmail.googleapis.com, graph.microsoft.com, and slack.com.
  • Browser: Access to each provider’s sign-in page and to your callback URL.
If your cluster routes egress through a proxy, set fleet.egressProxy.url for the built-in tool server. For platform-backend, add HTTPS_PROXY and NO_PROXY to platformBackend.deployment.extraEnv, and include your cluster’s internal domains and your Postgres, Redis, and ClickHouse hosts in NO_PROXY. See Configure egress.

Troubleshooting

  • The Tools page lists no built-in tools: Check that fleetToolServer.enabled is true, that the langsmith-fleet-tool-server pod is Running, and that your chart version is 0.18.0-rc.87 or later.
  • Adding an MCP server fails for an internal URL: Use an HTTPS URL that is not a *.svc.cluster.local hostname, and set SSRF_ALLOW_PRIVATE_IPS_MCP_SERVERS on platform-backend. See Allow MCP servers on your network.
  • Connect shows that the provider is not configured: Set both variables for that provider. Check the Secret keys and namespace, then restart platform-backend.
  • The provider reports a redirect mismatch: The redirect URL in the app must match your callback URL exactly, including scheme, host, base path, and path.
  • platform-backend does not start after upgrade: Check that the Secret exists and contains every key that extraEnv references.

Security notes

  • LangSmith encrypts stored user tokens with API_KEY_SALT. Keep it unchanged after users connect accounts. See Use an existing secret.
  • Store OAuth app secrets in a Kubernetes Secret and reference them with secretKeyRef. Do not put secret values directly in your Helm values file.
  • SSRF_ALLOW_PRIVATE_IPS_MCP_SERVERS lets workspace admins add MCP servers on private IP addresses. Turn it on only if your users need internal MCP servers.

Next steps