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
Provider
Confluent Inc.
Release date
Apr 08, 2025
Language
Python
Stats
41 stars

The MCP-Confluent server enables AI assistants to interact with Confluent Cloud REST APIs through natural language interfaces. This implementation allows tools like Claude Desktop and Goose CLI to manage Kafka topics, connectors, Flink SQL statements, and more.

Installation

To get started with the MCP-Confluent server:

  1. Create a .env file in your project root with your Confluent Cloud configuration values
  2. Install Node.js (version 22 recommended) using NVM:
nvm install 22
nvm use 22

Configuration

Create a .env file in your project root with the following structure:

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"

Prerequisites for Tableflow Commands

To use Tableflow commands, you'll need proper IAM permissions and configurations in your cloud environment (e.g., AWS). These permissions are essential for interacting with data storage like AWS S3 and metadata catalogs like AWS Glue.

Refer to the Confluent Cloud Tableflow Quick Start with Custom Storage & Glue for detailed setup instructions.

Usage

Starting the Server

You can run the MCP server in one of two ways:

  1. Using npx:
npx -y @confluentinc/mcp-confluent -e /path/to/.env
  1. From source:
    • Install dependencies: npm install
    • Build the project: npm run build or npm run dev
    • Start the server: npm run start

Configuring Claude Desktop

  1. Open Claude Desktop Configuration:

    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Edit the configuration file:

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

Configuring Goose CLI

  1. Run the configuration command:
goose configure
  1. Follow the interactive prompts:
    • Select Add extension
    • Choose Command-line Extension
    • Enter mcp-confluent as the extension name
    • Configure the extension with:
npx -y @confluentinc/mcp-confluent -e /path/to/.env

Advanced CLI Usage

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

Basic Usage

View all CLI options with:

npx @confluentinc/mcp-confluent --help

Example: Using All Transports

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

Example: Allow Only Specific Tools

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

Example: Block Certain Tools

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

Example: Use Tool Lists from Files

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

Example: List All Available Tools

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

Environment Variables Reference

Variable Description Default Required
HTTP_HOST Host to bind for HTTP transport "localhost" Yes
HTTP_PORT Port to use for HTTP transport 3000 Yes
LOG_LEVEL Log level (trace, debug, info, warn, error, fatal) "info" Yes
BOOTSTRAP_SERVERS Kafka broker addresses (host1:port1,host2:port2) No
CONFLUENT_CLOUD_API_KEY Master API key for Confluent Cloud platform No
CONFLUENT_CLOUD_API_SECRET Master API secret for Confluent Cloud platform No
CONFLUENT_CLOUD_REST_ENDPOINT Base URL for Confluent Cloud's REST API services No
FLINK_API_KEY Authentication key for Confluent Cloud's Flink services No
FLINK_API_SECRET Secret for Confluent Cloud's Flink services No
FLINK_COMPUTE_POOL_ID Flink compute pool ID (must start with 'lfcp-') No
FLINK_DATABASE_NAME Database name for Flink SQL operations No
FLINK_ENV_ID Flink environment ID (must start with 'env-') No
FLINK_ENV_NAME Human-readable name for the Flink environment No
FLINK_ORG_ID Organization ID for Flink resource management No
FLINK_REST_ENDPOINT Base URL for Flink REST API endpoints No
KAFKA_API_KEY Authentication key for Kafka cluster No
KAFKA_API_SECRET Authentication secret for Kafka cluster No
KAFKA_CLUSTER_ID Unique ID for the Kafka cluster No
KAFKA_ENV_ID Environment ID for Kafka cluster (must start with 'env-') No
KAFKA_REST_ENDPOINT REST API endpoint for Kafka cluster management No
SCHEMA_REGISTRY_API_KEY Authentication key for Schema Registry No
SCHEMA_REGISTRY_API_SECRET Authentication secret for Schema Registry No
SCHEMA_REGISTRY_ENDPOINT URL endpoint for Schema Registry services No
TABLEFLOW_API_KEY Authentication key for Tableflow services No
TABLEFLOW_API_SECRET Authentication secret for Tableflow services No

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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