An AWS Labs Model Context Protocol (MCP) server for AWS Security Agent — automated security scanning, penetration testing, and remediation
Project description
AWS Security Agent MCP Server
An AWS Labs Model Context Protocol (MCP) server for AWS Security Agent — automated security scanning and penetration testing.
This MCP server provides full access to the AWS Security Agent service, enabling developers to scan source code for vulnerabilities, run penetration tests against live applications, manage integrations, and apply auto-generated fixes — all from any MCP-compatible client.
Features
- Code security scanning — zip, upload, scan source code, get findings with fixes
- Penetration testing — test live applications via target domains
- Full API access —
call_apitool exposes all SecurityAgent operations - Auto-provisioning — creates agent space and IAM service role on first use
- Respects .gitignore — excludes ignored files from packaging
Prerequisites
- uv installed
- Python 3.10+ (
uv python install 3.10) - AWS credentials configured (via
aws configure, SSO, or environment variables)
Installation
Using uvx (recommended)
{
"mcpServers": {
"awslabs.security-agent-mcp-server": {
"command": "uvx",
"args": ["awslabs.security-agent-mcp-server@latest"],
"env": {
"AWS_PROFILE": "default",
"AWS_REGION": "us-east-1",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
Using Docker
{
"mcpServers": {
"awslabs.security-agent-mcp-server": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "AWS_REGION=us-east-1",
"-e", "AWS_ACCESS_KEY_ID",
"-e", "AWS_SECRET_ACCESS_KEY",
"-e", "AWS_SESSION_TOKEN",
"awslabs/security-agent-mcp-server:latest"
]
}
}
}
Environment Variables
| Variable | Description | Default |
|---|---|---|
AWS_REGION |
AWS region for SecurityAgent API calls | us-east-1 |
AWS_PROFILE |
AWS credential profile name | default profile |
FASTMCP_LOG_LEVEL |
Log level (DEBUG, INFO, WARNING, ERROR) | WARNING |
Available Regions
See AWS documentation for available regions.
Available Tools
Setup
| Tool | Description |
|---|---|
setup_check |
Verify prerequisites — credentials, agent space, role |
setup |
Create/reuse agent space and IAM service role |
Code Review (orchestrated)
| Tool | Description |
|---|---|
start_security_scan |
Zip code, upload to S3, create review, start scan. Returns scan_id. |
get_scan_status |
Poll scan progress |
get_scan_findings |
Get findings from completed scan |
list_scans |
List tracked scans |
stop_scan |
Cancel a running scan |
Remediation
| Tool | Description |
|---|
Full API Access
| Tool | Description |
|---|---|
call_api |
Call any SecurityAgent API operation (pentests, target domains, integrations, artifacts, etc.) |
get_api_guide |
List all available operations dynamically + documentation link |
Usage Flows
Code Review (source scan)
1. setup_check() → verify readiness
2. setup() → provision resources (one-time)
3. start_security_scan(path=".")
4. get_scan_status() → poll until COMPLETED
5. get_scan_findings() → retrieve findings
Penetration Test
1. setup_check() → setup() → one-time
2. call_api("CreateTargetDomain", {targetDomainName, verificationMethod})
3. call_api("VerifyTargetDomain", {targetDomainId})
4. call_api("CreatePentest", {agentSpaceId, title, assets: {endpoints: [...]}, serviceRole})
5. call_api("StartPentestJob", {agentSpaceId, pentestId})
6. Poll: call_api("BatchGetPentestJobs", {agentSpaceId, pentestJobIds})
7. call_api("ListFindings", {agentSpaceId, pentestJobId})
Any Operation
1. get_api_guide() → see all operations + docs link
2. call_api(operation, params) → execute
Required IAM Permissions
These permissions are needed on your AWS credentials (the identity running the MCP server):
For setup (one-time)
iam:CreateRole,iam:PutRolePolicy(if creating a new service role)s3:CreateBucket,s3:PutPublicAccessBlock,s3:PutLifecycleConfiguration(if creating a new bucket)sts:GetCallerIdentitysecurityagent:CreateAgentSpace,securityagent:UpdateAgentSpacesecurityagent:ListAgentSpaces,securityagent:BatchGetAgentSpaces
For code scanning
s3:PutObjectsecurityagent:CreateCodeReview,securityagent:StartCodeReviewJobsecurityagent:BatchGetCodeReviewJobs,securityagent:StopCodeReviewJobsecurityagent:ListFindings,securityagent:BatchGetFindingssecurityagent:StartCodeRemediation,securityagent:BatchDeleteCodeReviews
For pentesting and other operations
Add SecurityAgent permissions as needed for your use case. See How AWS Security Agent works with IAM for details on available actions.
Service Role
During setup, the server creates an IAM service role SecurityAgentScanRole (if one doesn't already exist). If an existing role is found on the agent space, it can be reused after validating its permissions.
The service role is assumed by the SecurityAgent service to read your uploaded code:
- Trust policy:
securityagent.amazonaws.comservice principal - Permissions: S3 read on scan bucket, CloudWatch Logs write
Note: An S3 bucket is used to temporarily store source code for scanning. The MCP server sets a 30-day lifecycle policy on buckets it creates — uploaded content is automatically deleted. If you use your own bucket, consider adding a lifecycle rule to manage storage costs.
Contributing
Contributions are welcome! Please see the main repository's CONTRIBUTING.md for guidelines.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
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 awslabs_security_agent_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: awslabs_security_agent_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 139.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfe29959bcc6926ac8fe569aeb0f3eef8c189ed26933ea1463171a944ac85cc4
|
|
| MD5 |
d492064fcec2a412945e91eb7600577c
|
|
| BLAKE2b-256 |
3a0c9b8fae66e71c7426a76e00cdf9b5e2f233ce83ef68b12ef670917fab1e4d
|
Provenance
The following attestation bundles were made for awslabs_security_agent_mcp_server-0.1.0.tar.gz:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_security_agent_mcp_server-0.1.0.tar.gz -
Subject digest:
bfe29959bcc6926ac8fe569aeb0f3eef8c189ed26933ea1463171a944ac85cc4 - Sigstore transparency entry: 1706272069
- Sigstore integration time:
-
Permalink:
awslabs/mcp@dda334b2605ff8add5579edaf66ae9f4c648c26d -
Branch / Tag:
refs/tags/2026.06.20260602223738 - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dda334b2605ff8add5579edaf66ae9f4c648c26d -
Trigger Event:
push
-
Statement type:
File details
Details for the file awslabs_security_agent_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: awslabs_security_agent_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1b912801cd080138b7d08d3e3b1c680f66134969b5eeb257dd9e0226bb87a9a
|
|
| MD5 |
0edbbe0d50f8959b712b3bfbb87e51f9
|
|
| BLAKE2b-256 |
5668738c5d5ce75725897c25d327e6118d195cb0a7fd3b408fc87ca18ab08da0
|
Provenance
The following attestation bundles were made for awslabs_security_agent_mcp_server-0.1.0-py3-none-any.whl:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_security_agent_mcp_server-0.1.0-py3-none-any.whl -
Subject digest:
f1b912801cd080138b7d08d3e3b1c680f66134969b5eeb257dd9e0226bb87a9a - Sigstore transparency entry: 1706272125
- Sigstore integration time:
-
Permalink:
awslabs/mcp@dda334b2605ff8add5579edaf66ae9f4c648c26d -
Branch / Tag:
refs/tags/2026.06.20260602223738 - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dda334b2605ff8add5579edaf66ae9f4c648c26d -
Trigger Event:
push
-
Statement type: