Skip to content

feat(session): add per-session MCP server support for REST API - #6884

Closed
HyeongDoYun wants to merge 1 commit into
anomalyco:devfrom
HyeongDoYun:feat/per-session-mcp
Closed

HyeongDoYun wants to merge 1 commit into
anomalyco:devfrom
HyeongDoYun:feat/per-session-mcp

Conversation

@HyeongDoYun

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Author

Related issue: #7004

@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Mar 7, 2026
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