Skip to content

Conversation

open-swe[bot]
Copy link
Contributor

@open-swe open-swe bot commented Aug 3, 2025

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

  • Type Definitions: Created new type definitions in mcp.ts for multi-server configurations
  • Environment Support: Added environment helper to parse multi-server configurations
  • Proxy Routes: Implemented per-server proxy routes with authentication handling
  • Hooks & Providers: Refactored use-mcp hook and MCP provider to support multiple servers
  • UI Components: Updated Tools Playground, Agent Creation, and Chat Configuration to work with multi-server setup
  • Migration Script: Added script to help migrate from single-server to multi-server configurations

Features

  • Backward compatibility with existing single-server configurations
  • Dynamic server configuration through environment variables
  • Support for different authentication methods (bearer, API key, OAuth)
  • Flexible tool discovery and selection across multiple servers
  • Edge runtime proxy for efficient server-side request handling

Migration Path

Users can:

  • Continue using existing single-server setup
  • Migrate using the new migration script
  • Configure multiple servers via NEXT_PUBLIC_MCP_SERVERS

Testing Recommended

  • Verify multi-server tool selection
  • Test authentication across different server configurations
  • Validate backward compatibility with existing integrations

Breaking Changes: None, fully backward compatible

@open-swe open-swe bot added the open-swe label Aug 3, 2025
Copy link

vercel bot commented Aug 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
open-agent-platform Error Error Aug 20, 2025 4:18pm

@open-swe open-swe bot marked this pull request as ready for review August 3, 2025 22:18
@open-swe open-swe bot changed the title [WIP]: Add multi-MCP server support feat: Multi-Server MCP Support Infrastructure Aug 3, 2025
* Migration script to convert legacy single MCP server configuration to multi-server format
*
* Usage:
* node scripts/migrate-single-to-multi-mcp.ts
Copy link

@gedion gedion Aug 14, 2025

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.

Comment on lines 107 to 116
const { proxyRequest: newProxyRequest } = await import(
"./[server]/[...path]/route"
);
return newProxyRequest(req, {
params: {
server: potentialServerName,
path: pathSegments.slice(1),
},
});
}
Copy link

@gedion gedion Aug 14, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement multi-server MCP support
3 participants