_________available_mcp_services_for_easy_copy_________
Lists available MCP services in your Claude instance for quick reference and easy copying.
Instructions
List all MCP services available in this Claude instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:154-180 (handler)The anonymous async handler function for the tool. It fetches the current list of MCP services using getMcpServices(), handles empty case, formats a numbered list with copy-paste instructions, and returns as text content.async () => { // Always fetch the latest services when the tool is called const currentServices = await getMcpServices(); if (currentServices.length === 0) { return { content: [{ type: "text", text: "No MCP services configured." }] }; } // Format the output with numbered list and usage instructions const formattedList = "📋 AVAILABLE MCP SERVICES:\n" + currentServices.map((name, index) => `${index + 1}. ${name}`).join("\n") + "\n\nCopy a service name to use in prompts like:\n" + "• Can you use [service name] to...\n" + "• Please call [service name] to..."; return { content: [{ type: "text", text: formattedList }] }; }
- src/index.ts:150-181 (registration)The server.tool() registration call that defines the tool name, dynamic toolDescription (computed from initial services), empty input schema, and references the handler function.server.tool( "_________available_mcp_services_for_easy_copy_________", toolDescription, {}, // No parameters needed async () => { // Always fetch the latest services when the tool is called const currentServices = await getMcpServices(); if (currentServices.length === 0) { return { content: [{ type: "text", text: "No MCP services configured." }] }; } // Format the output with numbered list and usage instructions const formattedList = "📋 AVAILABLE MCP SERVICES:\n" + currentServices.map((name, index) => `${index + 1}. ${name}`).join("\n") + "\n\nCopy a service name to use in prompts like:\n" + "• Can you use [service name] to...\n" + "• Please call [service name] to..."; return { content: [{ type: "text", text: formattedList }] }; } );
- src/index.ts:153-153 (schema)Empty input schema object {}, indicating the tool takes no parameters.{}, // No parameters needed
- src/index.ts:61-79 (helper)Core helper function that locates the Claude Desktop config file, parses JSON, extracts keys from config.mcpServers, and returns array of service names. Used by both the tool handler and tool description.async function getMcpServices(): Promise<string[]> { try { // Find the config file const configPath = await findConfigFile(); if (!configPath) { return []; } // Read and parse the config file const configContent = await fs.readFile(configPath, 'utf-8'); const config = JSON.parse(configContent); // Extract and return MCP service names return config.mcpServers ? Object.keys(config.mcpServers) : []; } catch (error) { logDebug(`Error getting MCP services: ${error}`); return []; } }
- src/index.ts:44-55 (helper)Supporting helper to search possible OS-specific paths for Claude Desktop config file and return the first accessible one.async function findConfigFile(): Promise<string | null> { for (const configPath of possibleConfigPaths) { try { await fs.access(configPath); logDebug(`Found config file at: ${configPath}`); return configPath; } catch (error) { logDebug(`Config file not found at: ${configPath}`); } } return null; }