> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Gateway quickstart

> Add two MCP servers to Tool Gateway, connect your accounts, create a tool kit, and call its tools from an MCP client.

> [!NOTE]
>
> Tool Gateway is in [beta](https://docs.langchain.com/langsmith/release-stages.md).

[Tool Gateway](https://docs.langchain.com/langsmith/tool-gateway.md) serves tools from any number of MCP servers at one MCP URL. It calls each tool with credentials that LangSmith stores for you. In this quickstart, you add two MCP servers and connect your accounts. Then you put a selection of their tools in a tool kit and call those tools from an MCP client.

## Before you begin

You need:

* **A LangSmith [Plus or Enterprise plan](https://www.langchain.com/pricing).**
* **A [workspace role](https://docs.langchain.com/langsmith/rbac.md#workspace-roles) that can add servers.** Workspace Admins and Workspace Editors can both add personal servers.
* **A [personal access token](https://docs.langchain.com/langsmith/create-account-api-key.md).** Creating servers and tool kits requires a user credential. A service key does not work for these steps.
* **Your workspace ID**. Every API request sends it in the `X-Tenant-Id` header.
* **Accounts on two services that offer a remote MCP server.** This quickstart uses Linear and Notion. To use other services, substitute their MCP URLs and tool names. If you follow the Linear example, use a test Linear workspace, because the kit includes a tool that can create issues.
* **An MCP client that supports Streamable HTTP and lets you set a custom header**, which carries your LangSmith API key. This quickstart uses [Claude Code](https://code.claude.com/docs/en/overview). To call the tools without a client, you can send HTTP requests with `curl` instead.
* **[jq](https://jqlang.org/)**, if you follow the API steps. The commands use it to save IDs from each response.

> [!TIP]
>
> If you do not have a Linear or Notion account, use the public [LangChain docs MCP server](https://docs.langchain.com/use-these-docs.md) instead. Add it as a **Public** server (`"connection": {"type": "none"}`) with the URL `https://docs.langchain.com/mcp`. Skip Step 2 for it, because it needs no sign-in, and add its `search_docs_by_lang_chain` tool to your kit.

Set these environment variables so you can paste the commands on this page as is. If your organization is not in the GCP US region, set `LANGSMITH_ENDPOINT` to your region's URL from [Base URL](https://docs.langchain.com/langsmith/tool-gateway-api-ref.md#base-url).

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
export LANGSMITH_API_KEY="<your-personal-access-token>"
export LANGSMITH_WORKSPACE_ID="<your-workspace-id>"
export LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
```

To check that your key and workspace ID work, request the list of MCP servers and print only the HTTP status code:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
curl -sS -o /dev/null -w "%{http_code}\n" \
  "$LANGSMITH_ENDPOINT/v1/managed-tools/servers" \
  -H "X-Api-Key: $LANGSMITH_API_KEY" \
  -H "X-Tenant-Id: $LANGSMITH_WORKSPACE_ID"
```

The command prints `200` when your setup works.

## Step 1. Add MCP servers

Register each MCP server once, along with the kind of credential it needs. Both example servers, Linear and Notion, use OAuth.

> [tab] UI
>
> 1. In [LangSmith](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=langsmith-tool-gateway-quickstart), go to **Tools** > **MCP servers**.
> 2. Select **Personal**, then click **Add MCP server**.
> 3. Enter `Linear` as the name and `https://mcp.linear.app/mcp` as the URL, and select **OAuth**.
> 4. Repeat for Notion, with the URL `https://mcp.notion.com/mcp`.
>
> Both servers appear with the status **Not connected**.

> [tab] API
>
> Register Linear and Notion as personal servers that sign in with OAuth. Each command saves the new server's ID in an environment variable for the next steps:
>
> ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> export LINEAR_SERVER_ID=$(curl -sS -X POST "$LANGSMITH_ENDPOINT/v1/managed-tools/servers" \
>   -H "X-Api-Key: $LANGSMITH_API_KEY" \
>   -H "X-Tenant-Id: $LANGSMITH_WORKSPACE_ID" \
>   -H "Content-Type: application/json" \
>   -d '{"name": "Linear", "upstream_url": "https://mcp.linear.app/mcp", "scope": "personal", "connection": {"type": "oauth"}}' \
>   | jq -r '.id')
>
> export NOTION_SERVER_ID=$(curl -sS -X POST "$LANGSMITH_ENDPOINT/v1/managed-tools/servers" \
>   -H "X-Api-Key: $LANGSMITH_API_KEY" \
>   -H "X-Tenant-Id: $LANGSMITH_WORKSPACE_ID" \
>   -H "Content-Type: application/json" \
>   -d '{"name": "Notion", "upstream_url": "https://mcp.notion.com/mcp", "scope": "personal", "connection": {"type": "oauth"}}' \
>   | jq -r '.id')
>
> echo "$LINEAR_SERVER_ID $NOTION_SERVER_ID"
> ```
>
> The last line prints both IDs. If either prints `null`, run that `curl` command without the `| jq` line to see the error.

> [!TIP]
>
> If adding a server returns "This MCP server isn't supported yet", the server does not publish OAuth settings that Tool Gateway can use. If the server needs no sign-in, add it as **Public** (`"connection": {"type": "none"}`) instead. For every server type, see [Add MCP servers](https://docs.langchain.com/langsmith/tool-gateway-servers.md).

## Step 2. Connect your accounts

Sign in to each service once. Tool Gateway stores your tokens and attaches them to every later call that acts as you. Calls from an MCP client that uses your API key act as you.

> [tab] UI
>
> 1. On **Tools** > **MCP servers**, click **Connect** on the Linear row.
> 2. In the tab that opens, approve access in Linear. A LangSmith page confirms that authentication succeeded.
> 3. Repeat for Notion.
>
> Both servers now show the status **Connected**.

> [tab] API
>
> Start the Linear connection and print the sign-in link:
>
> ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> curl -sS -X POST "$LANGSMITH_ENDPOINT/v1/managed-tools/kits/me/connections/$LINEAR_SERVER_ID" \
>   -H "X-Api-Key: $LANGSMITH_API_KEY" \
>   -H "X-Tenant-Id: $LANGSMITH_WORKSPACE_ID" \
>   | jq -r '.verification_url'
> ```
>
> Open the link, approve access, and wait for the LangSmith page that confirms authentication succeeded. Repeat with `$NOTION_SERVER_ID`. If the command prints nothing, you are already connected.

> [!NOTE]
>
> This quickstart connects your own accounts. To connect credentials for an agent, a profile, or the whole workspace, see [Connect accounts](https://docs.langchain.com/langsmith/tool-gateway-connect-accounts.md).

## Step 3. Create a tool kit

A tool kit is a curated set of tools, from any number of servers, that Tool Gateway serves to an agent at one MCP URL. This kit holds Linear's `list_issues` and `save_issue` tools and Notion's `notion-search` tool.

> [tab] UI
>
> 1. Go to **Tools** > **Tool kits** and click **Create tool kit**.
> 2. Enter `Quickstart kit` as the name, and set who can use it to **Personal**.
> 3. In the tool picker, filter by server and select `list_issues` and `save_issue` from Linear and `notion-search` from Notion.
> 4. Click **Review tool selection**, then **Create tool kit**.
>
> The kit's panel lists the tools as agents see them, and shows the kit's MCP URL. The kit ID is the path segment after `/kits/` in that URL. Save it:
>
> ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> export KIT_ID="<kit-id>"
> ```

> [tab] API
>
> Create the kit and save its ID:
>
> ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> export KIT_ID=$(curl -sS -X POST "$LANGSMITH_ENDPOINT/v1/managed-tools/kits" \
>   -H "X-Api-Key: $LANGSMITH_API_KEY" \
>   -H "X-Tenant-Id: $LANGSMITH_WORKSPACE_ID" \
>   -H "Content-Type: application/json" \
>   -d "{
>     \"name\": \"Quickstart kit\",
>     \"scope\": \"personal\",
>     \"tools\": [
>       {\"server_id\": \"$LINEAR_SERVER_ID\", \"tool_name\": \"list_issues\"},
>       {\"server_id\": \"$LINEAR_SERVER_ID\", \"tool_name\": \"save_issue\"},
>       {\"server_id\": \"$NOTION_SERVER_ID\", \"tool_name\": \"notion-search\"}
>     ]
>   }" \
>   | jq -r '.id')
>
> echo "$KIT_ID"
> ```
>
> If the command prints `null`, run it without the `| jq` line to see the error.

The kit is personal because this quickstart's servers are personal. A workspace kit cannot include personal servers. Kit names must be unique, so if `Quickstart kit` is taken, choose another name.

> [!TIP]
>
> Agents see each tool under the server's name as a prefix, for example, `linear_list_issues`, `linear_save_issue`, and `notion_notion-search`. For tool naming and other kit settings, see [Create tool kits](https://docs.langchain.com/langsmith/tool-gateway-tool-kits.md).

## Step 4. Call tools from an MCP client

A tool kit is a standard Streamable HTTP MCP endpoint. Your agent or coding assistant connects to it as an MCP client. The client sends your LangSmith API key, and Tool Gateway attaches your stored Linear and Notion tokens to each call.

> [tab] Claude Code
>
> Add the kit to Claude Code, with your API key in the `X-Api-Key` header:
>
> ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> claude mcp add --transport http quickstart-kit \
>   "$LANGSMITH_ENDPOINT/v1/managed-tools/kits/$KIT_ID/mcp" \
>   --header "X-Api-Key: $LANGSMITH_API_KEY"
> ```
>
> Run `claude mcp list` and confirm that `quickstart-kit` shows as connected. Then start Claude Code, and ask it to search Notion for a topic, or to list your Linear issues. Each call runs on the service with your account.
>
> The kit's panel on **Tools** > **Tool kits** shows this command with your kit's URL filled in. It also shows setup for Cursor and Managed Deep Agents. For other clients, see [Connect an MCP client](https://docs.langchain.com/langsmith/tool-gateway-clients.md).

> [tab] HTTP
>
> Send a JSON-RPC request to the kit's MCP endpoint. On protocol `2026-07-28`, as in this example, send the `Mcp-Method` header, and for `tools/call` also send `Mcp-Name` with the tool's name. A request missing either header returns `400`. Requests on `2025-06-18` leave both out; see [Call tools](https://docs.langchain.com/langsmith/tool-gateway-call-tools.md#send-an-mcp-request).
>
> ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> curl -sS -X POST "$LANGSMITH_ENDPOINT/v1/managed-tools/kits/$KIT_ID/mcp" \
>   -H "X-Api-Key: $LANGSMITH_API_KEY" \
>   -H "X-Tenant-Id: $LANGSMITH_WORKSPACE_ID" \
>   -H "Content-Type: application/json" \
>   -H "Accept: application/json, text/event-stream" \
>   -H "MCP-Protocol-Version: 2026-07-28" \
>   -H "Mcp-Method: tools/call" \
>   -H "Mcp-Name: notion_notion-search" \
>   -d '{
>     "jsonrpc": "2.0",
>     "id": 1,
>     "method": "tools/call",
>     "params": {
>       "name": "notion_notion-search",
>       "arguments": {"query": "onboarding"},
>       "_meta": {
>         "io.modelcontextprotocol/protocolVersion": "2026-07-28",
>         "io.modelcontextprotocol/clientCapabilities": {}
>       }
>     }
>   }'
> ```
>
> The response's `result.content` holds Notion's search results, passed through unchanged. For more on raw requests, see [Call tools](https://docs.langchain.com/langsmith/tool-gateway-call-tools.md).

## Next steps

You now have one MCP URL that serves tools from two services, each called with your own account, without any authentication code in your client.

Everything in this quickstart was personal. Tool Gateway is most useful when you share this setup:

1. [Register servers once for the whole workspace](https://docs.langchain.com/langsmith/tool-gateway-servers.md), or turn on built-in servers.
2. [Give each agent a kit](https://docs.langchain.com/langsmith/tool-gateway-tool-kits.md) with only the tools it needs.
3. [Let every user or agent connect their own account](https://docs.langchain.com/langsmith/tool-gateway-connect-accounts.md), and [choose whose credentials each call uses](https://docs.langchain.com/langsmith/tool-gateway-identity.md).
4. [Set policies](https://docs.langchain.com/langsmith/tool-gateway-policies.md) and [record traces](https://docs.langchain.com/langsmith/tool-gateway-traces.md), so you control and can review every tool call.

***

[Connect these docs](https://docs.langchain.com/use-these-docs.md) to your agent of choice via MCP for real-time answers.

[Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/tool-gateway-quickstart.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
