feat: add protocol mode support (HTTP, MCP, A2A)#550
Open
Conversation
Add the protocol dimension to all agent creation flows: non-interactive
CLI, TUI wizard, and BYO agent. Each protocol mode routes to the correct
template directory under a new protocol-first layout
(python/{protocol}/{framework}/base/).
Key changes:
- Schema: ProtocolModeSchema, PROTOCOL_FRAMEWORK_MATRIX, helpers
- Templates: restructure under http/, add mcp/, a2a/, agui/ dirs
- Rendering: BaseRenderer uses protocol in template path, new McpRenderer
- CLI: --protocol flag on add agent and create commands with validation
- TUI: protocol step in wizard, conditional framework/model filtering
- Schema mapper: protocolMode passthrough, MCP skips model/memory/creds
- Tests: unit tests for schema, validation, rendering, and mapping
Add create-protocols.test.ts covering MCP, A2A, AGUI, and HTTP create and add-agent flows. Fix MCP create defaulting undefined model provider by falling back to Bedrock (no credential needed). Add protocol option to createTestProject helper.
Previously HTTP agents omitted protocolMode for backwards compatibility. Now all agents have an explicit protocolMode field set to HTTP, MCP, A2A, or AGUI. This makes the config self-documenting and consistent.
Align templates with bedrock-agentcore-sdk-python PRs #349 and #350: A2A templates now use serve_a2a() from bedrock_agentcore.runtime: - Strands: StrandsA2AExecutor from strands.multiagent.a2a.executor - GoogleADK: A2aAgentExecutor with Runner + AgentCard from a2a-sdk - LangGraph: custom AgentExecutor subclass with AgentCard from a2a-sdk - Dependencies: bedrock-agentcore[a2a], removed uvicorn/langgraph-a2a AGUI templates now use serve_ag_ui() and AGUIApp from runtime: - Strands: StrandsAgent from ag_ui_strands + serve_ag_ui() - GoogleADK: AGUIApp decorator with Runner, yields AG-UI events - LangGraph: AGUIApp decorator with graph.ainvoke, yields AG-UI events - Dependencies: bedrock-agentcore[ag-ui], removed uvicorn/fake adapters
- Rename `protocolMode` field to `protocol` in AgentEnvSpec schema and all downstream types (GenerateConfig, AddAgentConfig, AgentRenderConfig) - Remove AGUI protocol support (CDK L1 does not support it yet): delete all agui templates, remove from enums/matrix/tests/options - Fix TUI crash in Add Agent -> New Agent flow: ADD_AGENT_STEP_LABELS was missing the 'protocol' step, causing StepIndicator to crash on undefined.length - Pass protocol selection through AddAgentConfig so it isn't silently dropped when creating agents via the TUI add-agent flow - Fix type error in create/validate.ts: capture validated ProtocolMode from safeParse instead of using untyped string
src/assets/python/http/langchain_langgraph/base/model/load.py
Dismissed
Show dismissed
Hide dismissed
src/assets/python/a2a/strands/capabilities/memory/session.py
Dismissed
Show dismissed
Hide dismissed
- Remove unnecessary type assertion on cliOptions.protocol - Remove unused SDK_OPTIONS import from GenerateWizardUI - Remove unused getSDKOptionsForProtocol import from useGenerateWizard - Prefix unused destructured variable with underscore in test - Run prettier on 4 files that failed format check
The integration test still referenced the old `protocolMode` field name instead of `protocol`, and included an AGUI test case that was removed from the schema.
Contributor
Coverage Report
|
- Add model/__init__.py to all A2A template directories (strands, googleadk, langchain_langgraph) matching HTTP template structure - Move build type validation before MCP early return in create/validate so invalid --build values are caught for MCP agents too - Add clarifying comment for phantom framework/modelProvider defaults in MCP path of create/command.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds protocol mode as a first-class dimension to the agent creation flow. Users can now create HTTP (default), MCP, and A2A agents through both CLI flags and the TUI wizard.
protocolfield onAgentEnvSpec(optional, defaults to HTTP for backwards compat)python/{protocol}/{framework}/). New templates for MCP standalone and A2A (Strands, GoogleADK, LangGraph)--protocolflag oncreateandadd agentcommands with full validation--framework,--model-provider,--memoryprotocolConfigurationtoCfnRuntimefor non-HTTP protocolsAGUI support removed (CDK L1 doesn't support it yet). Can be re-added when L1 is ready.
Test plan
agentcore create --name McpTest --protocol MCP --language Pythoncreates MCP standalone projectagentcore create --name A2aTest --protocol A2A --framework Strands --model-provider Bedrock --memory none --language Pythoncreates A2A projectagentcore add agent --protocol MCP --name McpAgent --language Pythonin existing project--protocol) continues to work as HTTP