Claude Desktop supports MCP natively. Once configured, you can ask Claude questions like "What country is the IP 8.8.8.8 from?" and it will automatically call the ipstack_lookup tool to answer.
Prerequisites
- Claude Desktop installed (macOS, Windows, or Linux).
- Node.js 20+ with `npx` on `PATH`. Verify with `node -v` and `npx -v`.
- MCP Token (a product subscription that has `mcp_access_enabled`
Install mcp-remote
Claude Desktop launches MCP servers over stdio. The APILayer MCP adapter is hosted as a Streamable HTTP server, so the configuration below uses the `mcp-remote` npm package as a stdio↔HTTP bridge. No local installation step is required — `npx` fetches the bridge on first launch.
Configure claude_desktop_config.json
Claude Desktop reads its MCP server list from a JSON configuration file. You need to add an IPstack entry to this file.
Step 1: Locate the configuration file
The file location depends on your operating system:
| Operating System | File Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Step 2: Configure the MCP server
MCP Bearer token
Use this when you have minted an OAuth-style MCP token from the APILayer portal. The bridge attaches `Authorization: Bearer <APILAYER_MCP_TOKEN>` to every request, so no secret is stored in the tool arguments.
{ "mcpServers": { "apilayer": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.apilayer.com/mcp", "--header", "Authorization: Bearer ${APILAYER_MCP_TOKEN}" ], "env": { "APILAYER_MCP_TOKEN": "paste-your-token-here" } } } } |
⚠️ Important The token is scoped to a single APILayer product (e.g. `portal:ipstack`); mint a separate token per product you want to expose. |
Step 3: Verify the connection
- Quit Claude Desktop fully (menu → Quit, not just close window).
- Relaunch. The hammer / plug icon at the bottom of the input box should now
- list apilayer as a connected MCP server.
The full tool catalog currently exposed:
| 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. |
Test the Integration
Try the following prompts to confirm the integration is working:
- Use the ipstack tool to look up 8.8.8.8
- “Get location details for {IP_ADDRESS}.” (uses ipstack_lookup)
- “What region does IP {IP_ADDRESS} belong to?”
✅ Success Indicator If the integration is working, Claude will show a small tool-call indicator above its response, showing which IPstack tool it used. The response will include structured data from the API.
You should see a tool call to `ipstack_lookup` and a JSON response containing `country`, `city`, `latitude`, `longitude`, etc. |
Troubleshooting
The server doesn't appear in Claude Desktop.
Open the Claude Desktop logs:
- macOS: `~/Library/Logs/Claude/mcp*.log`
- Windows: `%APPDATA%\Claude\Logs\mcp*.log`
- Linux: `~/.config/Claude/logs/mcp*.log`
The `mcp-server-apilayer.log` file shows stdio stderr from `mcp-remote`. The most common causes:
- `npx` not on `PATH` → set `command` to the absolute path (`which npx`).
- Corporate proxy blocking `npmjs.org` → pre-install with
- `npm i -g mcp-remote` and replace `"command": "npx"` with
- `"command": "mcp-remote"` (drop the `-y` and `mcp-remote` from `args`).
Tools list is empty / “initialize” errors - Check that the URL is exactly `https://mcp.apilayer.com/mcp` (with the `/mcp` path). The bare host serves a 404.
“Not authorized” on every tool call - The Bearer token is missing the right scope. Mint a new token from the portal that includes `mcp:read` plus the `portal:<product>` scope for the tool you're calling.
“Rate limit exceeded” immediately - The per-second and monthly limits are enforced server-side. Inspect the response _meta block (visible in Claude Desktop's MCP inspector) for X-Rate-Limit-Limit / X-Quota-Remaining.