Skip to content

feat: unified aws-mcp-servers example family (MCP 2026-07-28 on Lambda and AgentCore) - #817

Open
czubocha wants to merge 9 commits into
v4from
feat/mcp-server-examples
Open

feat: unified aws-mcp-servers example family (MCP 2026-07-28 on Lambda and AgentCore)#817
czubocha wants to merge 9 commits into
v4from
feat/mcp-server-examples

Conversation

@czubocha

Copy link
Copy Markdown
Contributor

What

A new top-level aws-mcp-servers/ hub with every way to host a Model Context Protocol server on AWS, plus alignment of the existing AgentCore MCP examples to the same surface:

Example Hosting Lambda glue
rest-api API Gateway REST, transferMode: stream ~80-line adapter
function-url Function URL, invokeMode: RESPONSE_STREAM ~80-line adapter
hono Function URL none — official @modelcontextprotocol/hono + Hono's streamHandle
express-web-adapter REST stream + Lambda Web Adapter (zip) none — plain Express app
fastify-container Function URL + Lambda Web Adapter (container image) none — plain Fastify app
agentcore-runtime / agentcore-gateway pointer stubs to the AgentCore family examples

Every example serves the same canonical MCP server (official MCP TypeScript SDK v2, protocol 2026-07-28): tools with streamed SSE progress and a stateless elicitation round-trip, resources incl. a URI template, a prompt, server/discover instructions, and configured cache hints — with authentication (gateway authorizer / IAM / in-process requireBearerAuth) as complete commented extensions.

The umbrella README carries the comparison tables (front doors, capabilities per hosting, pricing links) and explains that web framework, packaging, and front door are three independent choices.

Testing

Each example ships the identical client.mjs (canonical copy at aws-mcp-servers/, drift-checked by validate.js): 12 protocol checks including two negative cases (-32020 header mismatch, -32021 missing capability), a LONG=1 ~36-second streaming case, and a SigV4 mode for AgentCore Runtime / IAM endpoints.

All six deployable examples were deployed and verified 13/13 with this client against live endpoints (both API Gateway REST stream and Function URLs, plus AgentCore Runtime), then removed.

npm run validate and npm run docs pass; examples.json and the root README are regenerated (125 first-party examples).

czubocha added 9 commits July 29, 2026 18:03
…yle MRTR elicitation, header allowlist, multi-tool handler)
…rver and test client

- new top-level aws-mcp-servers/ hub: rest-api, function-url, hono
  (official @modelcontextprotocol/hono + streamHandle), express-web-adapter
  (LWA zip), fastify-container (LWA container image), umbrella README with
  comparison tables, pointer stubs to the AgentCore-hosted variants
- every example serves the same canonical MCP server (tools with streamed
  progress and an elicitation round-trip, resources incl. a template,
  a prompt, server/discover instructions, cache hints) and ships the same
  client.mjs (12 protocol checks incl. -32020/-32021 negatives, LONG=1
  36s streaming case, SigV4 mode)
- AgentCore Runtime mcp-server example aligned to the same server surface
- all six examples live-verified 13/13 with the shared client
Edge-optimized REST endpoints cut streams that stay idle for 30 seconds, and
the clock starts at invoke rather than at the first byte, so a tool that
computes quietly for longer than that fails even with a raised
timeoutInMillis. Measured on one function with timeoutInMillis 120000 and an
identical 36s silent call: HTTP 504 after 30.4s on edge, HTTP 200 after 37.4s
on regional.

The examples passed their own suites on edge only because the demo tool emits
progress every 800ms, which keeps the stream non-idle. Both REST-fronted
examples now set endpointType REGIONAL, with the reason in a comment, and the
READMEs note the constraint for long-running tools.
The suite's long-call case streams progress every 800ms, which keeps a
stream non-idle and therefore passes even on an endpoint that kills idle
streams - the reason the edge-endpoint defect went unnoticed. Adds a
companion case that stays silent for ~36s and returns plain JSON, which is
the shape that fails there (HTTP 504 at ~30s on edge, 200 on regional).

Verified 14/14 against the canonical server.
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