/aws-agents-for-devsecops:setup-devops-agent runs instead · from aws-agents-for-devsecops
Guides setup and diagnostics for the AWS DevOps Agent MCP connection. Activates when the MCP server is missing, broken, or when the user requests configuration.
This skill never runs in Claude Code
It ships in aws-agents-for-devsecops at skills/, but /aws-agents-for-devsecops:setup-devops-agent (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
The instructions below are specifically for setting up the AWS DevOps Agent plugin for Claude applications. For other clients, use this as a reference, but adjust the instructions based on the client's specific requirements.
The plugin has a default aws-devops-agent entry in ${CLAUDE_PLUGIN_ROOT}/.mcp.json. This entry uses Bearer token auth for us-east-1. It gets the token from DEVOPS_AGENT_TOKEN. Before setup, this variable is usually not set. Because of this, the server shows as failed with HTTP 401 at session start. The 401 message is Access token not configured. Older servers send Invalid or expired access token. This 401 is normal before setup. It does not show a bad token. If DEVOPS_AGENT_TOKEN is not set, the server is not set up. Go to "Step 1: Diagnose current state". Do not tell the user that the token is expired.
1/ Check if the "aws-devops-agent" MCP server is running. If it is, verify that it has a valid connection (see "Step 3: Verify connectivity").
If verification is successful, you should inform the user that the plugin is already setup using SigV4 or Bearer Token. Offer that you can switch the configuration to Bearer Token or SigV4, see "Step 2: Decide auth path" below for details.
If the user does not want to change their auth configuration, then you are DONE STOP HERE.
2/ Check for an MCP server config with a key "aws-devops-agent" in the following locations:
${CLAUDE_PLUGIN_ROOT}/.mcp.jsonThen:
aws-devops-agent key exists AND the server is connected (tools are available, see "Step 3: Verify connectivity") → Inform the user: "DevOps Agent is already configured and connected."; If Bearer Token is used in the MCP config, suggest that you can alternatively setup the plugin to use SigV4 credentials for the AWS DevOps Agent (multiple agent spaces, admin tooling). If SigV4 credentials are used in the MCP config, suggest that you can alternatively setup the plugin to use Bearer Token credentials for the AWS DevOps Agent (single agent space).aws-devops-agent key exists but is failing → continue to "Step 1: Diagnose current state"aws-devops-agent key does NOT exist → continue to "Step 1: Diagnose current state"Run these checks:
# Bearer token
echo "DEVOPS_AGENT_TOKEN: $([ -n "$DEVOPS_AGENT_TOKEN" ] && echo 'set' || echo 'not set')"
echo "DEVOPS_AGENT_REGION: ${DEVOPS_AGENT_REGION:-not set}"
# SigV4 dependencies
uvx --version 2>&1
# AWS credentials
aws sts get-caller-identity 2>&1
Determine:
bearer_ready = DEVOPS_AGENT_TOKEN is set AND DEVOPS_AGENT_REGION is setsigv4_ready = aws sts get-caller-identity succeeds AND uvx is installedAfter diagnostics, ALWAYS ask the user which path they want — even if only one is available. Present what you found and let them choose.
The user may want to use bearer token if they only have access to the operator app for an agent space.
The user may want to use SigV4 if they use multiple agent spaces and/or have admin permissions to manage agent spaces.
| Bearer ready | SigV4 ready | Action |
|---|---|---|
| yes | yes | "You have both a bearer token and AWS credentials configured. Which would you prefer for the DevOps Agent? Bearer token (single agent space) or AWS credentials / SigV4 (multiple agent spaces and admin tooling)?" |
| yes | no | "You have a bearer token configured. Would you like me to set up the DevOps Agent using your Bearer token (single agent space)? Or would you prefer to configure AWS credentials / SigV4 instead (multiple agent spaces and admin tooling)?" |
| no | yes | "You have valid AWS credentials. Would you like me to set up the DevOps Agent using SigV4 (multiple agent spaces and admin tooling)? Or would you prefer to set up a Bearer token instead (single agent space)?" |
| no | no | "Neither a bearer token nor AWS credentials are configured. Would you like to connect via Bearer token (single agent space) or AWS credentials / SigV4 (multiple agent spaces and admin tooling)?" Then guide them through the chosen path. |
If the user would like to setup a bearer token, refer them to the AWS docs for Connect to DevOps Agent remote servers or walk them through the steps to create a access token from this document.
Do NOT proceed to Step 3 until the user confirms their choice.
If the "aws-devops-agent" MCP server is already running, check if you can list tools. If you can, then you have verified the connection.
Otherwise, proceed.
Verify BEFORE writing .mcp.json. This confirms the credentials work against the live endpoint. Or use this to verify an existing MCP server config.
curl -s -w "\nHTTP_STATUS: %{http_code}" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DEVOPS_AGENT_TOKEN" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
"https://connect.aidevops.${DEVOPS_AGENT_REGION}.api.aws/mcp"
| Result | Meaning | Action |
|---|---|---|
HTTP 200 + result.tools array | Success | Proceed to Step 4 |
HTTP 401 + Access token not configured or Empty bearer token | DEVOPS_AGENT_TOKEN is not set in the shell that started the client | Do the steps in "Bearer token guidance" below with the user |
HTTP 401 + Invalid or expired access token | The token is not valid, is expired, or is revoked | Tell the user to make a new token in the Operator Web App |
| HTTP 403 | Token scope insufficient | Tell user token needs agent:read + agent:operate scopes |
| Connection refused / timeout | Endpoint unreachable | If SigV4 is available, offer fallback. Otherwise report unavailable. |
timeout 30 bash -c '
{
echo "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"setup-check\",\"version\":\"1.0\"}}}"
sleep 0.5
echo "{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}"
sleep 0.5
echo "{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/list\",\"params\":{}}"
sleep 8
} | uvx mcp-proxy-for-aws-cli@latest "https://connect.aidevops.${DEVOPS_AGENT_REGION}.api.aws/mcp" --service aidevops --region "$DEVOPS_AGENT_REGION"
'
Note: The first run may take 10-15s as
uvxdownloadsmcp-proxy-for-aws-cliand its dependencies. Subsequent runs are near-instant.
| Result | Meaning | Action |
|---|---|---|
Second line contains result.tools | Success | Proceed to Step 4 |
| No output / timeout | Credentials invalid or endpoint unreachable | Check aws sts get-caller-identity again |
ExpiredTokenException in stderr | AWS session expired | Tell user to re-authenticate (aws sso login or refresh creds) |
AccessDeniedException | Missing IAM permissions | User needs DevOps Agent permissions on their role |
.mcp.jsonBefore writing, confirm with the user:
"I've verified connectivity. I'll now add the [Bearer token / SigV4] MCP server to the plugin's
.mcp.json. Proceed?"
Only write after the user confirms. Write ONE server entry — never both. Install the MCP config in ${CLAUDE_PLUGIN_ROOT}/.mcp.json. You can also offer to install the MCP server at the workspace level. The installation options are:
${CLAUDE_PLUGIN_ROOT}/.mcp.json (default)Replace <REGION> with the user's region, for example us-west-2. This is the value of DEVOPS_AGENT_REGION. Write the region name itself, not the text ${DEVOPS_AGENT_REGION}. Some clients, for example Codex, do not expand variables in url. These clients send the text as it is, and no tools load.
{
"mcpServers": {
"aws-devops-agent": {
"type": "http",
"url": "https://connect.aidevops.<REGION>.api.aws/mcp",
"headers": {
"Authorization": "Bearer ${DEVOPS_AGENT_TOKEN}"
},
"timeout": 120000
}
}
}
Replace <REGION> with the user's region, for example us-west-2. This is the value of DEVOPS_AGENT_REGION.
{
"mcpServers": {
"aws-devops-agent": {
"command": "uvx",
"timeout": 120000,
"args": [
"mcp-proxy-for-aws-cli@latest",
"https://connect.aidevops.<REGION>.api.aws/mcp",
"--service", "aidevops",
"--region", "<REGION>"
]
}
}
}
Only add if the primary aws-devops-agent endpoint is unreachable AND SigV4 credentials are available:
{
"mcpServers": {
"aws-mcp": {
"command": "uvx",
"timeout": 100000,
"args": [
"mcp-proxy-for-aws-cli@latest",
"https://aws-mcp.us-east-1.api.aws/mcp",
"--metadata",
"AWS_REGION=us-east-1"
]
}
}
}
For Sigv4 only: After writing the new MCP config, inform the user that the MCP server has been written successfully. Proceed to the next step.
After successful SigV4 setup, discover and configure AgentSpace routing:
list_agent_spaces via the newly connected MCP to discover available spaces.claude/aws-agents-for-devsecops.md:# AWS DevOps Agent — Routing Guide
| Space | Agent Space ID | Purpose |
|-------|----------------|---------|
| <name> | <id> | <ask user> |
agent_space_id on every tool call when targeting a specific space.Inform the user that they will need to run /reload-plugins to start the new MCP server. You may need to prompt the user to run it. Also mention that after restarting the MCP server they should try the following prompts:
Open the AWS DevOps Agent Operator Web App for your AgentSpace
Navigate to Settings → Access tokens → Generate token
Create a token with Permissions: Operate
Set environment variables:
export DEVOPS_AGENT_TOKEN="<your-token>"
export DEVOPS_AGENT_REGION="<your-region>"
Available regions: https://docs.aws.amazon.com/devopsagent/latest/userguide/about-aws-devops-agent-supported-regions.html
Restart Claude Code (it reads env vars from the shell that launched it)
Important: Without
Operatepermissions, thechatandinvestigatetools will be completely invisible — not just fail, but absent from the tool list.
Install uvx if not present:
brew install uvcurl -LsSf https://astral.sh/uv/install.sh | shConfigure AWS credentials:
aws configure sso --profile devops-agent
aws sso login --profile devops-agent
export AWS_PROFILE=devops-agent
Set the region:
export DEVOPS_AGENT_REGION="<your-region>"
Verify: aws sts get-caller-identity
The IAM role must have DevOps Agent permissions (e.g., managed policy with aidevops access)
Important: Unset
DEVOPS_AGENT_TOKENwhen using SigV4. If both are set, clients may attempt bearer auth instead of the signing proxy.
| Error | Cause | Fix |
|---|---|---|
| No tools visible | The token is not set, or Claude Code did not restart | Set DEVOPS_AGENT_TOKEN, then restart. To change the region, do this setup. |
| HTTP 401 at session start, before setup | The default config is active, and DEVOPS_AGENT_TOKEN is not set. The message is Access token not configured. Older servers send Invalid or expired access token. | Do this setup. The token is not expired. |
HTTP 401 Invalid or expired access token after setup | The token is not valid, is expired, or is revoked | Make a new token in the Operator Web App |
Works in us-east-1 only | The default config always uses us-east-1. DEVOPS_AGENT_REGION does not change it. | Do this setup. Setup writes the region that you select into the config. |
chat/investigate missing | Token scope is agent:read only | Create token with agent:operate scope |
| Connection refused / timeout | Endpoint unreachable | Check network; if SigV4 available, offer aws-mcp fallback |
ExpiredTokenException | AWS session credentials expired | aws sso login or refresh credentials |
AccessDeniedException (SigV4) | Missing IAM permissions | Use a role with DevOps Agent access |
| Proxy won't start | uvx not installed | brew install uv (macOS) or install per platform |
| Tools appear but calls timeout | Normal for chat (5-30s) | Ensure "timeout": 120000 in mcp.json |
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/analyzing-release-readinessTrigger a pre-merge code change risk analysis on a GitHub PR, GitLab MR, or local branch. Use when the user wants to analyze code changes for risk, correctness, and potential rollback issues before merging. Formerly called a release readiness review. Trigger words include code change risk analysis, CCRA, release readiness, code review, change review, analyze PR, analyze MR, review PR, risk analysis, pre-merge, safe to ship, ready to merge, ready to commit, any risks, before merging, validate changes, release management./chatting-with-aws-devops-agentHave a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping, knowledge / runbook discovery, security audits, dependency questions, and quick diagnostics — anything that needs a 5-30 second answer rather than a 5-8 minute deep investigation. Trigger words include cost, optimize, review, architecture, topology, what runbooks, show me, compare, audit, what if./coordinating-multi-space-devops-agentCoordinate the AWS DevOps Agent across multiple AgentSpaces from one Claude Code session — route questions to the right space (prod vs staging vs knowledge), query several spaces in parallel and synthesize, or compare findings across accounts. Use whenever the user has more than one AgentSpace configured, mentions multiple AWS accounts, or asks something like "check both prod and staging", "compare across accounts", or "ask the knowledge space"./diff-scanning-with-aws-security-agentRun a fast AWS Security Agent diff scan on only the changed code since a git ref. Use when the user asks to scan changes, run a diff scan, check what changed for security issues, scan before committing, scan before PR, or any pre-commit/pre-push security check./investigating-incidents-with-aws-devops-agentRun a deep root-cause investigation on the AWS DevOps Agent. Use when the user describes an incident, alarm, outage, or unexplained behavior — keywords like "5xx", "503", "OOM", "latency spike", "deployment failure", "rollback", "sev1", "investigate", "root cause", "debug", "alarm fired", "service down". Polls and streams progress, then surfaces recommendations./pentesting-with-aws-security-agentRun an AWS Security Agent penetration test against a live web application — registers and verifies the target domain, exercises the supplied endpoints with the managed Security Agent service, and returns verified runtime findings. Use when the user asks to pentest, run a penetration test, test their app's attack surface, find runtime vulnerabilities, register or verify a target domain, or check pentest status / findings.npx claudepluginhub aws/agent-toolkit-for-aws --plugin aws-agents-for-devsecopsOther plugins' skills for the same job