Skip to content

feat: add per-session MCP server support for REST API (parity with ACP) #7004

@HyeongDoYun

Description

@HyeongDoYun

Problem

ACP (newSession()) supports mcpServers parameter for per-session MCP configuration, but REST API POST /session doesn't.

This creates inconsistency for integrations that need dynamic MCP configuration via REST.

Use Case

External platforms (like MCP orchestrators) need to:

  1. Create sessions via REST API
  2. Attach user-specific MCP servers to each session
  3. Currently impossible without ACP

Proposed Solution

Add mcpServers parameter to POST /session endpoint, matching ACP behavior:

POST /session
{
  "title": "My Session",
  "mcpServers": {
    "user-mcp": {
      "type": "remote",
      "url": "https://user-specific-mcp.com/sse"
    }
  }
}

Implementation

I've already implemented this and opened a PR: #6884

Changes are minimal (~15 lines):

  • Add mcpServers to Session.create.schema
  • Call MCP.add() in createNext()

All existing tests pass.

Questions

Is this something the team would consider? Happy to adjust the implementation based on feedback.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions