Skip to main content
Glama

manage_config

Configure QIT MCP Server settings for backends, partners, and tunneling to manage test environments and connections.

Instructions

Manage QIT configuration (backends, partners, tunneling). Actions: add_backend, remove_backend, switch_backend, current_backend, add_partner, remove_partner, setup_tunnel, set_default_tunnel

⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:

  1. Via Composer (recommended): composer require woocommerce/qit-cli --dev

  2. Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit

  3. Ensure 'qit' is available in your system PATH

For more information, visit: https://github.com/woocommerce/qit-cli

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe configuration action to perform
nameNoBackend or partner name (required for add/remove/switch)
urlNoBackend URL (for add_backend)
tunnel_methodNoTunnel method (for tunnel actions: ngrok, cloudflare, etc.)

Implementation Reference

  • The main handler function for the 'manage_config' tool. It parses the action and arguments, constructs the corresponding QIT CLI command, and executes it using buildArgs and executeAndFormat.
    handler: async (args: { action: (typeof configActions)[number]; name?: string; url?: string; tunnel_method?: string; }) => { let command: string; let positional: string[] = []; const flags: Record<string, string | boolean | undefined> = {}; switch (args.action) { case "add_backend": command = "backend:add"; if (args.name) positional.push(args.name); if (args.url) flags.url = args.url; break; case "remove_backend": command = "backend:remove"; if (args.name) positional.push(args.name); break; case "switch_backend": command = "backend:switch"; if (args.name) positional.push(args.name); break; case "current_backend": command = "backend:current"; break; case "add_partner": command = "partner:add"; if (args.name) positional.push(args.name); break; case "remove_partner": command = "partner:remove"; if (args.name) positional.push(args.name); break; case "setup_tunnel": command = "tunnel:setup"; if (args.tunnel_method) positional.push(args.tunnel_method); break; case "set_default_tunnel": command = "tunnel:set-default"; if (args.tunnel_method) positional.push(args.tunnel_method); break; default: return { content: `Unknown action: ${args.action}`, isError: true, }; } const cmdArgs = buildArgs(command, positional, flags); return executeAndFormat(cmdArgs); },
  • Definition of the 'manage_config' tool including name, description, and input schema using Zod for validation.
    manage_config: { name: "manage_config", description: `Manage QIT configuration (backends, partners, tunneling). Actions: ${configActions.join(", ")}`, inputSchema: z.object({ action: z .enum(configActions) .describe("The configuration action to perform"), name: z .string() .optional() .describe("Backend or partner name (required for add/remove/switch)"), url: z .string() .optional() .describe("Backend URL (for add_backend)"), tunnel_method: z .string() .optional() .describe("Tunnel method (for tunnel actions: ngrok, cloudflare, etc.)"), }),
  • src/server.ts:25-38 (registration)
    Registers 'manage_config' (via allTools) for listing available tools in the MCP server.
    server.setRequestHandler(ListToolsRequestSchema, async () => { // Check if QIT CLI is available const cliInfo = detectQitCli(); const tools = Object.entries(allTools).map(([_, tool]) => ({ name: tool.name, description: cliInfo ? tool.description : `${tool.description}\n\n⚠️ QIT CLI not detected. ${getQitCliNotFoundError()}`, inputSchema: zodToJsonSchema(tool.inputSchema), })); return { tools }; });
  • src/server.ts:44-65 (registration)
    Handles tool calls by looking up the handler from allTools (which includes manage_config) and executing it.
    const tool = allTools[name as ToolName]; if (!tool) { return { content: [ { type: "text", text: `Unknown tool: ${name}`, }, ], isError: true, }; } try { // Validate input const validatedArgs = tool.inputSchema.parse(args); // Execute tool // eslint-disable-next-line @typescript-eslint/no-explicit-any const result = await (tool.handler as (args: any) => Promise<{ content: string; isError: boolean }>)(validatedArgs);
  • Aggregates and exports all tools, spreading configTools (containing manage_config) into allTools used by the server.
    export const allTools = { ...authTools, ...testExecutionTools, ...testResultsTools, ...groupsTools, ...environmentTools, ...packagesTools, ...configTools, ...utilitiesTools, };

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/woocommerce/qit-mcp'

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