Confluent Cloud MCP server

Enables natural language management of Kafka topics, connectors, and Flink SQL statements through Confluent Cloud REST APIs for streamlined data streaming operations
Back to servers
Setup instructions
Provider
Confluent Inc.
Release date
Apr 08, 2025
Language
Python
Stats
83 stars

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.

Installation

Prerequisites

  1. Node.js (recommended version 22)

    # Using NVM (Node Version Manager)
    nvm install 22
    nvm use 22
    
  2. 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"
    

Running the Server

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

Usage

Environment Variables Reference

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.

Configuring Claude Desktop

  1. Edit Claude Desktop Configuration

    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add MCP Server Configuration

    {
      "mcpServers": {
        "confluent": {
          "command": "npx",
          "args": [
            "-y",
            "@confluentinc/mcp-confluent",
            "-e",
            "/path/to/.env"
          ]
        }
      }
    }
    
  3. Restart Claude Desktop

Configuring Goose CLI

  1. Run the Configuration Command

    goose configure
    
  2. Follow the Interactive Prompts

    • Select Add extension
    • Choose Command-line Extension
    • Enter mcp-confluent as the extension name
    • For the command, enter:
      npx -y @confluentinc/mcp-confluent -e /path/to/.env
      

Advanced CLI Usage

The MCP server provides a flexible command line interface for advanced configuration:

npx @confluentinc/mcp-confluent --help

Allow Only Specific Tools

npx @confluentinc/mcp-confluent -e .env --allow-tools produce-message,consume-messages

Block Certain Tools

npx @confluentinc/mcp-confluent -e .env --block-tools produce-message,consume-messages

Use Tool Lists from Files

npx @confluentinc/mcp-confluent -e .env --allow-tools-file allow.txt --block-tools-file block.txt

List All Available Tools

npx @confluentinc/mcp-confluent --list-tools

Deploy Using All Transports

npx @confluentinc/mcp-confluent -e .env --transport http,sse,stdio

Docker Support

Building and Running with Docker

cd /path/to/repo/mcp-confluent
docker build -t mcp-server .
docker run --rm -i -d -p 3000:3000 mcp-server

Using Docker Compose

cd /path/to/repo/mcp-confluent
docker compose up --build

To stop the server:

docker compose down

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later