Skip to content

Conversation

@HyeongDoYun
Copy link

Summary

Adds mcpServers parameter to POST /session endpoint, enabling per-session MCP server configuration via REST API.

Changes

  • Add mcpServers field to Session.create.schema
  • Pass mcpServers to Session.createNext
  • Register MCP servers via MCP.add() during session creation

Motivation

ACP (Agent Client Protocol) already supports per-session MCP via newSession(). This PR brings the same capability to the REST API, allowing external integrations to dynamically configure MCP servers per session.

Usage

POST /session
{
  "title": "My Session",
  "mcpServers": {
    "my-remote-mcp": {
      "type": "remote",
      "url": "https://mcp.example.com/sse"
    },
    "my-local-mcp": {
      "type": "local",
      "command": ["npx", "my-mcp-server"]
    }
  }
}

Testing

  • All existing tests pass (544 pass, 0 fail)

🤖 Generated with opencode

@HyeongDoYun
Copy link
Author

Hi! This PR adds REST API parity with ACP for per-session MCP configuration.

Currently newSession() in ACP accepts mcpServers, but POST /session doesn't — this creates inconsistency for integrations that need dynamic MCP configuration via REST.

If this requires design review first, happy to close this and open an issue instead. Let me know!

@HyeongDoYun
Copy link
Author

Related issue: #7004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants