Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-docker-fci

通过Docker容器运行MCP服务器的配置示例

article

README

🚀 配置文件说明

该配置文件主要用于定义 mcpServers 相关的配置信息,具体如下:

🚀 快速开始

此配置文件定义了一个名为 test-server 的服务器配置,以下是对其详细解释:

{
  "mcpServers": {
    "test-server": {
      "command": "docker",
      "args": [
        "compose",
        "-f",
        "C:\\your-docker-directory\\docker-compose.yml",
        "exec",
        "-i",
        "mcp-server",
        "node",
        "build/index.js"
      ]
    }
  }
}

配置说明

  • mcpServers:一个对象,用于存储多个服务器的配置信息。
  • test-server:一个具体的服务器配置,包含以下属性:
    • command:要执行的命令,这里是 docker
    • args:命令的参数列表,具体如下:
      • compose:执行 Docker Compose 命令。
      • -f:指定 Docker Compose 文件的路径。
      • C:\\your-docker-directory\\docker-compose.yml:Docker Compose 文件的具体路径。
      • exec:在运行的容器中执行命令。
      • -i:保持标准输入打开。
      • mcp-server:要执行命令的容器名称。
      • node:执行 Node.js 脚本。
      • build/index.js:要执行的 Node.js 脚本的路径。

使用方法

将上述配置文件保存为一个 JSON 文件(例如 config.json),然后根据需要在相应的脚本或工具中使用该配置文件来启动 test-server

请注意,你需要将 C:\\your-docker-directory\\docker-compose.yml 替换为你实际的 Docker Compose 文件路径。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client