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

# MCP Servers

> Connect external tools and data sources to MiniMax Code.

<div className="code-docs">
  MCP (Model Context Protocol) connects external tools and data sources to MiniMax Code. With MCP Servers, MiniMax Code can call configured local commands, remote services, or third-party data capabilities during a task, such as browser automation, internal systems, knowledge bases, databases, and specialized search tools.

  ## When to Use MCP

  * Connect internal team tools to MiniMax Code
  * Run local CLI tools or scripts
  * Connect remote MCP services
  * Add specialized data sources, search, or action tools for the Agent
  * Reuse existing `mcpServers` configurations from other MCP clients

  ## Two Ways to Use MCP

  MCP has two common usage paths in MiniMax Code:

  | Path                | Audience                                                  | Description                                                                                            |
  | ------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
  | Local configuration | Personal or internal team use                             | Add MCP Servers on the current device. The configuration is stored locally.                            |
  | Plugin distribution | Developers who want other users to install the capability | Add MCP configuration as `*.mcp.json` in a plugin package, then reference it from the plugin manifest. |

  Local configuration does not depend on plugins. Plugin distribution is for Marketplace publishing. Capabilities that require account connection, OAuth authorization, credential refresh, or disconnect flows should not be shipped as plain MCP configuration; use App / Connector integration first.

  ## Where to Configure

  Open the plugin management entry in MiniMax Code, then switch to **MCP Servers**. From there, you can add, edit, delete, enable, disable, and test MCP Servers.

  MiniMax Code supports two configuration modes:

  * **Form mode**: Fill in command, URL, arguments, environment variables, headers, and other fields based on the selected transport.
  * **JSON mode**: Paste a single server configuration, or paste a full JSON object that contains `mcpServers`.

  <Note>
    MCP configuration is stored locally on the current device. For manual editing, the common location is `mcp.json` under the MiniMax Code local data directory, for example `~/.minimax/mcp.json`.
  </Note>

  ## Supported Transports

  Local MCP configuration supports:

  | Type              | Use case                                                                | Key fields               |
  | ----------------- | ----------------------------------------------------------------------- | ------------------------ |
  | `stdio`           | Local commands, Node/Python scripts, or MCP Servers launched with `npx` | `command`, `args`, `env` |
  | `http`            | Standard remote HTTP MCP services                                       | `url`, `headers`         |
  | `streamable-http` | Remote MCP services that support Streamable HTTP                        | `url`, `headers`         |
  | `sse`             | Remote MCP services that use SSE                                        | `url`, `headers`         |

  Common fields include:

  * `type`: Transport type.
  * `enabled`: Whether the server is available to MiniMax Code.
  * `description`: Human-readable description shown in the server list.
  * `timeout`: Connection or call timeout in milliseconds.

  <Note>
    `*.mcp.json` files inside plugin packages support `stdio`, `streamable-http`, and `sse`; the `http` alias is not supported for packaged plugin MCP. If you plan to publish an MCP capability as a plugin, prefer `streamable-http`.
  </Note>

  ## Configuration Examples

  ### Local stdio Server

  ```json theme={null}
  {
    "mcpServers": {
      "playwright": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@playwright/mcp", "--browser", "chromium"],
        "enabled": true,
        "description": "Playwright browser automation"
      }
    }
  }
  ```

  ### Remote HTTP Server

  ```json theme={null}
  {
    "mcpServers": {
      "company-search": {
        "type": "streamable-http",
        "url": "https://example.com/mcp",
        "headers": {
          "Authorization": "Bearer ${COMPANY_MCP_TOKEN}"
        },
        "enabled": true,
        "description": "Internal company search"
      }
    }
  }
  ```

  <Warning>
    Do not commit real tokens, API keys, or internal URLs to a repository. Use environment variables or your system secret manager for sensitive values.
  </Warning>

  ## Distribute MCP Through a Plugin

  To distribute an MCP capability for other users to install, add `*.mcp.json` to the plugin package and reference it from `mcpServers` in `.minimax-plugin/plugin.json`.

  ```json theme={null}
  {
    "schemaVersion": 1,
    "mcpServers": {
      "acme-search": {
        "type": "streamable-http",
        "url": "https://mcp.acme.example/mcp",
        "description": "Search the Acme public knowledge base",
        "timeout": 30000
      }
    }
  }
  ```

  A local stdio MCP can reference scripts inside the plugin package:

  ```json theme={null}
  {
    "schemaVersion": 1,
    "mcpServers": {
      "local-analyzer": {
        "type": "stdio",
        "command": "python3",
        "args": ["./server.py"],
        "description": "Analyze local input files",
        "timeout": 30000
      }
    }
  }
  ```

  For MCP inside a plugin package:

  * `timeout` is the per-tool-call timeout in milliseconds.
  * `stdio.command` should only be an interpreter or executable name available on PATH; reference package scripts through relative `args`.
  * Remote MCP must use a real HTTP(S) address, and you should verify `initialize`, `tools/list`, and `tools/call` before submitting.
  * Do not put secrets or user credentials in `headers`, `env`, or any other package file.

  ## Use MCP in a Task

  After a server is configured and enabled, describe the capability you need in the conversation. MiniMax Code can select available tools from the task context, and it will explain when an account, permission, or external-operation confirmation is required.

  When many MCP tools are configured, MiniMax Code can search for relevant tools on demand instead of loading every tool definition into context at once. This reduces context usage and improves tool selection.

  ## CLI Checks

  Keep MiniMax Code running, then use the CLI to inspect MCP status:

  ```bash theme={null}
  mcode mcp list --human
  mcode mcp tools <server-name>
  mcode mcp auth status
  ```

  These commands help you:

  * View registered MCP Servers
  * Confirm whether a server is enabled
  * Inspect tools exposed by a server
  * Check whether an authenticated server is logged in or expired

  ## Troubleshooting

  | Issue                         | What to check                                                                                                                                                                |
  | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Command not found             | Confirm `command` is available on the system PATH. If you use `npx`, `node`, or `python`, confirm the runtime is installed.                                                  |
  | JSON cannot be saved          | Check that the input is valid JSON. `args` should be an array of strings, and `env` / `headers` should be string key-value objects.                                          |
  | Connection test fails         | Check the URL, proxy settings, request headers, and MCP protocol compatibility on the server side.                                                                           |
  | Tools do not appear           | Confirm the server is enabled and test the connection again. Restart MiniMax Code if needed.                                                                                 |
  | Authorization expired         | Log in again or update the corresponding token, cookie, or API key.                                                                                                          |
  | Plugin submission is rejected | Check whether the transport is supported for packaged MCP, paths are relative, and the package does not include secrets, install scripts, or platform-specific dependencies. |

  ## Security Tips

  * Add MCP Servers only from trusted sources.
  * Review `command`, `args`, `url`, and `headers` before saving.
  * Avoid sending sensitive files, private repository content, or production credentials to untrusted MCP Servers.
  * For tools that publish, send, submit, or modify external system state, confirm the impact before proceeding.
</div>
