awslabs / awslabs/agentcore-samples

Sample request: Expose an agent on AgentCore Runtime as a remote MCP server (agent-as-tool), consumed from Claude and other MCP clients

Open
#2,071 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.4k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
30

Description

**Problem Definition :** Customers using MCP-capable assistants (Claude custom connectors, Kiro, etc.) want to invoke full reasoning agents hosted on AWS as if they were ordinary MCP tools. There is currently no sample demonstrating the "agent behind an MCP tool" pattern: the runtime-hosting samples serve plain tool servers (e.g. the 3-tool workshop server), and the closest sample (#1860's Claude Desktop web search) exposes a managed tool, not an agent. Customers regularly doubt this pattern is possible at all.

**The solution :** A sample under 02-use-cases/ (or 01-features/01-host-your-agent/ maintainer preference) showing:

A Strands agent inside a FastMCP tool handler, hosted on AgentCore Runtime (MCP protocol mode) - client sees one tool, agent runs multi-step reasoning behind it
The agent consuming its own business tools (Lambda target) from an AgentCore Gateway via OAuth - MCP on both sides of the agent
A front-door Gateway with the Runtime as an MCP-server target and Cognito authorization-code inbound auth, so non-AWS clients connect with browser SSO - demonstrated as a Claude custom connector on a standard claude.ai account
Secondary dev path: SigV4 via mcp-proxy-for-aws from an IDE client
Deploy/teardown scripts, CloudWatch evidence of the agent's server-side tool trajectory
I have this working end to end (Runtime + Gateway + Lambda, verified from Kiro and Claude) and would contribute it cleaned and generalized. Happy to adjust scope/location to fit the repo structure.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the runtime-hosting samples, the 3-tool workshop server, and issue #1860's Claude Desktop web-search sample. Compare placing the sample under 02-use-cases/ or 01-features/01-host-your-agent/ and define the smallest end-to-end scope. Done should include deployment and teardown, Runtime and Gateway MCP flows, client authentication paths, and CloudWatch evidence of the agent's tool trajectory.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
ai, api, authentication, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.