# Cursor IDE Integration

Cursor supports remote MCP servers over Streamable HTTP natively. No bridge package is required — Cursor connects directly to **https://mcp.apilayer.com/mcp.**

## **4.1 Prerequisites**

-   Cursor with MCP support (Settings → MCP must be visible).
-   A MCP Bearer token on a subscription with mcp\_access\_enabled

## **4.2 Locate mcp.json**

If the file does not exist, create it.

| **Scope** | **Path** |
| --- | --- |
| Global | ~/.cursor/mcp.json |
| Project | <repo>/.cursor/mcp.json (overrides global within that workspace) |

## **4.3 Configure the server**

**Step 1: Open Cursor Settings**

Launch Cursor, then go to: File > Preferences > Cursor Settings  (or press Cmd+Shift+J on macOS / Ctrl+Shift+J on Windows).

**Step 2: Navigate to the MCP section**

In the left sidebar of the Settings panel, scroll to the MCP section and click on it. You will see a list of configured MCP servers (empty if none are set up yet).

**Step 3: Configure the Server**

**MCP Bearer token**

<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;"url": "https://mcp.apilayer.com/mcp",</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"headers": {</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Authorization": "Bearer ${env:APILAYER_MCP_TOKEN}"</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>

Export the token in the shell that launches Cursor:

<table><colgroup><col></colgroup><tbody><tr><td><span>export APILAYER_MCP_TOKEN="your-token"</span></td></tr></tbody></table>

If ${env:…} substitution isn't supported by your Cursor version, paste the token literally — but keep ~/.cursor/mcp.json out of source control if you do.

Then supply apiKey whenever Cursor asks to run a tool:

<table><colgroup><col></colgroup><tbody><tr><td><span>{ "ip": "8.8.8.8", "apiKey": "your-apilayer-access-key" }</span></td></tr></tbody></table>

**Step 4: Restart Cursor**

Fully close and reopen Cursor for the MCP server to be registered.

**Step 5: Enable in Composer**

Open Settings → MCP. The apilayer entry should show a green dot and list the three ipstack\_\* tools.

## **4.4 Using IPstack Tools in Cursor**

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

<table><colgroup><col></colgroup><tbody><tr><td><p><strong>💡 Tip</strong></p><p><span>In Cursor Agent mode, the AI can chain multiple tool calls automatically. For example, asking 'Get the location of this IP and then fetch the current timezone there' will call ipstack_lookup without any manual intervention.</span></p></td></tr></tbody></table>

## **4.5 Troubleshooting**

**Server is red / "failed to connect".**

-   Cursor logs are at: macOS **~/Library/Logs/Cursor/**, Windows **%APPDATA%\\Cursor\\logs\\**, Linux **~/.config/Cursor/logs/**. Look for entries tagged **mcp**.
-   Verify the URL is exactly **https://mcp.apilayer.com/mcp**. The bare host returns 404.
-   Confirm reachability:

<table><colgroup><col></colgroup><tbody><tr><td><p><span>curl -i -H "Authorization: Bearer $APILAYER_MCP_TOKEN" \</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-H "Accept: application/json, text/event-stream" \</span></p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;https://mcp.apilayer.com/mcp</span></p></td></tr></tbody></table>

**The tools list is empty even though the server is green**. The subscription gate (**features.mcp\_access\_enabled**) may be denying the **tools/list** enumeration silently. Check that the subscription is Professional or higher.

**Rate limit exceeded**. Inspect the JSON **\_meta** returned with the error for **X-Rate-Limit-Limit** and **retryAfter**. Per-second + monthly quotas are enforced server-side.

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