StreamNative (Apache Pulsar/Kafka) MCP server

Bridges AI systems with Apache Pulsar/Kafka messaging infrastructure, enabling natural language management of topics, subscriptions, schemas, and resources for monitoring and troubleshooting distributed messaging systems.
Back to servers
Setup instructions
Provider
StreamNative
Release date
May 13, 2025
Language
Python
Stats
18 stars

StreamNative MCP Server provides a standardized interface for LLMs and AI agents to interact with StreamNative Cloud services, Apache Kafka, and Apache Pulsar messaging systems. Following the Model Context Protocol specification, it enables AI applications to seamlessly access messaging services through a common API.

Installation

Homebrew (macOS and Linux)

# Add the tap repository
brew tap streamnative/streamnative

# Install streamnative-mcp-server
brew install streamnative/streamnative/snmcp

Docker Image

# Pull image from Docker Hub
docker pull streamnative/snmcp 

From Github Release

Visit the releases page to get the latest binary of StreamNative MCP Server.

From Source

# Clone the repository
git clone https://github.com/streamnative/streamnative-mcp-server.git
cd streamnative-mcp-server

go mod tidy
go mod download

# Build the binary
make

Usage

Prerequisites

To access StreamNative Cloud, you'll need:

  1. Access to StreamNative Cloud
  2. StreamNative Cloud Organization
  3. StreamNative Cloud instance and cluster
  4. Service Account with admin role
  5. Downloaded Service Account Key file

Start the MCP Server

Using stdio Server

# Start MCP server with StreamNative Cloud authentication
bin/snmcp stdio --organization my-org --key-file /path/to/key-file.json

# Start MCP server with StreamNative Cloud authentication and pre-configured context
# When --pulsar-instance and --pulsar-cluster are provided, context management tools are disabled
bin/snmcp stdio --organization my-org --key-file /path/to/key-file.json --pulsar-instance my-instance --pulsar-cluster my-cluster

# Start MCP server with external Kafka
bin/snmcp stdio --use-external-kafka --kafka-bootstrap-servers localhost:9092 --kafka-auth-type SASL_SSL --kafka-auth-mechanism PLAIN --kafka-auth-user user --kafka-auth-pass pass --kafka-use-tls --kafka-schema-registry-url https://sr.local --kafka-schema-registry-auth-user user --kafka-schema-registry-auth-pass pass

# Start MCP server with external Pulsar
bin/snmcp stdio --use-external-pulsar --pulsar-web-service-url http://pulsar.example.com:8080
bin/snmcp stdio --use-external-pulsar --pulsar-web-service-url http://pulsar.example.com:8080  --pulsar-token "xxx"

# Start MCP server with StreamNative Cloud authentication using Docker
docker run -i --rm -e SNMCP_ORGANIZATION=my-org -e SNMCP_KEY_FILE=/key.json -v /path/to/key-file.json:/key.json -p 9090:9090 streamnative/snmcp stdio

Using SSE (Server-Sent Events) Server

# Start MCP server with SSE and StreamNative Cloud authentication
snmcp sse --http-addr :9090 --http-path /mcp --organization my-org --key-file /path/to/key-file.json

# Start MCP server with SSE and pre-configured StreamNative Cloud context
# When --pulsar-instance and --pulsar-cluster are provided, context management tools are disabled
snmcp sse --http-addr :9090 --http-path /mcp --organization my-org --key-file /path/to/key-file.json --pulsar-instance my-instance --pulsar-cluster my-cluster

# Start MCP server with SSE and external Kafka
snmcp sse --http-addr :9090 --http-path /mcp --use-external-kafka --kafka-bootstrap-servers localhost:9092

# Start MCP server with SSE and external Pulsar
snmcp sse --http-addr :9090 --http-path /mcp --use-external-pulsar --pulsar-web-service-url http://pulsar.example.com:8080

# Start MCP server with SSE using Docker with StreamNative Cloud authentication
docker run -i --rm -e SNMCP_ORGANIZATION=my-org -e SNMCP_KEY_FILE=/key.json -v /path/to/key-file.json:/key.json -p 9090:9090 streamnative/snmcp sse

Command-line Options

Usage:
  snmcp [command]

Available Commands:
  stdio       Start stdio server
  help        Help about any command

Flags:
      --audience string                        The audience identifier for the API server (default "https://api.streamnative.cloud")
      --client-id string                       The client ID to use for authorization grants (default "AJYEdHWi9EFekEaUXkPWA2MqQ3lq1NrI")
      --config-dir string                      If present, the config directory to use
      --enable-command-logging                 When enabled, the server will log all command requests and responses to the log file
      --features strings                       Features to enable, defaults to `all`
  -h, --help                                   help for snmcp
      --issuer string                          The OAuth 2.0 issuer endpoint (default "https://auth.streamnative.cloud/")
      --kafka-auth-mechanism string            The auth mechanism to use for Kafka
      --kafka-auth-pass string                 The auth password to use for Kafka
      --kafka-auth-type string                 The auth type to use for Kafka
      --kafka-auth-user string                 The auth user to use for Kafka
      --kafka-bootstrap-servers string         The bootstrap servers to use for Kafka
      --kafka-ca-file string                   The CA file to use for Kafka
      --kafka-client-cert-file string          The client certificate file to use for Kafka
      --kafka-client-key-file string           The client key file to use for Kafka
      --kafka-schema-registry-auth-pass string The auth password to use for the schema registry
      --kafka-schema-registry-auth-user string The auth user to use for the schema registry
      --kafka-schema-registry-bearer-token string The bearer token to use for the schema registry
      --kafka-schema-registry-url string       The schema registry URL to use for Kafka
      --key-file string                        The key file to use for authentication to StreamNative Cloud
      --log-file string                        Path to log file
      --organization string                    The organization to use for the API server
      --proxy-location string                  The proxy location to use for the API server (default "https://proxy.streamnative.cloud")
      --pulsar-auth-params string              The auth params to use for Pulsar
      --pulsar-auth-plugin string              The auth plugin to use for Pulsar
      --pulsar-token string                    The token to use for Pulsar
      --pulsar-cluster string                  The default cluster to use for the API server
      --pulsar-instance string                 The default instance to use for the API server
      --pulsar-tls-allow-insecure-connection   The TLS allow insecure connection to use for Pulsar
      --pulsar-tls-cert-file string            The TLS cert file to use for Pulsar
      --pulsar-tls-enable-hostname-verification The TLS enable hostname verification to use for Pulsar (default true)
      --pulsar-tls-key-file string             The TLS key file to use for Pulsar
      --pulsar-tls-trust-certs-file-path string The TLS trust certs file path to use for Pulsar
      --pulsar-web-service-url string          The web service URL to use for Pulsar
  -r, --read-only                              Read-only mode
      --server string                          The server to connect to (default "https://api.streamnative.cloud")
      --use-external-kafka                     Use external Kafka
      --use-external-pulsar                    Use external Pulsar
      --http-addr string                       HTTP server address (default ":9090")
      --http-path string                       HTTP server path for SSE endpoint (default "/mcp")
  -v, --version                                version for snmcp

Tool Configuration

The StreamNative MCP Server lets you control which features are available to AI tools using the --features flag. Enabling only the tools you need helps LLMs make better choices and reduces context size.

Available Features

Combination Feature Sets

Feature Description
all Enables all features: StreamNative Cloud, Pulsar, and Kafka tools

Kafka Features

Feature Description
all-kafka Enables all Kafka admin and client tools, without Apache Pulsar and StreamNative Cloud tools
kafka-admin Kafka administrative operations (all admin tools)
kafka-client Kafka client operations (produce/consume)
kafka-admin-topics Manage Kafka topics
kafka-admin-partitions Manage Kafka partitions
kafka-admin-groups Manage Kafka consumer groups
kafka-admin-schema-registry Interact with Kafka Schema Registry
kafka-admin-connect Manage Kafka Connect connectors

Pulsar Features

Feature Description
all-pulsar Enables all Pulsar admin and client tools, without Apache Kafka and StreamNative Cloud tools
pulsar-admin Pulsar administrative operations (all admin tools)
pulsar-client Pulsar client operations (produce/consume)
pulsar-admin-brokers Manage Pulsar brokers
pulsar-admin-broker-stats Access Pulsar broker statistics
pulsar-admin-clusters Manage Pulsar clusters
pulsar-admin-functions-worker Manage Pulsar Function workers
pulsar-admin-namespaces Manage Pulsar namespaces
pulsar-admin-namespace-policy Configure Pulsar namespace policies
pulsar-admin-isolation-policy Manage namespace isolation policies
pulsar-admin-packages Manage Pulsar packages
pulsar-admin-resource-quotas Configure resource quotas
pulsar-admin-schemas Manage Pulsar schemas
pulsar-admin-subscriptions Manage Pulsar subscriptions
pulsar-admin-tenants Manage Pulsar tenants
pulsar-admin-topics Manage Pulsar topics
pulsar-admin-sinks Manage Pulsar IO sinks
pulsar-admin-functions Manage Pulsar Functions
pulsar-admin-sources Manage Pulsar Sources
pulsar-admin-topic-policy Configure Pulsar topic policies

StreamNative Cloud Features

Feature Description
streamnative-cloud Manage StreamNative Cloud context and check resource logs
functions-as-tools Dynamically exposes deployed Pulsar Functions as invokable MCP tools, with automatic input/output schema handling.

Note: When using --pulsar-instance and --pulsar-cluster flags together, context management tools are automatically disabled since the context is pre-configured.

Example of enabling only specific features:

# Enable only Pulsar client features
bin/snmcp stdio --organization my-org --key-file /path/to/key-file.json --features pulsar-client

Inspecting the MCP Server

You can use the MCP inspector tool to test and debug your server:

Installation

npm install -g @modelcontextprotocol/inspector

Usage

# Inspect a stdio server
mcp-inspector stdio --command "snmcp stdio --organization my-org --key-file /path/to/key-file.json"

# Inspect an SSE server
mcp-inspector sse --url "http://localhost:9090/mcp"

Integration with MCP Clients

Usage with Claude Desktop

Using stdio Server

{
  "mcpServers": {
    "mcp-streamnative": {
      "command": "${PATH_TO_SNMCP}/bin/snmcp",
      "args": [
        "stdio",
        "--organization",
        "${STREAMNATIVE_CLOUD_ORGANIZATION_ID}",
        "--key-file",
        "${STREAMNATIVE_CLOUD_KEY_FILE}"
      ]
    }
  }
}

Replace ${PATH_TO_SNMCP}, ${STREAMNATIVE_CLOUD_ORGANIZATION_ID}, and ${STREAMNATIVE_CLOUD_KEY_FILE} with your actual values.

Docker alternative:

{
  "mcpServers": {
    "mcp-streamnative": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SNMCP_ORGANIZATION",
        "-e",
        "SNMCP_KEY_FILE",
        "-v",
        "${STREAMNATIVE_CLOUD_KEY_FILE}:/key.json",
        "streamnative/snmcp",
        "stdio"
      ],
      "env": {
        "SNMCP_ORGANIZATION": "${STREAMNATIVE_CLOUD_ORGANIZATION_ID}",
        "SNMCP_KEY_FILE": "/key.json"
      }
    }
  }
}

Using SSE Server

First, install the mcp-proxy tool:

pip install mcp-proxy

Then configure Claude Desktop:

{
  "mcpServers": {
    "mcp-streamnative-proxy": {
      "command": "mcp-proxy",
      "args": [
        "http://localhost:9090/mcp/sse"
      ]
    }
  }
}

Note: If mcp-proxy is not in your system PATH, you'll need to provide the full path to the executable.

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 "mcp-streamnative" '{"command":"${PATH_TO_SNMCP}/bin/snmcp","args":["stdio","--organization","${STREAMNATIVE_CLOUD_ORGANIZATION_ID}","--key-file","${STREAMNATIVE_CLOUD_KEY_FILE}"]}'

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": {
        "mcp-streamnative": {
            "command": "${PATH_TO_SNMCP}/bin/snmcp",
            "args": [
                "stdio",
                "--organization",
                "${STREAMNATIVE_CLOUD_ORGANIZATION_ID}",
                "--key-file",
                "${STREAMNATIVE_CLOUD_KEY_FILE}"
            ]
        }
    }
}

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": {
        "mcp-streamnative": {
            "command": "${PATH_TO_SNMCP}/bin/snmcp",
            "args": [
                "stdio",
                "--organization",
                "${STREAMNATIVE_CLOUD_ORGANIZATION_ID}",
                "--key-file",
                "${STREAMNATIVE_CLOUD_KEY_FILE}"
            ]
        }
    }
}

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