list-servers
Retrieve a list of all active MCP servers created and managed by MCP Create Server to monitor and control server instances efficiently.
Instructions
List all running servers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:1193-1204 (handler)The handler logic for the 'list-servers' tool. It calls serverManager.listServers() to get the list of running server IDs and returns them as JSON in a text content block.case "list-servers": { const servers = serverManager.listServers(); return { content: [ { type: "text", text: JSON.stringify({ servers }), }, ], }; }
- index.ts:983-990 (schema)The Tool object definition for 'list-servers', including its name, description, and empty input schema (no parameters required).const listServersTool: Tool = { name: "list-servers", description: "List all running servers", inputSchema: { type: "object", properties: {}, }, };
- index.ts:1011-1022 (registration)Registration of the 'list-servers' tool (as listServersTool) in the ListToolsRequest handler response, making it discoverable by clients.server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received ListToolsRequest"); return { tools: [ createServerFromTemplateTool, executeToolTool, getServerToolsTool, deleteServerTool, listServersTool, ], }; });
- index.ts:732-735 (helper)Helper method in ServerManager class that returns an array of all running server IDs from the servers Map.// List all servers listServers(): string[] { return Array.from(this.servers.keys()); }