Skip to content

Add native MCP config format, replace vmcp YAML#42

Merged
JAORMX merged 2 commits intomainfrom
feat/native-mcp-config-format
Mar 16, 2026
Merged

Add native MCP config format, replace vmcp YAML#42
JAORMX merged 2 commits intomainfrom
feat/native-mcp-config-format

Conversation

@JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Mar 16, 2026

Summary

  • Replace the vmcp config pass-through (--mcp-config accepting raw vmcp YAML with groupRef, incomingAuth.type, etc.) with a simpler brood-box-native format that exposes only the two sections we use: authz.policies (Cedar policies) and aggregation (tool conflict resolution)
  • Infer the custom authz profile automatically when the MCP config contains Cedar policies — no need to pass --mcp-authz-profile custom separately
  • Support inline mcp.config in the global config YAML as an alternative to --mcp-config file path

Before:

groupRef: default
incomingAuth:
  type: anonymous
  authz:
    type: cedar
    policies:
      - 'permit(principal, action == Action::"list_tools", resource);'

After:

authz:
  policies:
    - 'permit(principal, action == Action::"list_tools", resource);'

Changes by layer

Layer Files What changed
Domain pkg/domain/config/config.go New MCPFileConfig, MCPFileAuthzConfig, MCPAggregationConfig, MCPWorkloadToolConfig, MCPToolOverride types with Validate(); MCPConfig.ConfigPathMCPConfig.Config *MCPFileConfig
Infra internal/infra/mcp/configloader.go New LoadMCPFileConfig(path) — reads YAML, validates, returns (nil, nil) for missing files
Infra internal/infra/mcp/translate.go New translateAggregation() and translateAuthz() — converts brood-box snake_case to vmcp camelCase types
Infra internal/infra/mcp/provider.go Replace configPath string with mcpConfig *MCPFileConfig; use translation instead of vmcp YAML loader
Infra internal/infra/mcp/profiles.go Error message: "vmcp config" → "MCP config"
App pkg/sandbox/sandbox.go resolveMCPConfig uses Config instead of ConfigPath
CLI cmd/bbox/main.go Load via LoadMCPFileConfig, implicit custom profile inference, updated flag help text
Docs USER_GUIDE.md, CLAUDE.md All vmcp YAML examples → native format

Test plan

  • task verify passes (fmt + lint + test, 0 issues, 0 failures)
  • New tests: TestMCPFileConfig_Validate (14 cases), configloader_test.go (7 cases), translate_test.go (7 cases)
  • Updated tests: main_test.go MCP override test, profiles_test.go error message
  • Manual: create bbox-mcp.yaml with Cedar policies, verify bbox claude-code --mcp-config ./bbox-mcp.yaml works
  • Manual: verify implicit custom profile inference (no --mcp-authz-profile needed)
  • Manual: verify inline mcp.config: struct in global config parses correctly

🤖 Generated with Claude Code

@JAORMX JAORMX force-pushed the feat/native-mcp-config-format branch from 38e26f8 to b3b886d Compare March 16, 2026 09:54
@JAORMX JAORMX requested a review from jhrozek March 16, 2026 10:35
Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review finding: security consideration around workspace-local agent overrides and MCP.Config propagation.

JAORMX and others added 2 commits March 16, 2026 13:26
Replace the vmcp config pass-through (`--mcp-config` accepting raw vmcp
YAML with `groupRef`, `incomingAuth.type`, etc.) with a simpler
brood-box-native format that exposes only the two sections we use:
`authz.policies` (Cedar policies) and `aggregation` (tool conflict
resolution).

Before:
  groupRef: default
  incomingAuth:
    type: anonymous
    authz:
      type: cedar
      policies: [...]

After:
  authz:
    policies: [...]

- Add MCPFileConfig domain types with Validate()
- Add config loader (YAML file → MCPFileConfig)
- Add translation layer (MCPFileConfig → vmcp types)
- Infer custom profile when config has Cedar policies
- Support inline mcp.config in global config YAML
- Update docs and CLAUDE.md examples

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address PR review feedback:
- Strip MCP.Config and MCP.Authz from workspace-local agent overrides
  in MergeConfigs to prevent Cedar policy injection via per-agent config
- Move --mcp-authz-profile validation before MCP wiring block for
  clearer early errors on invalid profiles

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX force-pushed the feat/native-mcp-config-format branch from b3b886d to 5396de9 Compare March 16, 2026 11:36
@JAORMX JAORMX enabled auto-merge (squash) March 16, 2026 11:45
@JAORMX JAORMX merged commit cf34d00 into main Mar 16, 2026
7 checks passed
@JAORMX JAORMX deleted the feat/native-mcp-config-format branch March 16, 2026 12:48
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