mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
feat: add MCP server testing and tool listing functionality
- Add MCPTestService for testing MCP server connections - Support stdio, SSE, and HTTP transport types - Implement workaround for SSE headers bug (SDK Issue #436) - Create API routes for /api/mcp/test and /api/mcp/tools - Add API client methods for MCP operations - Create MCPToolsList component with collapsible schema display - Add Test button to MCP servers section with status indicators - Add Headers field for HTTP/SSE servers - Add Environment Variables field for stdio servers - Fix text overflow in tools list display 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1139,6 +1139,67 @@ export class HttpApiClient implements ElectronAPI {
|
||||
return this.subscribeToEvent('backlog-plan:event', callback as EventCallback);
|
||||
},
|
||||
};
|
||||
|
||||
// MCP API - Test MCP server connections and list tools
|
||||
mcp = {
|
||||
testServer: (
|
||||
serverId: string
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
tools?: Array<{
|
||||
name: string;
|
||||
description?: string;
|
||||
inputSchema?: Record<string, unknown>;
|
||||
enabled: boolean;
|
||||
}>;
|
||||
error?: string;
|
||||
connectionTime?: number;
|
||||
serverInfo?: {
|
||||
name?: string;
|
||||
version?: string;
|
||||
};
|
||||
}> => this.post('/api/mcp/test', { serverId }),
|
||||
|
||||
testServerConfig: (serverConfig: {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
type?: 'stdio' | 'sse' | 'http';
|
||||
command?: string;
|
||||
args?: string[];
|
||||
env?: Record<string, string>;
|
||||
url?: string;
|
||||
headers?: Record<string, string>;
|
||||
enabled?: boolean;
|
||||
}): Promise<{
|
||||
success: boolean;
|
||||
tools?: Array<{
|
||||
name: string;
|
||||
description?: string;
|
||||
inputSchema?: Record<string, unknown>;
|
||||
enabled: boolean;
|
||||
}>;
|
||||
error?: string;
|
||||
connectionTime?: number;
|
||||
serverInfo?: {
|
||||
name?: string;
|
||||
version?: string;
|
||||
};
|
||||
}> => this.post('/api/mcp/test', { serverConfig }),
|
||||
|
||||
listTools: (
|
||||
serverId: string
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
tools?: Array<{
|
||||
name: string;
|
||||
description?: string;
|
||||
inputSchema?: Record<string, unknown>;
|
||||
enabled: boolean;
|
||||
}>;
|
||||
error?: string;
|
||||
}> => this.post('/api/mcp/tools', { serverId }),
|
||||
};
|
||||
}
|
||||
|
||||
// Singleton instance
|
||||
|
||||
Reference in New Issue
Block a user