mcp: workspace federation of MCP servers into the session

オープン
#6 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go

調査の方向性

Start by reviewing the existing per-session workspace access checks and the current toolset registration model described in the proposal. Define the Phase 1 API around listing bound-server tools and proxying calls, then verify that access scoping, token forwarding, egress controls, timeouts, response limits, and failure degradation are covered; the open questions need resolution before implementation.

索引モデルが issue の本文から書いたものです。

説明

Motivation

The MCP virtual workspace gives every declarative API in a workspace an MCP surface automatically. But not every capability a provider ships is a declarative API. Providers increasingly ship their own MCP servers (search, assistants, domain tools), and platforms building on kcp want those to appear in the same MCP session as the workspace resources.

Today, the only way to combine several MCP servers is aggregation in a gateway in front (for example, the Agent Router, merges MCPRoute backendRefs under per-backend tool prefixes).
That works, but it is operator-owned and static: a workspace owner cannot bring an MCP server without a cluster operator editing gateway config, and every user of the route sees every backend regardless of workspace access.

This server already knows, per session, exactly which workspaces the caller can access (via SelfClusterAccessReview against the access VW). That makes it the natural place for permission-scoped federation.

Proposal

Add a small API, exported like any other kcp API and bound via APIBinding:

apiVersion: mcp.contrib.kcp.io/v1alpha1
kind: MCPServerBinding
metadata:
  name: database-mcp
spec:
  url: https://database-mcp.example.svc:8443/mcp
  caBundle: <base64 PEM>   # optional
  auth: ForwardToken        # ForwardToken | None
  timeoutSeconds: 30        # optional

On session start, the server lists MCPServerBindings in each workspace the caller can access. With auth: ForwardToken it forwards the caller's bearer token downstream, so the downstream server authorizes the real user. The federating server never mints credentials and never widens access.

Phasing

Phase 1, no change to the static toolset model:

  • list_workspace_mcp_tools(workspace) lists a bound server's tools
  • call_workspace_tool(workspace, server, tool, arguments) proxies one call

Phase 2, first-class mounting:

  • federated tools appear in tools/list under a <workspace>.<server>__ prefix (fits the MCP tool name charset)
  • listChanged notifications when bindings change mid-session
  • requires per-session tool registries (today toolsets register once at startup), which is the substantial part
Guardrails

Tenants supply URLs, so the deployment needs an operator-controlled egress allowlist with deny by default, per-call timeouts and response size caps, no redirect following, and HTTPS required unless explicitly allowed. Federated failures degrade to missing tools, never to session errors.

Relation to gateway aggregation

Gateway aggregation and workspace federation compose. Platform-wide backends every user should see stay in the gateway. Tenant and provider extensions live in workspaces and are only visible to users with access there. This proposal also works with no gateway at all, directly behind the front-proxy.

Open questions
  • tools only, or also federate MCP resources and prompts?
  • cache and refresh strategy for downstream tool lists (per session, TTL)?
  • is phase 1 passthrough good enough for agent UX, or is phase 2 needed for adoption?
  • allowlist granularity: per deployment, per binding approval (status set by an operator)?
主要言語
Go
スター
1
フォーク
2
平均マージ
8時間 16分
マージ済み PR(30日)
3

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kcp-dev/contrib-virtual-workspaces のほかの issue

kcp-dev/contrib-virtual-workspaces の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。