Skip to main content

ADR-012: MCP Tools Architecture β€” RBAC & Multi-Tenant Governance

Metadata​

FieldValue
Statusβœ… Accepted
Date16 January 2026
AuthorChristophe + Claude
LinearCAB-602 (Epic)

Context​

STOA expose des MCP Tools aux agents IA et dΓ©veloppeurs. L'architecture actuelle (20 tools, 7 scopes) est insuffisante pour:

  1. GranularitΓ© RBAC β€” Pas de distinction claire entre personas (Admin vs Developer vs Consumer vs Agent)
  2. Multi-tenancy β€” Namespace tools hardcodΓ©, pas de dynamic generation
  3. Agent Governance β€” Manque de framework pour contrΓ΄ler les agents IA (attestations, policy gates)
  4. ScalabilitΓ© β€” Tools statiques vs gΓ©nΓ©ration dynamique depuis UAC contracts

Decision​

Refactorer l'architecture MCP Tools selon le pattern Core + Proxied avec RBAC granulaire par persona.

Architecture​

Pattern: Core vs Proxied Tools​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ STOA MCP Tool Registry β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ CORE TOOLS (35 static) β”‚ PROXIED TOOLS (dynamic) β”‚
β”‚ ───────────────────────── β”‚ ────────────────────────── β”‚
β”‚ stoa_{domain}_{action} β”‚ {tenant}:{api}:{operation} β”‚
β”‚ Built-in, versioned β”‚ Generated from UAC contracts β”‚
β”‚ Platform management β”‚ Business API exposure β”‚
β”‚ β”‚ β”‚
β”‚ Examples: β”‚ Examples: β”‚
β”‚ - stoa_list_apis β”‚ - acme:crm:search_customers β”‚
β”‚ - stoa_get_metrics β”‚ - acme:billing:create_invoice β”‚
β”‚ - stoa_create_subscription β”‚ - beta:inventory:check_stock β”‚
β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tool Categories (35 Core Tools)​

CategoryCountTools
Platform & Discovery6stoa_platform_info, stoa_health_check, stoa_list_tools, stoa_get_tool_schema, stoa_search_tools, stoa_get_config
API Catalog8stoa_list_apis, stoa_get_api, stoa_search_apis, stoa_get_api_versions, stoa_create_api, stoa_deploy_api, stoa_undeploy_api, stoa_deprecate_api
Subscriptions & Access6stoa_list_subscriptions, stoa_get_subscription, stoa_create_subscription, stoa_update_subscription, stoa_revoke_subscription, stoa_rotate_api_key
Observability & Metrics8stoa_get_metrics, stoa_get_metrics_timeseries, stoa_get_slow_requests, stoa_list_alerts, stoa_list_errors, stoa_get_error_details, stoa_get_error_snapshot, stoa_analyze_errors
UAC Contracts4stoa_validate_contract, stoa_import_openapi, stoa_export_openapi, stoa_export_mcp
Security & Compliance3stoa_get_security_score, stoa_list_audit_events, stoa_scan_vulnerabilities

OAuth2 Scopes (12 scopes)​

ScopeDescriptionTier
stoa:platform:readRead platform config & healthCommunity
stoa:platform:writeModify platform configEnterprise
stoa:catalog:readBrowse API catalogCommunity
stoa:catalog:writeCRUD APIsEnterprise
stoa:subscriptions:readView own subscriptionsCommunity
stoa:subscriptions:writeManage subscriptionsCommunity
stoa:metrics:readAccess metrics & analyticsCommunity
stoa:logs:technicalApp logs (debug, traces)Enterprise
stoa:logs:functionalBusiness logs (API calls)Community
stoa:logs:fullAll logs including PII (masked)Enterprise
stoa:security:readView audit trails, complianceEnterprise
stoa:security:writeSecurity operations, scansEnterprise

RBAC Matrix β€” 6 Personas​

1. Platform Administrator (stoa.admin)​

AttributeValue
DescriptionFull platform control
ScopesALL
Tools AccessALL 35 core + all proxied
TierEnterprise / Partner

2. API Product Owner (stoa.product_owner)​

AttributeValue
DescriptionManages API lifecycle for their team
Scopescatalog:*, subscriptions:*, metrics:read, logs:technical, logs:functional
Tools AccessCatalog CRUD, Subscriptions, Metrics, Errors
ConstraintsOwn team APIs only

3. API Developer (stoa.developer)​

AttributeValue
DescriptionBuilds and deploys APIs
Scopescatalog:read, catalog:write (dev/staging only), metrics:read, logs:technical
Tools AccessDeploy dev/staging, Read metrics/errors
ConstraintsOwn team APIs, non-prod environments

4. API Consumer (stoa.consumer)​

AttributeValue
DescriptionUses APIs via subscriptions
Scopescatalog:read, subscriptions:read, subscriptions:write (own), metrics:read (own usage)
Tools AccessBrowse catalog, Manage own subscriptions, View own usage

5. Security Officer (stoa.security)​

AttributeValue
DescriptionCompliance, audit, security oversight
Scopessecurity:*, logs:full, metrics:read, catalog:read
Tools AccessAudit trails, Security scans, Compliance reports
ConstraintsRead-only by default, approval gates for actions

6. AI Agent (stoa.agent)​

AttributeValue
DescriptionAutonomous AI agent (Claude, GPT, custom)
ScopesWhitelist-only (defined per agent registration)
Tools AccessExplicitly whitelisted tools only
Constraints10min token TTL, mandatory attestations, policy gates (OPA), full audit

Agent Governance Framework​

Security Layers​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Agent Request Flow β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ 1. Authentication (OAuth2 + DPoP/mTLS) β”‚
β”‚ └─→ Verify agent identity, check token validity β”‚
β”‚ β”‚
β”‚ 2. Whitelist Check β”‚
β”‚ └─→ Is this tool in agent's allowed list? β”‚
β”‚ β”‚
β”‚ 3. Policy Gate (OPA) β”‚
β”‚ └─→ Evaluate business rules (time, data sensitivity, etc.) β”‚
β”‚ β”‚
β”‚ 4. Attestation Required? β”‚
β”‚ └─→ If sensitive action, require signed attestation β”‚
β”‚ β”‚
β”‚ 5. Execute & Audit β”‚
β”‚ └─→ Run tool, log everything, return result β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Token Security​

MechanismStandardPurpose
DCRRFC 7591/7592Dynamic Client Registration
DPoPRFC 9449Proof-of-Possession (public clients)
mTLSRFC 8705Cert-bound tokens (confidential clients)
Short TTLβ€”10min max for agents

MCP Resources (15)​

Resource URIDescription
stoa://platform/infoPlatform metadata
stoa://platform/healthHealth status
stoa://apisAPI catalog list
stoa://apis/{id}Single API details
stoa://apis/{id}/versionsAPI version history
stoa://subscriptionsUser's subscriptions
stoa://subscriptions/{id}Single subscription
stoa://metrics/{api_id}/summaryAPI metrics summary
stoa://metrics/{api_id}/timeseriesTime-series data
stoa://errors/{api_id}/recentRecent errors
stoa://errors/{snapshot_id}Error snapshot detail
stoa://alerts/activeActive alerts
stoa://audit/eventsAudit trail
stoa://security/scoreSecurity posture
stoa://toolsAvailable tools for current user

Comparison: Before vs After​

AspectBeforeAfter
Core Tools20 (flat)35 (structured by domain)
OAuth2 Scopes712 (granular)
PersonasImplicit6 explicit with RBAC matrix
Multi-tenantHardcoded namespaceDynamic {tenant}:{api}:{op}
Agent GovernanceNoneFull framework (whitelist, attestations, policy gates)
Tool GenerationManualAuto from UAC contracts

Consequences​

Positive​

  • βœ… Enterprise-grade access control (RBAC by persona)
  • βœ… Scalable multi-tenant architecture
  • βœ… Safe AI agent integration with policy gates
  • βœ… Automatic tool exposure from UAC contracts
  • βœ… Compliance-ready (NIS2/DORA audit trails)

Negative​

  • ⚠️ Migration effort for existing integrations
  • ⚠️ Increased complexity in authorization layer
  • ⚠️ OPA policy maintenance overhead

Mitigations​

  • Backward compatibility layer for v1 tools during migration
  • Policy templates for common use cases
  • Gradual rollout by tenant

References​