# Claude Desktop Integration

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.

<table><colgroup><col></colgroup><tbody><tr><td><p><span>{</span></p><p><span>&nbsp;&nbsp;"mcpServers": {</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;"apilayer": {</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"command": "npx",</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"args": [</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"-y",</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"mcp-remote",</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"https://mcp.apilayer.com/mcp",</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"--header",</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Authorization: Bearer ${APILAYER_MCP_TOKEN}"</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"env": {</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"APILAYER_MCP_TOKEN": "paste-your-token-here"</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;}</span></p><p><span>&nbsp;&nbsp;}</span></p><p><span>}</span></p></td></tr></tbody></table>

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>⚠️ Important</strong></p><p><span>The token is scoped to a single APILayer product (e.g. `</span><strong>portal:ipstack</strong><span>`); mint a separate token per product you want to expose.</span></p></td></tr></tbody></table>

**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?”

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>✅ Success Indicator</strong></p><p><span>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.</span></p><p>&nbsp;</p><p><span>You should see a tool call to `</span><strong>ipstack_lookup</strong><span>` and a JSON response containing&nbsp; </span><strong>`country`, `city`, `latitude`, `longitude`,</strong><span> etc.</span></p></td></tr></tbody></table>

## **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.
