feat: Multi-Server MCP Support Infrastructure#321
feat: Multi-Server MCP Support Infrastructure#321open-swe[bot] wants to merge 28 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| * Migration script to convert legacy single MCP server configuration to multi-server format | ||
| * | ||
| * Usage: | ||
| * node scripts/migrate-single-to-multi-mcp.ts |
There was a problem hiding this comment.
The script migrate-single-to-multi-mcp.ts claims you can run it with node, but it’s a TypeScript file (.ts)! Of course, Node.js will just throw an error, because it can’t execute TypeScript out-of-the-box.
| const { proxyRequest: newProxyRequest } = await import( | ||
| "./[server]/[...path]/route" | ||
| ); | ||
| return newProxyRequest(req, { | ||
| params: { | ||
| server: potentialServerName, | ||
| path: pathSegments.slice(1), | ||
| }, | ||
| }); | ||
| } |
There was a problem hiding this comment.
This is throwing an error for me.
Switching to dynamic import with const { POST: newProxyRequest } = await import("./[server]/route") and calling the handler with params: { server: potentialServerName } works correctly for per-server proxying in Next.js route handlers. The try/catch ensures graceful fallback to legacy logic if the import fails. This approach resolves import and routing issues present in the MR.
Fixes #319
Overview
This pull request introduces comprehensive multi-server MCP (Model-Connector-Proxy) support across the application, enabling flexible configuration and connection to multiple AI service providers.
Key Changes
mcp.tsfor multi-server configurationsuse-mcphook and MCP provider to support multiple serversFeatures
Migration Path
Users can:
NEXT_PUBLIC_MCP_SERVERSTesting Recommended
Breaking Changes: None, fully backward compatible