-
Notifications
You must be signed in to change notification settings - Fork 349
feat: Multi-Server MCP Support Infrastructure #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.ts
for multi-server configurationsuse-mcp
hook and MCP provider to support multiple serversFeatures
Migration Path
Users can:
NEXT_PUBLIC_MCP_SERVERS
Testing Recommended
Breaking Changes: None, fully backward compatible