Skills

Agentcore Register

Given an MCP server URL, probe the server via curl to discover its metadata and tools...

Install

npx skills add agentic-community/mcp-gateway-registry --skill agentcore-register -g -a claude-code -y
Category
AI and agents
Updated
3d ago
License
Apache-2.0
Context cost
Mediumabout 1,649 tokens
Runs scripts
No, instructions only

What it does

Given an MCP server URL, probe the server via curl to discover its metadata and tools, then generate a markdown file with copy-pasteable content for each field in the Amazon Bedrock AgentCore "Create record" form.

AgentCore Register

Given a remote MCP server URL, probe it to discover server info and tools, then generate a markdown file containing copy-pasteable values for every field in the Amazon Bedrock AgentCore Create record form.

The MCP server URL is provided as $ARGUMENTS.

If $ARGUMENTS is empty, ask the user for the MCP server URL using AskUserQuestion.

Steps

1. Initialize the MCP session

Send the MCP initialize request and capture the response headers (for the session ID) and body (for server info).

curl -s --max-time 15 -D /tmp/_agentcore_mcp_headers.txt \
  -X POST "$MCP_URL" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": {"name": "agentcore-register", "version": "1.0.0"}
    }
  }' > /tmp/_agentcore_mcp_init.json 2>&1

Parse the response to extract:

  • serverInfo.name - the server name
  • serverInfo.version - the server version
  • protocolVersion - the MCP protocol version
  • capabilities - what the server supports

Extract the mcp-session-id header value from /tmp/_agentcore_mcp_headers.txt.

Error handling

  • If the curl request fails or times out, tell the user the server is unreachable and stop.
  • If the response is a 502/503/504, tell the user the server backend is down and stop.
  • If the response is HTML (not JSON), tell the user the URL may not be an MCP endpoint and stop.

2. List the tools

Using the session ID from step 1, send a tools/list request:

SESSION_ID=$(grep -i 'mcp-session-id' /tmp/_agentcore_mcp_headers.txt | awk '{print $2}' | tr -d '\r')
Read the whole SKILL.md on GitHub

More in AI and agents