---
title: "Add Mcp Server To Config"
method: PUT
path: "/v1/tools/mcp/servers"
tags: ["tools"]
---

# Add Mcp Server To Config

`PUT /v1/tools/mcp/servers`

Add a new MCP server to the Letta MCP server config

## Request body

- union
  - StdioServerConfig
    - `server_name` string, required — The name of the server
    - `type` 'sse' | 'stdio' | 'streamable_http'
    - `command` string, required — The command to run (MCP 'local' client will run this command)
    - `args` string[], required — The arguments to pass to the command
    - `env` object, nullable — Environment variables to set
  - SSEServerConfig — Configuration for an MCP server using SSE Authentication can be provided in multiple ways: 1. Using auth_header + auth_token: Will add a specific header with the token Example: auth_header="Authorization", auth_token="Bearer abc123" 2. Using the custom_headers dict: For more complex authentication scenarios Example: custom_headers={"X-API-Key": "abc123", "X-Custom-Header": "value"}
    - `server_name` string, required — The name of the server
    - `type` 'sse' | 'stdio' | 'streamable_http'
    - `server_url` string, required — The URL of the server (MCP SSE client will connect to this URL)
    - `auth_header` string, nullable — The name of the authentication header (e.g., 'Authorization')
    - `auth_token` string, nullable — The authentication token or API key value
    - `custom_headers` object, nullable — Custom HTTP headers to include with SSE requests
  - StreamableHTTPServerConfig — Configuration for an MCP server using Streamable HTTP Authentication can be provided in multiple ways: 1. Using auth_header + auth_token: Will add a specific header with the token Example: auth_header="Authorization", auth_token="Bearer abc123" 2. Using the custom_headers dict: For more complex authentication scenarios Example: custom_headers={"X-API-Key": "abc123", "X-Custom-Header": "value"}
    - `server_name` string, required — The name of the server
    - `type` 'sse' | 'stdio' | 'streamable_http'
    - `server_url` string, required — The URL path for the streamable HTTP server (e.g., 'example/mcp')
    - `auth_header` string, nullable — The name of the authentication header (e.g., 'Authorization')
    - `auth_token` string, nullable — The authentication token or API key value
    - `custom_headers` object, nullable — Custom HTTP headers to include with streamable HTTP requests

## Response `200`

Successful Response

- union[]
  - union
    - StdioServerConfig
      - `server_name` string, required — The name of the server
      - `type` 'sse' | 'stdio' | 'streamable_http'
      - `command` string, required — The command to run (MCP 'local' client will run this command)
      - `args` string[], required — The arguments to pass to the command
      - `env` object, nullable — Environment variables to set
    - SSEServerConfig — Configuration for an MCP server using SSE Authentication can be provided in multiple ways: 1. Using auth_header + auth_token: Will add a specific header with the token Example: auth_header="Authorization", auth_token="Bearer abc123" 2. Using the custom_headers dict: For more complex authentication scenarios Example: custom_headers={"X-API-Key": "abc123", "X-Custom-Header": "value"}
      - `server_name` string, required — The name of the server
      - `type` 'sse' | 'stdio' | 'streamable_http'
      - `server_url` string, required — The URL of the server (MCP SSE client will connect to this URL)
      - `auth_header` string, nullable — The name of the authentication header (e.g., 'Authorization')
      - `auth_token` string, nullable — The authentication token or API key value
      - `custom_headers` object, nullable — Custom HTTP headers to include with SSE requests
    - StreamableHTTPServerConfig — Configuration for an MCP server using Streamable HTTP Authentication can be provided in multiple ways: 1. Using auth_header + auth_token: Will add a specific header with the token Example: auth_header="Authorization", auth_token="Bearer abc123" 2. Using the custom_headers dict: For more complex authentication scenarios Example: custom_headers={"X-API-Key": "abc123", "X-Custom-Header": "value"}
      - `server_name` string, required — The name of the server
      - `type` 'sse' | 'stdio' | 'streamable_http'
      - `server_url` string, required — The URL path for the streamable HTTP server (e.g., 'example/mcp')
      - `auth_header` string, nullable — The name of the authentication header (e.g., 'Authorization')
      - `auth_token` string, nullable — The authentication token or API key value
      - `custom_headers` object, nullable — Custom HTTP headers to include with streamable HTTP requests

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/yu-code666/apis/letta-api.md) · [All operations](https://skmtc.dev/yu-code666/apis/letta-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/yu-code666/letta-api/revisions/6cec99480c13/schema)
