Anthropic's terminal-based agent. It speaks MCP natively over HTTP, so no bridge package is needed — the APILayer MCP adapter is added with a single `claude mcp add` command.
Prerequisites
- Claude Code installed and authenticated (`claude --version` works).
- A MCP Bearer token with `mcp_access_enabled` on the subscription.
Add the server (Bearer token)
claude mcp add \ --transport http \ --header "Authorization: Bearer YOUR_APILAYER_MCP_TOKEN" \ apilayer https://mcp.apilayer.com/mcp |
The token is stored in Claude Code's MCP config and resent on every request. Scope it to one APILayer product (portal:<name> claim); mint a separate server entry per product.
Scope: user vs. project
By default the server is added at user scope (available in every Claude Code session). Add --scope project to record the entry in the current repo's .mcp.json instead, so teammates inherit it:
claude mcp add --scope project --transport http \ --header "Authorization: Bearer $APILAYER_MCP_TOKEN" \ apilayer https://mcp.apilayer.com/mcp |
In project scope, never commit a literal token — reference an env var and have each developer export it locally.
When Claude Code prompts for the tool's arguments, include token:
| { "ip": "8.8.8.8", "apiKey": "your-apilayer-access-key" } |
Verify Integration
List configured servers:
| claude mcp list |
Once configured. Examples:
- "What country and city is the IP address 8.8.8.8 located in?" (uses ipstack_lookup)
- “Get location details for {IP_ADDRESS}.” (uses ipstack_lookup)
- “What region does IP {IP_ADDRESS} belong to?”
You should see ipstack_lookup fire and return country / city / lat / lng.
Troubleshooting
Server shows red / connection failed. Run claude mcp get apilayer — confirm the URL ends with /mcp and the header is present. Hit the endpoint manually to rule out network issues:
curl -i -H "Authorization: Bearer $APILAYER_MCP_TOKEN" \ -H "Accept: application/json, text/event-stream" \ https://mcp.apilayer.com/mcp |
Not authorized on every tool call
- Bearer token missing the portal:<IPStack> scope — mint a new one.
- Subscription lacks features.mcp_access_enabled — requires Professional+.
Updating or removing the entry.
claude mcp remove apilayer claude mcp add --transport http --header "Authorization: Bearer $NEW_TOKEN" \ apilayer https://mcp.apilayer.com/mcp |
Tool Catalog
| Tool | Description |
|---|---|
| ipstack_lookup | Geolocation + security for a single IP. |
| ipstack_check | Geolocation + security for the caller's own IP. |
| ipstack_bulk_lookup | Geolocation + security for a comma-separated list of IPs. |