mcp-汇合
一个 MCP 服务器实现,使 AI 助手能够与 Confluent Cloud REST API 交互。该服务器允许 Claude Desktop 和 Goose CLI 等 AI 工具通过自然语言交互来管理 Kafka 主题、连接器和 Flink SQL 语句。
演示
Goose 命令行界面

克劳德桌面

目录
用户指南
入门
- **创建
.env
文件:**将示例.env
文件结构(如下所示)复制到项目根目录中名为.env
的新文件中。 - **填充
.env
文件:**填写 Confluent Cloud 环境所需的值。有关每个变量的详细信息,请参阅配置部分。 - 安装 Node.js (如果尚未安装)
- 我们建议使用NVM (Node 版本管理器)来管理 Node.js 版本
- 安装并使用 Node.js:
nvm install 22
nvm use 22
配置
在项目的根目录中创建一个.env
文件,其配置如下:
# .env file
BOOTSTRAP_SERVERS="pkc-v12gj.us-east4.gcp.confluent.cloud:9092"
KAFKA_API_KEY="..."
KAFKA_API_SECRET="..."
KAFKA_REST_ENDPOINT="https://pkc-v12gj.us-east4.gcp.confluent.cloud:443"
KAFKA_CLUSTER_ID=""
KAFKA_ENV_ID="env-..."
FLINK_ENV_ID="env-..."
FLINK_ORG_ID=""
FLINK_REST_ENDPOINT="https://flink.us-east4.gcp.confluent.cloud"
FLINK_ENV_NAME=""
FLINK_DATABASE_NAME=""
FLINK_API_KEY=""
FLINK_API_SECRET=""
FLINK_COMPUTE_POOL_ID="lfcp-..."
CONFLUENT_CLOUD_API_KEY=""
CONFLUENT_CLOUD_API_SECRET=""
CONFLUENT_CLOUD_REST_ENDPOINT="https://api.confluent.cloud"
SCHEMA_REGISTRY_API_KEY="..."
SCHEMA_REGISTRY_API_SECRET="..."
SCHEMA_REGISTRY_ENDPOINT="https://psrc-zv01y.northamerica-northeast2.gcp.confluent.cloud"
环境变量参考
多变的 | 描述 | 默认值 | 必需的 |
---|
HTTP_HOST | 绑定 HTTP 传输的主机(字符串) | “本地主机” | 是的 |
HTTP_PORT | 用于 HTTP 传输的端口(数字(最小值:0)) | 3000 | 是的 |
引导服务器 | 用于建立与 Kafka 集群的初始连接的 Kafka 代理地址列表,格式为 host1,host2(字符串) | | 不 |
CONFLUENT_CLOUD_API_KEY | Confluent Cloud 平台管理的主 API 密钥,用于管理整个组织的资源(字符串(最小值:1)) | | 不 |
CONFLUENT_CLOUD_API_SECRET | 主 API 密钥与 CONFLUENT_CLOUD_API_KEY 配对,用于全面的 Confluent Cloud 平台管理(字符串(最小值:1)) | | 不 |
CONFLUENT_CLOUD_REST_ENDPOINT | Confluent Cloud REST API 服务的基本 URL(默认) | | 不 |
FLINK_API_KEY | 用于访问 Confluent Cloud 的 Flink 服务的身份验证密钥,包括计算池和 SQL 语句管理(字符串(最小值:1)) | | 不 |
FLINK_API_SECRET | 与 FLINK_API_KEY 配对的秘密令牌,用于对 Confluent Cloud 的 Flink 服务进行身份验证访问(字符串(最小值:1)) | | 不 |
FLINK_COMPUTE_POOL_ID | Flink 计算池的唯一标识符,必须以“lfcp-”前缀开头(字符串) | | 不 |
FLINK_DATABASE_NAME | 在 Flink SQL 操作中用作数据库引用的关联 Kafka 集群的名称(字符串(最小值:1)) | | 不 |
FLINK_ENV_ID | Flink 环境的唯一标识符,必须以“env-”前缀开头(字符串) | | 不 |
FLINK_ENV_NAME | 用于识别和显示目的的 Flink 环境的人类可读名称(字符串(最小值:1)) | | 不 |
FLINK_ORG_ID | Confluent Cloud 中用于 Flink 资源管理的组织标识符(字符串(最小值:1)) | | 不 |
FLINK_REST_ENDPOINT | 用于 SQL 语句和计算池管理的 Confluent Cloud Flink REST API 端点的基本 URL(字符串) | | 不 |
KAFKA_API_密钥 | 与 Kafka 集群建立安全连接所需的身份验证凭证(用户名)(字符串(最小值:1)) | | 不 |
KAFKA_API_SECRET | 与 KAFKA_API_KEY 配对的身份验证凭证(密码),用于安全的 Kafka 集群访问(字符串(最小值:1)) | | 不 |
KAFKA_CLUSTER_ID | Confluent Cloud 生态系统中 Kafka 集群的唯一标识符(字符串(最小值:1)) | | 不 |
KAFKA_ENV_ID | Kafka 集群的环境标识符,必须以“env-”前缀开头(字符串) | | 不 |
KAFKA_REST_ENDPOINT | Kafka 集群管理的 REST API 端点(字符串) | | 不 |
SCHEMA_REGISTRY_API_KEY | 用于访问 Schema Registry 服务以管理和验证数据模式的身份验证密钥(字符串(最小值:1)) | | 不 |
SCHEMA_REGISTRY_API_SECRET | 与 SCHEMA_REGISTRY_API_KEY 配对的身份验证密钥,用于安全 Schema Registry 访问(字符串(最小值:1)) | | 不 |
SCHEMA_REGISTRY_ENDPOINT | 用于访问 Schema Registry 服务以管理数据模式的 URL 端点(字符串) | | 不 |
用法
此 MCP 服务器设计用于与各种 MCP 客户端配合使用,例如 Claude Desktop 或 Goose CLI/Desktop。具体配置和交互方式取决于您使用的客户端。但一般步骤如下:
- **启动服务器:**您可以通过以下两种方式之一运行 MCP 服务器:
- **从源代码构建:**按照开发者指南中的说明从源代码构建并运行服务器。这通常涉及:
- 安装依赖项(
npm install
) - 构建项目(
npm run build
或npm run dev
)
- **使用 npx:**您可以直接使用 npx 启动服务器(无需构建):
npx -y @confluentinc/mcp-confluent -e /path/to/confluent-mcp-server/.env
- **配置您的 MCP 客户端:**每个客户端都有其自身的方式来指定 MCP 服务器的地址和所需的凭据。您需要配置您的客户端(例如 Claude、Goose)以连接到该服务器运行的地址(可能是带有特定端口的
localhost
)。服务器运行的端口可以通过环境变量进行配置。 - **启动 MCP 客户端:**将客户端配置为连接到 MCP 服务器后,即可启动 MCP 客户端。启动时,它会在本地创建一个 MCP 服务器实例。该实例将负责管理数据模式并代表您与 Confluent Cloud 进行交互。
- **通过客户端与 Confluent 交互:**客户端连接后,您可以使用客户端界面与 Confluent Cloud 资源进行交互。客户端会向 MCP 服务器发送请求,然后 MCP 服务器会代表您与 Confluent Cloud 进行交互。
配置 Claude 桌面
有关安装 Claude Desktop 和 MCP 服务器的更多详细信息,请参阅此处。
要配置 Claude Desktop 以使用此 MCP 服务器:
- 打开 Claude 桌面配置
- 在 Mac 上:
~/Library/Application Support/Claude/claude_desktop_config.json
- 在 Windows 上:
%APPDATA%\Claude\claude_desktop_config.json
- 编辑配置文件
- 在您喜欢的文本编辑器中打开配置文件
- 使用以下方法之一添加或修改配置:
{
"mcpServers": {
"confluent": {
"command": "node",
"args": [
"/path/to/confluent-mcp-server/dist/index.js",
"--env-file",
"/path/to/confluent-mcp-server/.env",
]
}
}
}
{
"mcpServers": {
"confluent": {
"command": "npx",
"args": [
"-y"
"@confluentinc/mcp-confluent",
"-e",
"/path/to/confluent-mcp-server/.env"
]
}
}
}
将/path/to/confluent-mcp-server/
替换为您安装此 MCP 服务器的实际路径。
- 重启Claude桌面
- 关闭并重新打开 Claude Desktop 以使更改生效
- Claude Desktop 启动时,MCP 服务器将自动启动
现在,Claude Desktop 将配置为使用您的本地 MCP 服务器进行 Confluent 交互。

配置 Goose CLI
有关如何安装 Goose CLI 的详细说明,请参阅此处。
安装后,请按照以下步骤操作:
- 运行配置命令:
- 按照交互式提示进行操作:
- 选择
Add extension
- 选择
Command-line Extension
- 输入
mcp-confluent
作为扩展名称 - 选择以下配置方法之一:
node /path/to/confluent-mcp-server/dist/index.js --env-file /path/to/confluent-mcp-server/.env
npx -y @confluentinc/mcp-confluent -e /path/to/confluent-mcp-server/.env
将/path/to/confluent-mcp-server/
替换为您安装此 MCP 服务器的实际路径。

mcp-confluent CLI 用法
MCP 服务器提供灵活的命令行界面 (CLI),用于高级配置和控制。CLI 允许您指定环境文件、传输方式,并微调启用或阻止哪些工具。
基本用法
您可以查看所有 CLI 选项并获取以下帮助:
npx @confluentinc/mcp-confluent --help
Usage: mcp-confluent [options]
Confluent MCP Server - Model Context Protocol implementation for Confluent Cloud
Options:
-V, --version output the version number
-e, --env-file <path> Load environment variables from file
-k, --kafka-config-file <file> Path to a properties file for configuring kafka clients
-t, --transport <types> Transport types (comma-separated list) (choices: "http", "sse", "stdio", default: "stdio")
--allow-tools <tools> Comma-separated list of tool names to allow. If provided, takes precedence over --allow-tools-file. Allow-list is applied before block-list.
--block-tools <tools> Comma-separated list of tool names to block. If provided, takes precedence over --block-tools-file. Block-list is applied after allow-list.
--allow-tools-file <file> File with tool names to allow (one per line). Used only if --allow-tools is not provided. Allow-list is applied before block-list.
--block-tools-file <file> File with tool names to block (one per line). Used only if --block-tools is not provided. Block-list is applied after allow-list.
--list-tools Print the final set of enabled tool names (with descriptions) after allow/block filtering and exit. Does not start the server.
--disable-confluent-cloud-tools Disable all tools that require Confluent Cloud REST APIs (cloud-only tools).
-h, --help display help for command
示例:使用所有传输进行部署
npx @confluentinc/mcp-confluent -e .env --transport http,sse,stdio
...
{"level":"info","time":"2025-05-14T17:03:02.883Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Starting transports: http, sse, stdio"}
{"level":"info","time":"2025-05-14T17:03:02.971Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"HTTP transport routes registered"}
{"level":"info","time":"2025-05-14T17:03:02.972Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"SSE transport routes registered"}
{"level":"info","time":"2025-05-14T17:03:02.972Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"STDIO transport connected"}
{"level":"info","time":"2025-05-14T17:03:03.012Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Server listening at http://[::1]:3000"}
{"level":"info","time":"2025-05-14T17:03:03.013Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Server listening at http://127.0.0.1:3000"}
{"level":"info","time":"2025-05-14T17:03:03.013Z","pid":47959,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"All transports started successfully"}
示例:仅允许特定工具
npx @confluentinc/mcp-confluent -e .env --allow-tools produce-message,consume-messages
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-topics disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-topics disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-topics disabled due to allow/block list rules"}
{"level":"info","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool produce-message enabled"}
{"level":"info","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool consume-messages enabled"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-flink-statements disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-flink-statement disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-flink-statement disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-flink-statements disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-connectors disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-connector disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-connector disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-connector disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool search-topics-by-tag disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool search-topics-by-name disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-topic-tags disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-tag disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool remove-tag-from-entity disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool add-tags-to-topic disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-tags disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool alter-topic-config disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-clusters disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-environments disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-environment disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-schemas disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:52:34.923Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool get-topic-config disabled due to allow/block list rules"}
{"level":"info","time":"2025-05-14T16:52:34.924Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Starting transports: stdio on localhost:3000"}
{"level":"info","time":"2025-05-14T16:52:34.924Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"STDIO transport connected"}
{"level":"info","time":"2025-05-14T16:52:34.924Z","pid":46818,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"All transports started successfully"}
示例:阻止某些工具
npx @confluentinc/mcp-confluent -e .env --block-tools produce-message,consume-messages
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-topics enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-topics enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-topics enabled"}
{"level":"warn","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool produce-message disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool consume-messages disabled due to allow/block list rules"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-flink-statements enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-flink-statement enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-flink-statement enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-flink-statements enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-connectors enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-connector enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-connector enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-connector enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool search-topics-by-tag enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool search-topics-by-name enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-topic-tags enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-tag enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool remove-tag-from-entity enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool add-tags-to-topic enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-tags enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool alter-topic-config enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-clusters enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-environments enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-environment enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-schemas enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool get-topic-config enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Starting transports: stdio"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"STDIO transport connected"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"All transports started successfully"}
示例:使用文件中的工具列表
npx -y @confluentinc/mcp-confluent -e .env --allow-tools-file allow.txt --block-tools-file block.txt
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-topics enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-topics enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-topics enabled"}
{"level":"warn","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool produce-message disabled due to allow/block list rules"}
{"level":"warn","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool consume-messages disabled due to allow/block list rules"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-flink-statements enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-flink-statement enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-flink-statement enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-flink-statements enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-connectors enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-connector enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-connector enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-connector enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool search-topics-by-tag enabled"}
{"level":"info","time":"2025-05-14T16:55:45.910Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool search-topics-by-name enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool create-topic-tags enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool delete-tag enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool remove-tag-from-entity enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool add-tags-to-topic enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-tags enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool alter-topic-config enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-clusters enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-environments enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool read-environment enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool list-schemas enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Tool get-topic-config enabled"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"Starting transports: stdio"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"STDIO transport connected"}
{"level":"info","time":"2025-05-14T16:55:45.911Z","pid":47344,"hostname":"G9PW1FJH64","name":"mcp-confluent","msg":"All transports started successfully"}
示例:列出所有可用工具
npx -y @confluentinc/mcp-confluent --list-tools
add-tags-to-topic: Assign existing tags to Kafka topics in Confluent Cloud.
alter-topic-config: Alter topic configuration in Confluent Cloud.
consume-messages: Consumes messages from one or more Kafka topics. Supports automatic deserialization of Schema Registry encoded messag...
create-connector: Create a new connector. Returns the new connector information if successful.
create-flink-statement: Make a request to create a statement.
create-topic-tags: Create new tag definitions in Confluent Cloud.
create-topics: Create one or more Kafka topics.
delete-connector: Delete an existing connector. Returns success message if deletion was successful.
delete-flink-statements: Make a request to delete a statement.
delete-tag: Delete a tag definition from Confluent Cloud.
delete-topics: Delete the topic with the given names.
get-topic-config: Retrieve configuration details for a specific Kafka topic.
list-clusters: Get all clusters in the Confluent Cloud environment
list-connectors: Retrieve a list of "names" of the active connectors. You can then make a read request for a specific connector by name.
list-environments: Get all environments in Confluent Cloud with pagination support
list-flink-statements: Retrieve a sorted, filtered, paginated list of all statements.
list-schemas: List all schemas in the Schema Registry.
list-tags: Retrieve all tags with definitions from Confluent Cloud Schema Registry.
list-topics: List all topics in the Kafka cluster.
produce-message: Produce records to a Kafka topic. Supports Confluent Schema Registry serialization (AVRO, JSON, PROTOBUF) for both ke...
read-connector: Get information about the connector.
read-environment: Get details of a specific environment by ID
read-flink-statement: Make a request to read a statement and its results
remove-tag-from-entity: Remove tag from an entity in Confluent Cloud.
search-topics-by-name: List all topics in the Kafka cluster matching the specified name.
search-topics-by-tag: List all topics in the Kafka cluster with the specified tag.
**提示:**允许列表优先于阻止列表应用。如果两者都未提供,则默认启用所有工具。
开发者指南
项目结构
/
├── src/ # Source code
│ ├── confluent/ # Confluent integration (API clients, etc.)
│ │ └── tools/ # Tool implementations
│ ├── mcp/ # MCP protocol and transport logic
│ │ └── transports/
│ └── ... # Other server logic, utilities, etc.
├── dist/ # Compiled output
├── openapi.json # OpenAPI specification for Confluent Cloud
├── .env # Environment variables (example - should be copied and filled)
├── README.md # This file
└── package.json # Node.js project metadata and dependencies
构建和运行
- 安装依赖项:
- 开发模式(注意变化):此命令将 TypeScript 代码编译为 JavaScript,并在
src/
目录中检测到更改时自动重建。 - 生产构建(一次性编译):
- 启动服务器:
测试
MCP 检查器
要测试 MCP 服务器,您可以使用MCP Inspector ,这是一个用于测试和调试 MCP 服务器的交互式开发工具。
# make sure you've already built the project either in dev mode or by running npm run build
npx @modelcontextprotocol/inspector node $PATH_TO_PROJECT/dist/index.js --env-file $PATH_TO_PROJECT/.env
添加新工具
- 向枚举类
ToolName
添加一个新枚举。 - 将您的新工具添加到
ToolFactory
类中的处理程序映射中。 - 创建一个新文件,导出扩展
BaseToolHandler
类。- 实现基类的
handle
方法。 - 实现基类的
getToolConfig
方法。
- 一旦满意,就将其添加到
index.ts
中的enabledTools
集合中。
生成类型
# as of v7.5.2 there is a bug when using allOf w/ required https://github.com/openapi-ts/openapi-typescript/issues/1474. need --empty-objects-unknown flag to avoid it
npx openapi-typescript ./openapi.json -o ./src/confluent/openapi-schema.d.ts --empty-objects-unknown
贡献
欢迎通过 Github Issues 提交 Bug 报告和反馈。贡献指南请参阅CONTRIBUTING.md