Local, faithful-enough reimplementation of AWS Bedrock AgentCore Gateway, with a pluggable local Lambda backend.
Project description
localcore-gateway
A local, faithful-enough reimplementation of AWS Bedrock AgentCore Gateway, with a pluggable local Lambda backend. Develop and test agent ↔ gateway ↔ Lambda integrations entirely on your machine, then point the same MCP client at the real AWS gateway with no code changes.
There is no official local emulator for AgentCore Gateway (AWS's agentcore dev
is for the Runtime, not the Gateway). This fills that gap.
0.x — unstable. The CLI flags and config schema may change between minor releases until 1.0. Pin a version if you depend on it.
What it reproduces
- MCP Streamable-HTTP at
/mcp— the same wire surface as the real gateway (built on the FastMCP 3.x server; no hand-rolled JSON-RPC). - Target aggregation — every
(target, tool)is exposed as one MCP tool namedtarget___tool(AgentCore's triple-underscore convention). - AgentCore Lambda contract — the tool arguments are passed as the Lambda
event; the tool identity is delivered via
context.client_context.custom['bedrockAgentCoreToolName']; the Lambda's return value becomes the tool result.
Local Lambda backends
| backend | Docker | fidelity | use it for |
|---|---|---|---|
native |
no | one subprocess per target (real process isolation — monorepo-safe), faithful event/context, error envelope, CloudWatch-style logs, hot reload, hard timeout |
the fast dev loop |
sam |
yes | the real AWS Lambda Linux runtime via sam local start-lambda |
full Linux-runtime fidelity check before AWS |
Documentation
- Architecture — request flow, AgentCore contract mapping, component map
- Configuration reference — every config field
- Writing Lambda handlers — the handler contract, multi-tool, errors, logs, native vs sam
- CLI reference —
serve/dev/tools/invoke - Connecting agents — point an MCP client at it; promote to real AWS
Quick start
uv sync
uv run lcgw tools -c examples/config.yaml # show the tool catalog
uv run lcgw invoke -c examples/config.yaml demo___add --data '{"a":2,"b":40}'
uv run lcgw serve -c examples/config.yaml # MCP at http://127.0.0.1:8080/mcp
uv run lcgw dev -c examples/config.yaml # same, with hot reload
Point any MCP client at http://127.0.0.1:8080/mcp.
Using the sam backend
Run sam local start-lambda in your SAM project, then set in the target:
lambda:
backend: sam
sam_endpoint: http://127.0.0.1:3001
sam_function: DemoFunction
Configuration
See examples/config.yaml. A target declares a Lambda
(backend, handler/sam_function, memory_mb, timeout_sec, env) and the
tools it backs (each with an explicit JSON Schema). One Lambda can back many
tools; the handler branches on bedrockAgentCoreToolName.
Tests
uv run pytest
Known limitations
nativeruns your handler in a subprocess but is not a security sandbox (no filesystem/network jail) — only point it at trusted code.nativeserializes invokes per target (one warm execution environment); it does not model Lambda's concurrent-environment scaling.samper-invoke logs appear in thesam localconsole (out-of-band for the Invoke API).- AgentCore's builtin semantic tool search (
x_amz_bedrock_agentcore_search) is not implemented (intentionally omitted). - Target types beyond Lambda (OpenAPI, MCP passthrough, Smithy) are not yet implemented.
License
Apache License 2.0. See NOTICE for attribution and the
trademark disclaimer below.
Trademarks & disclaimer
This is an unofficial, community project. It is not affiliated with, endorsed by, or sponsored by Amazon Web Services, Inc. or its affiliates.
"AWS", "Amazon Web Services", "Amazon Bedrock", "Amazon Bedrock AgentCore", and "AWS Lambda" are trademarks of Amazon.com, Inc. or its affiliates. They are used here only nominatively, to accurately describe the AWS service this project interoperates with / reimplements locally. No AWS trademark, logo, or trade dress is used as the name or branding of this project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file localcore_gateway-0.1.0.tar.gz.
File metadata
- Download URL: localcore_gateway-0.1.0.tar.gz
- Upload date:
- Size: 113.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca3f977baaa2461d1cfb94ba0bd3f9ec0b3981d7d7d07bd4a78303ee5b425695
|
|
| MD5 |
c39b3f8e1a35863c9f67cb7b2ed1030b
|
|
| BLAKE2b-256 |
fa7a4fb9c0de4fa8f698ef158f5e37efa2df32ebdeaafecb47cf035456704bc0
|
Provenance
The following attestation bundles were made for localcore_gateway-0.1.0.tar.gz:
Publisher:
release.yml on tawAsh1/localcore-gateway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
localcore_gateway-0.1.0.tar.gz -
Subject digest:
ca3f977baaa2461d1cfb94ba0bd3f9ec0b3981d7d7d07bd4a78303ee5b425695 - Sigstore transparency entry: 1552874939
- Sigstore integration time:
-
Permalink:
tawAsh1/localcore-gateway@01c1f312e313c9054923171dd9b38fb53cd62466 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tawAsh1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01c1f312e313c9054923171dd9b38fb53cd62466 -
Trigger Event:
push
-
Statement type:
File details
Details for the file localcore_gateway-0.1.0-py3-none-any.whl.
File metadata
- Download URL: localcore_gateway-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa0d43a16a586b630488a08ca5fadff31d9439d893d3eb2b470eb4519d51a259
|
|
| MD5 |
96f202e2b5f4eea9dbd98b540630f264
|
|
| BLAKE2b-256 |
e237997e4b377b3bc9e250782771f0ebc2cb18e309a63802f5d7d574ca75ed3d
|
Provenance
The following attestation bundles were made for localcore_gateway-0.1.0-py3-none-any.whl:
Publisher:
release.yml on tawAsh1/localcore-gateway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
localcore_gateway-0.1.0-py3-none-any.whl -
Subject digest:
aa0d43a16a586b630488a08ca5fadff31d9439d893d3eb2b470eb4519d51a259 - Sigstore transparency entry: 1552874941
- Sigstore integration time:
-
Permalink:
tawAsh1/localcore-gateway@01c1f312e313c9054923171dd9b38fb53cd62466 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tawAsh1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01c1f312e313c9054923171dd9b38fb53cd62466 -
Trigger Event:
push
-
Statement type: