Skip to content

feat: resolve tool profiles at runtime for dynamic MCP/policy activation#83

Open
tycenjmccann wants to merge 3 commits into
aws-samples:mainfrom
tycenjmccann:feat/dynamic-tool-profiles-resolution
Open

feat: resolve tool profiles at runtime for dynamic MCP/policy activation#83
tycenjmccann wants to merge 3 commits into
aws-samples:mainfrom
tycenjmccann:feat/dynamic-tool-profiles-resolution

Conversation

@tycenjmccann
Copy link
Copy Markdown

Summary

  • Orchestrator resolves task's tool_profile against Blueprint-stored profiles, merging profile-specific Cedar policies with base policies and including profile_mcp_servers and profile_skills in the agent payload
  • Agent server/pipeline reads new payload fields and writes profile MCP server entries to .mcp.json using convention-based env var URLs (MCP_SERVER_<NAME>_URL)
  • Follows existing configure_channel_mcp pattern — same merge-into-existing-config behavior, same SDK pickup via setting_sources=["project"]

Builds on PR #82 (schema + validation + CLI flag)

Changes

Layer File What
CDK orchestrator.ts parseToolProfiles import, buildCedarPoliciesPayload(), buildToolProfilePayload(), tool_profiles in loadBlueprintConfig return
Agent server.py Parse tool_profile, profile_mcp_servers, profile_skills from payload
Agent pipeline.py Thread new params, call configure_profile_mcp() before SDK start
Agent channel_mcp.py New configure_profile_mcp() function
Tests orchestrate-task.test.ts 6 new tests for profile resolution + cedar merge
Tests test_channel_mcp.py 7 new tests for configure_profile_mcp

Test plan

  • CDK full test suite: 68 suites, 1220 tests passing
  • Agent full test suite: 538 tests passing
  • CDK TypeScript compile clean
  • CLI TypeScript compile clean
  • Deploy to staging and verify profile MCP servers activate with env var URLs
  • Submit task with --tool-profile frontend and confirm Cedar policies merge correctly

🤖 Generated with Claude Code

tycenjmccann and others added 2 commits May 13, 2026 11:42
…election

Introduces named Tool Profiles — deploy-time configurations that define
which MCP servers, skills, and Cedar policies are available to the agent
on a per-task basis. This is PR 1 of 2: schema, validation, and CLI flag
only (no runtime resolution yet).

- Add ToolProfile interface and toolProfiles prop to Blueprint construct
- Store profiles as JSON in RepoConfig DynamoDB table
- Add tool_profile field to CreateTaskRequest, TaskRecord, TaskDetail
- Validate profile name format (lowercase alphanumeric + hyphens, 1-64 chars)
- Validate profile exists in repo's Blueprint at task admission
- Add --tool-profile flag to CLI submit command
- Add tool_profile field to agent TaskConfig model
- Mirror types across CDK ↔ CLI sync boundary

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… runtime

The orchestrator now resolves the task's tool_profile against the Blueprint's
stored profiles, merging profile cedar policies with base policies and including
profile MCP servers and skills in the agent payload. The agent reads these fields,
writes profile MCP server entries to .mcp.json (convention-based URL via env vars),
and logs skills for future activation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tycenjmccann tycenjmccann requested a review from a team as a code owner May 13, 2026 18:56
… activation

Adds server.py tests for tool_profile/profile_mcp_servers/profile_skills
extraction from orchestrator payload, and pipeline integration tests verifying
configure_profile_mcp is called only when profile_mcp_servers is non-empty.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant