Skip to main content

Overview

The MCP API provides endpoints to retrieve and update Model Context Protocol (MCP) server configurations. MCP servers extend AI agents with external tools and capabilities.

Get MCP Configuration

GET /api/mcp/config

Retrieve the current Model Context Protocol (MCP) server configurations

Response

object
Map of MCP server name to configuration object

Example Request

Example Response


Update MCP Configuration

PUT /api/mcp/config

Update Model Context Protocol (MCP) server configurations and save to file

Request Body

object
required
Map of MCP server name to configuration (same structure as GET response)

Response

Returns the updated MCP configuration (same as GET response).

Example Request

Example Response

Behavior

When you update the MCP configuration:
  1. The new configuration is saved to extensions_config.json
  2. The configuration cache is reloaded
  3. The LangGraph Server (separate process) detects the config file change via mtime
  4. MCP tools are automatically reinitialized with the new configuration

Error Responses

Internal Server Error
Failed to update MCP configuration

MCP Server Types

stdio (Standard Input/Output)

The most common MCP server type. The server is spawned as a subprocess and communicates via stdin/stdout.

SSE (Server-Sent Events)

HTTP-based server using Server-Sent Events for streaming responses.

HTTP

Standard HTTP-based MCP server.

OAuth Configuration

For HTTP and SSE servers that require OAuth authentication, you can configure automatic token management:

Grant Types

client_credentials

Used for server-to-server authentication:

refresh_token

Used when you have a refresh token:

Environment Variables

You can reference environment variables in the configuration using the $VAR_NAME syntax:
Variables are resolved at runtime from the process environment.

Use Cases

List Configured Servers

Add New Server

Disable Server


MCP Overview

Learn about Model Context Protocol

Gateway Overview

Learn about the Gateway API