Skip to main content
Glama
Kong

Kong Konnect MCP Server

Official
by Kong

list_plugins

Retrieve all plugins configured for a Kong Konnect control plane to manage API gateway functionality like rate-limiting and CORS.

Instructions

List all plugins associated with a control plane.

INPUT:

  • controlPlaneId: String - ID of the control plane

  • size: Number - Number of plugins to return (1-1000, default: 100)

  • offset: String (optional) - Pagination offset token from previous response

OUTPUT:

  • metadata: Object - Contains controlPlaneId, size, offset, nextOffset, totalCount

  • plugins: Array - List of plugins with details for each including:

    • pluginId: String - Unique identifier for the plugin

    • name: String - Name of the plugin (e.g., rate-limiting, cors, etc.)

    • enabled: Boolean - Whether the plugin is enabled

    • config: Object - Plugin-specific configuration

    • protocols: Array - Protocols this plugin applies to

    • tags: Array - Tags associated with the plugin

    • scoping: Object - Defines plugin scope including:

      • consumerId: String - Consumer this plugin applies to (if any)

      • serviceId: String - Service this plugin applies to (if any)

      • routeId: String - Route this plugin applies to (if any)

      • global: Boolean - Whether this is a global plugin

    • metadata: Object - Creation and update timestamps

  • relatedTools: Array - List of related tools for plugin configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
controlPlaneIdYesControl Plane ID (obtainable from list-control-planes tool)
sizeNoNumber of plugins to return
offsetNoOffset token for pagination (from previous response)

Implementation Reference

  • Executes the core logic of the list_plugins tool: calls the API to fetch plugins, transforms the raw response into a structured format with metadata, detailed plugin objects (including scoping to consumers/services/routes), and provides suggestions for related tools.
    export async function listPlugins(
      api: KongApi,
      controlPlaneId: string,
      size = 100,
      offset?: string
    ) {
      try {
        const result = await api.listPlugins(controlPlaneId, size, offset);
    
        // Transform the response to have consistent field names
        return {
          metadata: {
            controlPlaneId: controlPlaneId,
            size: size,
            offset: offset || null,
            nextOffset: result.offset,
            totalCount: result.total
          },
          plugins: result.data.map((plugin: any) => ({
            pluginId: plugin.id,
            name: plugin.name,
            enabled: plugin.enabled,
            config: plugin.config,
            protocols: plugin.protocols,
            tags: plugin.tags,
            scoping: {
              consumerId: plugin.consumer?.id,
              serviceId: plugin.service?.id,
              routeId: plugin.route?.id,
              global: (!plugin.consumer && !plugin.service && !plugin.route)
            },
            metadata: {
              createdAt: plugin.created_at,
              updatedAt: plugin.updated_at
            }
          })),
          relatedTools: [
            "Use list-services and list-routes to find entities these plugins are applied to",
            "Use query-api-requests to analyze traffic affected by these plugins"
          ]
        };
      } catch (error) {
        throw error;
      }
    }
  • Zod schema defining the input parameters for the list_plugins tool: controlPlaneId (required), size (optional, default 100, 1-1000), offset (optional). Used for validation in tool registration.
    export const listPluginsParameters = () => z.object({
      controlPlaneId: z.string()
        .describe("Control Plane ID (obtainable from list-control-planes tool)"),
      size: z.number().int()
        .min(1).max(1000)
        .default(100)
        .describe("Number of plugins to return"),
      offset: z.string()
        .optional()
        .describe("Offset token for pagination (from previous response)"),
    });
  • src/tools.ts:56-62 (registration)
    Tool definition/registration metadata in the tools() array, including method name, name, description (from prompts), parameters schema, and category. This is used by index.ts to register the tool with MCP.
    {
      method: "list_plugins",
      name: "List Plugins",
      description: prompts.listPluginsPrompt(),
      parameters: parameters.listPluginsParameters(),
      category: "configuration"
    },
  • API client helper method that constructs the Kong API endpoint for listing plugins and makes the authenticated HTTP GET request, handling errors consistently.
    async listPlugins(controlPlaneId: string, size = 100, offset?: string): Promise<any> {
      let endpoint = `/control-planes/${controlPlaneId}/core-entities/plugins?size=${size}`;
      
      if (offset) {
        endpoint += `&offset=${offset}`;
      }
    
      return this.kongRequest<any>(endpoint);
    }
  • src/index.ts:101-107 (registration)
    Tool dispatch/routing in the MCP server registration: matches the method name and calls the specific handler function with API client and parsed arguments.
    case "list_plugins":
      result = await configuration.listPlugins(
        this.api,
        args.controlPlaneId,
        args.size,
        args.offset
      );

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/Kong/mcp-konnect'

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