The Confluent MCP Server allows AI assistants to interact with Confluent Cloud REST APIs through natural language. It enables management of Kafka topics, connectors, and Flink SQL statements using tools like Claude Desktop and Goose CLI.
Node.js (recommended version 22)
# Using NVM (Node Version Manager)
nvm install 22
nvm use 22
Create a .env
file in the root directory with your Confluent Cloud credentials:
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-..."
TABLEFLOW_API_KEY=""
TABLEFLOW_API_SECRET=""
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"
You can run the MCP server in one of two ways:
Option 1: Using npx (easiest)
npx -y @confluentinc/mcp-confluent -e /path/to/.env
Option 2: Install and run from source
npm install @confluentinc/mcp-confluent
npm run build
npm run start
Key environment variables include:
Variable | Description | Default |
---|---|---|
HTTP_PORT | Port for HTTP transport | 8080 |
LOG_LEVEL | Logging level (trace, debug, info, warn, error, fatal) | "info" |
BOOTSTRAP_SERVERS | Kafka broker addresses | |
KAFKA_API_KEY | Authentication key for Kafka | |
KAFKA_API_SECRET | Authentication secret for Kafka | |
CONFLUENT_CLOUD_REST_ENDPOINT | Base URL for Confluent Cloud's REST API |
For Tableflow commands, you'll need to set up proper IAM permissions. Refer to the Confluent Cloud Tableflow Quick Start guide.
Edit Claude Desktop Configuration
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add MCP Server Configuration
{
"mcpServers": {
"confluent": {
"command": "npx",
"args": [
"-y",
"@confluentinc/mcp-confluent",
"-e",
"/path/to/.env"
]
}
}
}
Restart Claude Desktop
Run the Configuration Command
goose configure
Follow the Interactive Prompts
Add extension
Command-line Extension
mcp-confluent
as the extension namenpx -y @confluentinc/mcp-confluent -e /path/to/.env
The MCP server provides a flexible command line interface for advanced configuration:
npx @confluentinc/mcp-confluent --help
npx @confluentinc/mcp-confluent -e .env --allow-tools produce-message,consume-messages
npx @confluentinc/mcp-confluent -e .env --block-tools produce-message,consume-messages
npx @confluentinc/mcp-confluent -e .env --allow-tools-file allow.txt --block-tools-file block.txt
npx @confluentinc/mcp-confluent --list-tools
npx @confluentinc/mcp-confluent -e .env --transport http,sse,stdio
cd /path/to/repo/mcp-confluent
docker build -t mcp-server .
docker run --rm -i -d -p 3000:3000 mcp-server
cd /path/to/repo/mcp-confluent
docker compose up --build
To stop the server:
docker compose down
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "confluent" '{"command":"npx","args":["-y","@confluentinc/mcp-confluent","-e","/path/to/confluent-mcp-server/.env"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"confluent": {
"command": "npx",
"args": [
"-y",
"@confluentinc/mcp-confluent",
"-e",
"/path/to/confluent-mcp-server/.env"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"confluent": {
"command": "npx",
"args": [
"-y",
"@confluentinc/mcp-confluent",
"-e",
"/path/to/confluent-mcp-server/.env"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect