Skip to main content
Glama
confluentinc

mcp-confluent

Official
by confluentinc

create-connector

Deploy Kafka connectors by specifying configuration details such as environment, cluster, and connector class. Simplifies integration with Confluent Kafka and Confluent Cloud REST APIs.

Instructions

Create a new connector. Returns the new connector information if successful.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseUrlNoThe base URL of the Kafka Connect REST API.
clusterIdNoThe unique identifier for the Kafka cluster.
connectorConfigYes
connectorNameYesThe name of the connector to create.
environmentIdNoThe unique identifier for the environment this resource belongs to.

Implementation Reference

  • The `handle` method in `CreateConnectorHandler` class that parses arguments, validates environment and cluster IDs, makes a POST request to the Confluent Cloud REST API to create the connector, and returns the result or error.
    async handle(
      clientManager: ClientManager,
      toolArguments: Record<string, unknown> | undefined,
    ): Promise<CallToolResult> {
      const {
        clusterId,
        environmentId,
        connectorName,
        connectorConfig,
        baseUrl,
      } = createConnectorArguments.parse(toolArguments);
      const environment_id = getEnsuredParam(
        "KAFKA_ENV_ID",
        "Environment ID is required",
        environmentId,
      );
      const kafka_cluster_id = getEnsuredParam(
        "KAFKA_CLUSTER_ID",
        "Kafka Cluster ID is required",
        clusterId,
      );
    
      if (baseUrl !== undefined && baseUrl !== "") {
        clientManager.setConfluentCloudRestEndpoint(baseUrl);
      }
    
      const pathBasedClient = wrapAsPathBasedClient(
        clientManager.getConfluentCloudRestClient(),
      );
      const { data: response, error } = await pathBasedClient[
        "/connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors"
      ].POST({
        params: {
          path: {
            environment_id: environment_id,
            kafka_cluster_id: kafka_cluster_id,
          },
        },
        body: {
          name: connectorName,
          config: {
            name: connectorName,
            "kafka.api.key": getEnsuredParam(
              "KAFKA_API_KEY",
              "Kafka API Key is required to create the connector. Check if env vars are properly set",
            ),
            "kafka.api.secret": getEnsuredParam(
              "KAFKA_API_SECRET",
              "Kafka API Secret is required to create the connector. Check if env vars are properly set",
            ),
            ...connectorConfig,
          },
        },
      });
      if (error) {
        return this.createResponse(
          `Failed to create connector ${connectorName}: ${JSON.stringify(error)}`,
          true,
        );
      }
      return this.createResponse(
        `${connectorName} created: ${JSON.stringify(response)}`,
      );
    }
  • Zod schema defining the input parameters for the create-connector tool, including baseUrl, environmentId, clusterId, connectorName, and connectorConfig with specific fields for managed and custom connectors.
    const createConnectorArguments = z.object({
      baseUrl: z
        .string()
        .trim()
        .describe("The base URL of the Kafka Connect REST API.")
        .url()
        .default(() => env.CONFLUENT_CLOUD_REST_ENDPOINT ?? "")
        .optional(),
      environmentId: z
        .string()
        .optional()
        .describe(
          "The unique identifier for the environment this resource belongs to.",
        ),
      clusterId: z
        .string()
        .optional()
        .describe("The unique identifier for the Kafka cluster."),
      connectorName: z
        .string()
        .nonempty()
        .describe("The name of the connector to create."),
      connectorConfig: z
        .object({
          // Required fields
          "connector.class": z
            .string()
            .describe(
              "Required for Managed Connector, Ignored for Custom Connector. The connector class name, e.g., BigQuerySink, GcsSink, etc.",
            ),
          // Optional fields
          "confluent.connector.type": z
            .string()
            .default("MANAGED")
            .describe("Required for Custom Connector. The connector type")
            .optional(),
    
          "confluent.custom.plugin.id": z
            .string()
            .describe(
              "Required for Custom Connector. The custom plugin id of custom connector",
            )
            .optional(),
    
          "confluent.custom.connection.endpoints": z
            .string()
            .describe(
              "Optional for Custom Connector. Egress endpoint(s) for the connector",
            )
            .optional(),
    
          "confluent.custom.schema.registry.auto": z
            .string()
            .default("FALSE")
            .describe(
              "Optional for Custom Connector. Automatically add required schema registry properties",
            )
            .optional(),
        })
        // Allow additional string properties
        .catchall(z.string()),
    });
  • Registration of the CreateConnectorHandler instance in the ToolFactory's static handlers Map under the CREATE_CONNECTOR key.
    [ToolName.CREATE_CONNECTOR, new CreateConnectorHandler()],
  • Enum value defining the string name 'create-connector' for the tool.
    CREATE_CONNECTOR = "create-connector",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates something and returns information if successful, which implies mutation but doesn't specify permissions required, whether creation is idempotent, error conditions, or what 'successful' entails. For a creation tool with complex parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise at two sentences that each earn their place. The first sentence states the core action, and the second adds important behavioral context about the return value. There's zero wasted language or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, nested objects, no output schema, no annotations), the description is minimally adequate. It states what the tool does and the success condition but lacks crucial context about authentication, error handling, connector types (managed vs. custom), or how the creation affects the system. The agent must rely heavily on the schema for operational details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 80%, providing good documentation for most parameters. The description adds no parameter-specific information beyond what's in the schema. It doesn't explain relationships between parameters (e.g., how connectorConfig interacts with clusterId) or provide usage examples. With high schema coverage, the baseline 3 is appropriate as the schema does most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new connector') and resource ('connector'), making the purpose immediately understandable. It distinguishes from siblings like 'delete-connector' and 'list-connectors' by specifying creation rather than deletion or listing. However, it doesn't differentiate from other creation tools like 'create-topics' or 'create-flink-statement' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like needing cluster or environment IDs), when creation is appropriate versus using existing connectors, or how it differs from other creation tools like 'create-topics'. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/confluentinc/mcp-confluent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server