Architecture
IPIPAI is built as a three-layer system. AI agents never talk to the database or external feeds directly — they speak MCP. The MCP Server translates tool calls into internal HTTP requests against the REST API, which in turn queries databases, MMDB files, and third-party services. This keeps a clean boundary between what AI models see (tools) and what programmers call (HTTP endpoints).
Two Access Modes
The same intelligence is exposed through two distinct interfaces, optimized for two distinct audiences. Pick the one that matches your use case.
For AI Models — MCP Protocol
Audience: ChatGPT, Claude, Gemini, Cursor, and any MCP client.
- Endpoint:
POST https://ipipai.com/mcp - Wire format: JSON-RPC 2.0
- Transport: Streamable HTTP
- Discovery:
tools/listreturns all tool schemas - Invocation:
tools/callwithname+arguments - The AI decides which tool to use and with what arguments
- No API key for basic queries
For Programmers — REST API
Audience: developers writing scripts, backends, dashboards.
- Endpoints:
/api/v2/*and/api/* - Wire format: plain HTTP (GET / POST) + JSON
- You choose the exact URL and parameters
- Easy to
curl, cache, and integrate - Free tier: 60 req/min, no key; 120 req/min with API key
- See the REST API Reference below
Connecting to the MCP Server
The MCP Server is a single endpoint that speaks the Model Context Protocol over Streamable HTTP. Every request is an independent JSON-RPC 2.0 message.
Client Configuration
Configure your MCP client (Claude Desktop, Cursor, etc.) to point at the IPIPAI server. The snippet below is the standard Streamable HTTP transport entry used by most MCP clients.
{
"mcpServers": {
"ipipai": {
"url": "https://ipipai.com/mcp",
"transport": "streamable-http"
}
}
}
For Any AI Model: Universal Access
No matter what LLM runtime or agent framework you use, there are three equivalent ways to
reach the same 11 tools. No API key, no registration, 60 requests/minute. The
secured endpoint mcp.ipipai.com/mcp exposes 16 tools and requires a Bearer
token (not yet available publicly — see below).
1) MCP-native clients (Claude / Cursor / any MCP agent)
Register IPIPAI as a remote server. If your client supports remote Streamable HTTP servers,
point it straight at https://ipipai.com/mcp. If it only accepts stdio servers,
wrap the endpoint with Anthropic's official inspector:
{
"mcpServers": {
"ipipai": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/inspector@latest", "ipipai", "--url", "https://ipipai.com/mcp"],
"transport": "stdio"
}
}
}
2) Plain HTTP from any script / agent
One curl is enough to speak MCP over Streamable HTTP. This works for custom
agents, cron jobs, or code executed by any model:
# Discover all tools
curl -sS -N https://ipipai.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# Call lookup_ip
curl -sS -N https://ipipai.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"lookup_ip","arguments":{"ip":"8.8.8.8"}}}'
3) fetch / requests in any language
A model that can run code only needs an HTTP POST; no MCP library required:
import requests
resp = requests.post("https://ipipai.com/mcp", json={
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "lookup_ip", "arguments": {"ip": "8.8.8.8"}}
}, headers={"Accept": "application/json, text/event-stream"})
print(resp.json()["result"]["structuredContent"]["ipai_score"]) # e.g. 96
Minimal Handshake (cURL)
A raw initialize request to verify connectivity:
curl -X POST https://ipipai.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl-test","version":"1.0"}}}'
MCP Protocol Interaction
A complete conversation follows three JSON-RPC steps: initialize the session, list available tools, then call a tool. The examples below show the exact request/response payloads.
The client announces its protocol version and capabilities. The server responds with its own version, capabilities, and identity. This must be the first message.
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": {
"name": "example-client",
"version": "1.0"
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-06-18",
"capabilities": {
"tools": {
"listChanged": false
}
},
"serverInfo": {
"name": "IPIPAI MCP Server",
"version": "2.0.0"
}
}
}
Discover every tool the server exposes. Each tool carries a human-readable description
and a JSON Schema inputSchema that the AI uses to build valid arguments.
(Shown abbreviated — the open endpoint returns all 11 tools; the secured endpoint returns all 16.)
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"name": "lookup_ip",
"description": "Full IP intelligence query: geolocation, ISP, ASN, IP type, and risk scoring.",
"inputSchema": {
"type": "object",
"properties": {
"ip": { "type": "string", "description": "The IP address to query (IPv4 or IPv6)" },
"check_services": { "type": "boolean", "description": "Also check AI/streaming service access" },
"lang": { "type": "string", "description": "Response language, e.g. 'en' or 'zh'" }
},
"required": ["ip"]
}
},
{
"name": "check_ip_reputation",
"description": "IP reputation check: proxy, Tor, and blacklist detection.",
"inputSchema": {
"type": "object",
"properties": {
"ip": { "type": "string", "description": "The IP address to check" }
},
"required": ["ip"]
}
}
]
}
}
When a user asks "query 8.8.8.8", the AI selects the lookup_ip tool
and supplies the ip argument. The server returns the result both as text
content (for the model to read) and as structured content (for programmatic use).
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "lookup_ip",
"arguments": {
"ip": "8.8.8.8"
}
}
}
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "{\"ipai_score\":92,\"grade\":\"A+\",\"identity\":{\"ip\":\"8.8.8.8\",\"type\":\"datacenter\",\"asn\":\"AS15169 Google LLC\",\"country\":\"United States\"}}"
}
],
"structuredContent": {
"ipai_score": 92,
"grade": "A+",
"identity": {
"ip": "8.8.8.8",
"ip_numeric": "134744072",
"type": "datacenter",
"type_label": "Datacenter",
"asn": "AS15169 Google LLC",
"asn_number": "15169",
"asn_org": "Google LLC",
"country": "United States",
"country_zh": "美国",
"country_code": "US",
"country_flag": "🇺🇸",
"region": "California",
"region_zh": "加利福尼亚州",
"city": "Mountain View",
"location": "United States, California, Mountain View",
"location_zh": "美国加利福尼亚州山景城",
"lat": 37.4227,
"lon": -122.0842,
"coordinates": "37.4227, -122.0842",
"timezone": "America/Los_Angeles",
"isp": "Google LLC",
"org": "Google LLC",
"category": "Datacenter",
"ip_version": "IPv4",
"native": true,
"broadcast": false
},
"risk": {
"score": 85,
"level": "Very Safe",
"proxy": false,
"tor": false,
"hosting": true,
"mobile": false,
"cdn": false,
"factors": [
{ "type": "hosting", "dim": "ipType", "level": "low", "zh": "数据中心IP", "en": "Datacenter IP" }
]
},
"score_dimensions": {
"purity": 12,
"ai_availability": 88,
"network_quality": 20,
"stability": 12,
"security": 90
},
"recommendation": "Excellent — ideal for AI and streaming use",
"official": "https://ipipai.com",
"report_url": "https://ipipai.com/ip/8.8.8.8"
},
"isError": false
}
}
isError: true and a descriptive message in the content field rather
than an HTTP error, so the AI can reason about the failure and retry.
Complete Tool List
The open endpoint ipipai.com/mcp exposes 11 tools covering IP
intelligence, reputation, service access, node rating, and network diagnostics; the
secured endpoint mcp.ipipai.com/mcp exposes 16 tools (adds
streaming / BGP / LLM detection). The table below lists the 11-tool open set, its
description, and which parameters are required.
| # | Tool Name | Description | Parameters (required marked) |
|---|---|---|---|
| 1 | lookup_ip | Full IP intelligence query — geolocation, ISP, ASN, IP type, and risk scoring. |
iprequiredcheck_servicesoptionallangoptional
|
| 2 | check_ip_reputation | IP reputation check — proxy, Tor, and blacklist detection. | iprequired |
| 3 | check_service_access | Service accessibility check (ChatGPT, Netflix, etc.) from an IP's location. |
iprequiredservicerequired
|
| 4 | rate_ip_node | Comprehensive IP node rating — 0-100 score, A+ to D grade. | iprequired |
| 5 | lookup_ip_location | Fast IP geolocation via OpenIPAPI. | iprequired |
| 6 | resolve_dns | DNS resolution for a domain. | domainrequired |
| 7 | ping_host | Ping test against a target host. |
targetrequiredcountoptional
|
| 8 | trace_route | Traceroute to a target host. |
targetrequiredmax_hopsoptional
|
| 9 | lookup_domain_whois | WHOIS query for a domain or IP. | queryrequired |
| 10 | lookup_mac_vendor | MAC address vendor lookup. | macrequired |
| 11 | check_website_availability | Website availability check. | No parameters |
REST API Reference (for Programmers)
Prefer plain HTTP? Each MCP tool maps to a REST endpoint you can call directly with
curl, fetch, or requests. The table below shows the
mapping. The REST API is the same layer the MCP Server calls internally.
| MCP Tool | Method | REST Endpoint |
|---|---|---|
| lookup_ip | POST | /api/v2/analyze |
| check_ip_reputation | GET | /api/v2/reputation/:ip |
| check_service_access | GET | /api/v2/access/:ip/:service |
| rate_ip_node | POST | /api/v2/rate |
| lookup_ip_location | GET | /api/detect/{ip} |
| resolve_dns | GET | /api/dns-resolve?domain= |
| ping_host | POST | /api/ping |
| trace_route | POST | /api/trace |
| lookup_domain_whois | GET | /api/whois/:query |
| lookup_mac_vendor | GET | /api/mac-lookup/:mac |
| check_website_availability | GET | /api/availability-check |
Quick Examples
curl -X POST https://ipipai.com/api/v2/analyze \
-H "Content-Type: application/json" \
-d '{"ip":"8.8.8.8","check_services":true}'
import requests
# Full IP intelligence
r = requests.post("https://ipipai.com/api/v2/analyze", json={"ip": "8.8.8.8"})
data = r.json()
print(f"Score: {data['ipai_score']}/100 ({data['grade']})")
# Reputation check
r = requests.get("https://ipipai.com/api/v2/reputation/8.8.8.8")
print(r.json()["reputation"]["verdict"])
const res = await fetch("https://ipipai.com/api/v2/analyze", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ ip: "8.8.8.8", check_services: true })
});
const data = await res.json();
console.log(`IPIPAI Score: ${data.ipai_score}`);
OpenIPAPI — Third-Party IP Geolocation Source
IPIPAI integrates OpenIPAPI as a supplementary, open IP geolocation data
source. It powers the lookup_ip_location MCP tool and is merged with local
GeoLite2 (MMDB) databases to produce unified geolocation results. The project is open source
on GitHub and requires no API key.
curl "https://openipapi.cloudshield.club/api?ip=1.1.1.1"
{
"ip": "1.1.1.1",
"country": "United States",
"city": "Buffalo, NY"
}
lookup_ip_location tool (MCP) or the unified /api/v2/analyze
endpoint (REST) and all data sources are queried automatically behind the scenes.
Rate Limits & Policies
| Interface | Free (no key) | With API key |
|---|---|---|
MCP POST /mcp |
60 req/min | 60 req/min |
REST /api/* |
60 req/min | 120 req/min |
Policies
- All endpoints are read-only — IPIPAI never modifies your network.
- Query content is not permanently logged.
- IP detection data is cached for 24 hours.
- If you receive HTTP
429(or a JSON-RPC error), wait 60 seconds and retry. - For higher volume, contact the admin for an API key.
Related Resources
Agent Instructions
How AI agents should interact with IPIPAI.
LLMs.txt
Feature overview for AI crawlers.
IPIPAI Home
Web interface with all interactive tools.
IP Detection Report
See the same lookup_ip intelligence rendered in your browser — try it on any address by replacing the sample IP.
API Documentation
Low-level individual tool API reference.
Complete Technical Documentation
Full technical reference: MCP server, REST API, SDK, all tools, and 78 articles. 技术文档: 中文版