Skip to content

MCP: per-database endpoint/config scopingΒ #4868

Closed

Description

@robfrank

Part of #4859.

Motivation

allowedUsers (and all other permission flags) are server-global today (MCPConfiguration is a single server-wide instance). Multi-tenant agent deployments need to bind an MCP surface to one database with its own permission set. Justification: #3 different permissioning.

Proposed design (conservative v1 scope)

  • Extend MCPConfiguration with an optional per-database override map (e.g. databases: {"<dbName>": {allowedUsers, allowReads, allowInsert, ...}}), consulted by tool execute() methods alongside MCPToolUtils.resolveDatabase(server, user, dbName).
  • Do not attempt new HTTP routing (e.g. /mcp/{database}) in v1 β€” flag that as a larger architectural change needing its own design pass; note it explicitly as a candidate follow-up, not silently dropped.
  • This issue carries the most architectural uncertainty in the set β€” recommend a short design note/spike before implementation rather than starting directly from this issue body.

Acceptance criteria

  • Per-database override resolved correctly when present; falls back to server-global config when absent (backward-compatible).
  • Override respected by every existing and new tool (audit all tool permission-check call sites, not just new ones).
  • Tests cover: no override (current behavior), override present (stricter), override present (more permissive than global β€” decide and document whether this is allowed or capped by the global config as a ceiling).
  • Docs describe the override format and multi-tenant use case; explicitly note HTTP per-database routing is out of scope for this issue.

Files to touch

MCPConfiguration.java, MCPToolUtils.java, every tool class's permission-check call site, tests, docs.

Dependencies

None (independent), but highest uncertainty β€” recommend last in sequence.

Effort estimate

L β€” audit surface across all tools, open design question on override-vs-ceiling semantics, no routing changes included.

Activity

  1. added
    enhancementNew feature or request
    mcpModel Context Protocol server
    on Jul 2, 2026
  2. added this to the 26.8.1 milestone on Jul 2, 2026
  3. self-assigned this
    on Jul 2, 2026
  4. modified the milestones: 26.7.2, 26.8.1 on Jul 8, 2026
  5. added
    mcpModel Context Protocol server
    enhancementNew feature or request
    and removed
    enhancementNew feature or request
    mcpModel Context Protocol server
    on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmcpModel Context Protocol server

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions