get_auth_status
Check QIT CLI authentication status to verify access for testing WordPress/WooCommerce plugins.
Instructions
Check if QIT CLI is authenticated and show current authentication status.
⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:
Via Composer (recommended): composer require woocommerce/qit-cli --dev
Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit
Ensure 'qit' is available in your system PATH
For more information, visit: https://github.com/woocommerce/qit-cli
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/auth.ts:41-76 (handler)The handler function that implements the logic for the 'get_auth_status' tool. It attempts to list extensions using the QIT CLI to verify authentication status, counts available extensions if successful, checks for specific error messages indicating authentication issues, and returns a formatted response.handler: async () => { // Try to list extensions - if it works, we're authenticated const result = await executeQitCommand(["extensions", "--no-interaction"]); if (result.success) { // Count lines that look like extension rows (start with |) const lines = result.stdout.split("\n"); const extensionLines = lines.filter(line => line.startsWith("|") && !line.includes("ID") && !line.includes("---") ); const count = extensionLines.length; return { content: `Authenticated. You have access to ${count} extension(s). Use 'list_extensions' tool to see the full list.`, isError: false, }; } // Check if error indicates auth issue const output = result.stderr || result.stdout; if ( output.includes("not connected") || output.includes("authenticate") || output.includes("connect") ) { return { content: "Not authenticated. Use the 'authenticate' tool to connect with your WooCommerce.com Partner Developer account.", isError: false, }; } return { content: `Unable to determine authentication status: ${output}`, isError: true, }; },
- src/tools/auth.ts:36-40 (schema)The tool definition including name, description, and empty input schema (no parameters required).get_auth_status: { name: "get_auth_status", description: "Check if QIT CLI is authenticated and show current authentication status.", inputSchema: z.object({}),
- src/tools/index.ts:1-11 (registration)Imports the authTools object (containing get_auth_status) and spreads it into the central allTools export, aggregating all tools in the codebase.import { authTools } from "./auth.js"; import { testExecutionTools } from "./test-execution.js"; import { testResultsTools } from "./test-results.js"; import { groupsTools } from "./groups.js"; import { environmentTools } from "./environment.js"; import { packagesTools } from "./packages.js"; import { configTools } from "./config.js"; import { utilitiesTools } from "./utilities.js"; export const allTools = { ...authTools,
- src/server.ts:8-44 (registration)Imports allTools and uses it to dispatch tool calls in the MCP server request handler, retrieving the specific tool by name and executing its handler.import { allTools, ToolName } from "./tools/index.js"; import { detectQitCli, getQitCliNotFoundError } from "./cli/detector.js"; export function createServer() { const server = new Server( { name: "qit-mcp", version: "0.1.0", }, { capabilities: { tools: {}, }, } ); // List available tools 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 }; }); // Handle tool calls server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const tool = allTools[name as ToolName];