MCP and AI agents
Connect an AI agent to the MCP server, or point it at the OpenAPI spec and the Markdown guides.
The MCP server gives an agent the same five lookups as tools, with the same key, limits and data as the REST API.
- URL:
https://api.ipalmanac.com/mcp - Transport: Streamable HTTP, with JSON responses
- Authentication: the
Authorization: Bearer <your API key>header
Connect
With Claude Code, add it from the command line:
claude mcp add --transport http ip-almanac https://api.ipalmanac.com/mcp \
--header "Authorization: Bearer $IPALMANAC_API_KEY"Or put it in a project's .mcp.json:
{
"mcpServers": {
"ip-almanac": {
"type": "http",
"url": "https://api.ipalmanac.com/mcp",
"headers": { "Authorization": "Bearer <your API key>" }
}
}
}Other clients take the same two settings, the URL and the Authorization header, in their own config format. Run the
client on your machine or server: the server refuses requests from web pages other than the console.
Tools
| Tool | Same as |
|---|---|
lookup_ip | GET /v1/ip/{ip} |
ip_domains | GET /v1/ip/{ip}/domains |
domain_history | GET /v1/domain/{domain}/history |
domain_hosting | GET /v1/domain/{domain}/hosting |
lookup_asn | GET /v1/asn/{asn} |
Each tool returns the same JSON as its endpoint, as structured content and as text. Listing the tools needs no key. Calling one checks the key and counts against the same rate and quota as the REST API (see Rate limits and quotas).
A refused call comes back as a tool error whose text carries the error code after the tool name:
Error executing tool lookup_ip: invalid_ip: Expected an IPv4 or IPv6 address. No request was counted.Help an agent read the data
The data is easy to misread: null is unknown rather than false, and an empty list means not observed rather than
absent. Give your agent the reading rules along with the tools:
https://api.ipalmanac.com/llms-full.txt: the API's own guide for agents, covering every tool and how to read its results./llms-full.txton this site: all of these docs as one Markdown file./llms.txtis the index, and every page's Copy Markdown button copies that page.https://api.ipalmanac.com/v1/openapi.json: the OpenAPI spec, for agents and code generators that call the REST API.