Use AWS MCP Server for Independent AWS API
Use the MCP server to access AWS APIs independently, leveraging amazon-q-cli's use_aws tool for general AWS API workflows.
npx -y @runjivu/use_aws_mcpOverview
The MCP (Model Context Protocol) server lets developers expose AWS APIs to language models and other tools through a controlled, local endpoint. Instead of giving models direct AWS credentials or embedding AWS SDK calls inside the model runtime, the MCP server accepts well-defined MCP requests and forwards them to AWS on the caller’s behalf. This enables safer, auditable, and portable interactions between agent frameworks and AWS services.
This repo pairs particularly well with amazon-q-cli’s use_aws tool: use_aws emits general AWS API workflows and can target an MCP-compliant server instead of talking directly to AWS. Running an MCP server gives you an independent, local gateway that centralizes credential handling, request validation, logging, and service allowlists for model-driven workflows.
Features
- Acts as an MCP-compatible gateway that proxies authorized requests to AWS services
- Centralized credential management (env vars, IAM role, or STS)
- Allowlist/denylist support for services and API actions
- Request logging and basic auditing for model-originated calls
- Easy integration with amazon-q-cli’s
use_awsfor common AWS workflows - Runs locally or inside containers for development and CI use
Installation / Configuration
Clone and run the server locally:
# Python example (if provided in repo)
Run with Docker (example):
Example JSON configuration (config.json):
Common environment variables supported:
- AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN — standard AWS credentials
- AWS_REGION — default AWS region
- MCP_TOKEN — simple bearer token for authenticating clients to the MCP server
Configuration options at a glance:
| Option | Type | Description |
|---|---|---|
| listen | string | Host:port for server binding |
| mcp_token | string | Token required to authenticate incoming MCP clients |
| allowed_services | array | List of AWS services the server will forward |
| audit_log | string | Path to write request/audit records |
| max_request_size | int | Max MCP request size in bytes |
Available Resources
- GitHub repository: https://github.com/runjivu/use_aws_mcp
- amazon-q-cli (use_aws tool) — integrates with the MCP server to drive AWS workflows
- AWS SDKs and CLI — underlying clients used by the server to forward requests
- Model Context Protocol (MCP) — the protocol the server implements for model/tool communication
(Consult the repository README and source for the exact MCP request/response schema supported by this server.)
Use Cases
Local model-driven development
- Run the MCP server locally during development. Use
amazon-q-cli use_awswith the server to let a model prototype list S3 buckets or describe EC2 instances without exposing direct credentials to the model.
Example:
- Run the MCP server locally during development. Use
Secure production agent execution
- Deploy the MCP server into a controlled network segment. Agents or LLMs call the MCP endpoint; the server enforces allowed services/actions and logs all requests for auditing.
CI/CD and automated tests
- Run the MCP server inside CI containers with short-lived credentials (via STS). Tests and automation can run
use_awsworkflows against the server to validate logic against real AWS APIs while centralizing credential rotation.
- Run the MCP server inside CI containers with short-lived credentials (via STS). Tests and automation can run
Auditable automation workflows
- Centralize AWS operations initiated by models or automation tools, making it straightforward to capture who asked for what and when — useful for compliance and debugging.
Example: curl call (diagnostic)
You can validate the server is up with a simple health or ping endpoint (if provided by the implementation):
# expected: {"status":"ok"}
For MCP-specific calls, use the client tooling (amazon-q-cli use_aws) which understands the MCP request format and will send properly structured requests.
Notes and Best Practices
- Keep the MCP token and AWS credentials out of source control; use environment variables or secrets management.
- Limit allowed services and actions to the minimum required for your model workflows.
- Enable request/audit logging in production to keep an audit trail of model-driven operations.
- If you require multi-tenant use, run separate MCP instances or extend the server to support per-tenant authentication and credential scoping.
For full implementation details, supported MCP request formats and any extra flags, see the repository: https://github.com/runjivu/use_aws_mcp.