mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
- 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>
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
/**
|
|
* MCP routes - HTTP API for testing MCP servers
|
|
*
|
|
* Provides endpoints for:
|
|
* - Testing MCP server connections
|
|
* - Listing available tools from MCP servers
|
|
*
|
|
* Mounted at /api/mcp in the main server.
|
|
*/
|
|
|
|
import { Router } from 'express';
|
|
import type { MCPTestService } from '../../services/mcp-test-service.js';
|
|
import { createTestServerHandler } from './routes/test-server.js';
|
|
import { createListToolsHandler } from './routes/list-tools.js';
|
|
|
|
/**
|
|
* Create MCP router with all endpoints
|
|
*
|
|
* Endpoints:
|
|
* - POST /test - Test MCP server connection
|
|
* - POST /tools - List tools from MCP server
|
|
*
|
|
* @param mcpTestService - Instance of MCPTestService for testing connections
|
|
* @returns Express Router configured with all MCP endpoints
|
|
*/
|
|
export function createMCPRoutes(mcpTestService: MCPTestService): Router {
|
|
const router = Router();
|
|
|
|
// Test MCP server connection
|
|
router.post('/test', createTestServerHandler(mcpTestService));
|
|
|
|
// List tools from MCP server
|
|
router.post('/tools', createListToolsHandler(mcpTestService));
|
|
|
|
return router;
|
|
}
|