MCP Integration Guide 2026

Give AI Agents IP Intelligence with MCP

The IP-Info.app MCP server exposes geolocation and ASN lookups as tools your AI agents can call directly. No SDK, no glue code — one Streamable HTTP endpoint, standard JSON-RPC, and the same trusted data as the REST API.

2
Agent tools
ip_get_details + account_whoami
1
Credit per tool call
Billed like the REST API
$0
account_whoami
Free identity and balance probe
HTTP
Streamable transport
POST JSON-RPC 2.0

The Model Context Protocol (MCP) is an open standard that lets AI assistants and autonomous agents discover and call external tools. Register one server URL, and any MCP-capable client — Claude Code, Claude Desktop, Cursor, VS Code — sees the same IP lookup tools in its next session.

Connect your client

Every client connects with the same three ingredients: the endpoint https://api.ip-info.app/mcp, an x-api-key header, and Streamable HTTP transport (POST JSON-RPC 2.0 with Accept: application/json, text/event-stream). Copy the block for your client and replace YOUR_API_KEY with a key from Account → API keys.

Claude Code

One command registers the server for your CLI sessions:

Terminal
claude mcp add --transport http ip-info https://api.ip-info.app/mcp --header "x-api-key: YOUR_API_KEY"

Claude (claude.ai / Desktop)

Go to Settings → Connectors → Add custom connector (Desktop: Customize → Connectors), then use:

Connector URL
https://api.ip-info.app/mcp

Add a custom header x-api-key: YOUR_API_KEY when the connector form asks for authentication.

Cursor / VS Code

Skip manual config entirely — the interactive reference has an MCP panel that connects the server in one click:

Open /open-api and click the MCP button

The panel pre-fills https://api.ip-info.app/mcp and asks for your x-api-key.

Any MCP client (JSON)

Works in any client that accepts http-type server entries with custom headers:

JSON
{
  "mcpServers": {
    "ip-info": {
      "type": "http",
      "url": "https://api.ip-info.app/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

After registering, run tools/list to confirm the two IP-Info tools are advertised before wiring agent prompts to them.

Create an API key

1

Create an IP-Info account

Sign up free — no credit card required to hold an API key.

2

Open Account → API keys

Name the key for the agent that will use it so usage stays attributable.

3

Copy the key into your client config

Keys are host-scoped to IP-Info.app; keys issued for other products are rejected.

Demo access:

Use the key demo-key with a valid TOTP in the x-ct header for a limited trial of the tools before you sign up.

Raw JSON-RPC Walkthrough

1. Initialize the session

Every session starts with initialize. The result carries the server capabilities and agent instructions — including the auth and billing contract your agent should respect.

curl -X POST 'https://api.ip-info.app/mcp' \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-06-18",
      "capabilities": {},
      "clientInfo": { "name": "curl", "version": "1.0" }
    }
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": { "tools": { "listChanged": false } },
    "serverInfo": { "name": "ip-info", "version": "1.0.0" },
    "instructions": "Authenticate with the x-api-key header. Each tool call costs 1 credit except account_whoami, which is free. HTTP 402 means the account is out of credits."
  }
}

2. Call ip_get_details

Tool calls use the tools/call method. Ask for 8.8.8.8 and the tool returns geolocation plus ASN ownership — country US, ASN 15169, organization Google LLC:

curl -X POST 'https://api.ip-info.app/mcp' \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "ip_get_details",
      "arguments": { "ip": "8.8.8.8" }
    }
  }'
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"ip\":\"8.8.8.8\",\"ptr\":\"dns.google\",\"city\":{\"name\":\"Mountain View\",\"region\":\"California\",\"latitude\":37.4223,\"longitude\":-122.085,\"accuracyRadius\":1000,\"timeZone\":\"America/Los_Angeles\"},\"continentCode\":\"NA\",\"countryName\":\"United States\",\"countryCode\":\"US\",\"registeredCountryCode\":\"US\",\"asn\":15169,\"aso\":\"Google LLC\",\"organization\":\"Google LLC\"}"
      }
    ]
  }
}

Omit the ip argument and the tool resolves the caller's IP — handy when an agent needs its own egress context. An optional provider argument (maxmind or geojs) selects the data source.

Tool Reference

IP-Info.app MCP tools
ToolWhat it returnsArgumentsCost
account_whoamiIdentity probe for the API key: account status and remaining creditsNoneFree
ip_get_detailsGeolocation (city, region, country, timezone) plus ASN and organizationip (optional — defaults to the caller IP), provider (maxmind | geojs)1 credit

Both tools are read-only and idempotent, so agents can safely retry or re-check without side effects.

Billing & Errors

1 credit per tool call

Every successful ip_get_details call costs one credit and appears in your usage reporting like any REST call.

Free: account_whoami never consumes credits. Point agents at it first to check the account before a long run.

HTTP 402 means out of credits

When the account runs dry, calls return 402 PAYMENT_REQUIRED. Teach your agent to stop and surface the top-up link instead of retrying: ip-info.app/pricing.

Built-in contract: the initialize result carries agent instructions that spell out auth and billing, so well-behaved clients learn the rules on connect. A 401 means the key is missing, invalid, or issued for another product — never retry it blindly.

Discovery Surfaces for Agents and Clients

/llms.txt

Plain-text summary of the product, MCP endpoint, tools, and billing for LLM clients.

/.well-known/mcp/server-card.json

Machine-readable MCP server card other clients read to learn what this server offers.

/open-api

Interactive Scalar reference with an MCP panel that connects in one click.

Open /open-api

Frequently Asked Questions

Do I need to run my own MCP server?

No. The IP-Info.app MCP server is hosted at https://api.ip-info.app/mcp. You only register the URL and your API key in an MCP client.

Which MCP clients are supported?

Any client that speaks Streamable HTTP transport: Claude Code, Claude Desktop, Cursor, VS Code assistants, agent frameworks, and CLIs that accept an "http"-type server entry with custom headers.

Can I try it without an account?

Yes. The demo-key key with a valid TOTP in the x-ct header grants limited trial access to the tools.

How do agents learn the billing rules?

The initialize result includes agent instructions describing the API key requirement, the 1-credit cost per tool call, the free account_whoami probe, and the 402 out-of-credits signal.

Connect Your First Agent Today

Create an API key, paste one JSON config, and your agent can resolve any IP address.

1 credit per tool call · account_whoami is free