NetworksDB MCP Server
BetaBring NetworksDB IP intelligence into your AI agent. Look up IP addresses, discover company networks, explore domain associations and investigate autonomous systems by asking questions in plain English.
The Model Context Protocol (MCP) connects your AI agent to external tools. Once connected, your agent can choose the right NetworksDB lookups, combine their results and explain what it found. This is useful for network research, incident investigation, infrastructure analysis and enriching lists of IP addresses.
Connection details
Server URL
https://networksdb.io/mcp
Transport: Streamable HTTP. Authentication: your existing NetworksDB API key, sent in one of these headers:
X-Api-Key: YOUR_NETWORKSDB_API_KEY # Alternatively: Authorization: Bearer YOUR_NETWORKSDB_API_KEY
Set up your AI agent
The examples below read your key from an environment variable named NETWORKSDB_API_KEY. Set it in the environment that launches your AI client, then restart the client. For a remote workspace, set it on the host running the agent.
1. Configure your environment variable
Windows
Save the key as a user environment variable so it is available across sessions:
- Open Start and search for Edit environment variables for your account.
- Under User variables, choose New. Set the name to NETWORKSDB_API_KEY and the value to your NetworksDB API key.
- Save the change and fully restart your terminal and AI client. If an app still cannot see the variable, sign out of Windows and sign back in.
Alternatively, use PowerShell 7.1 or newer
This masks the key while you type, sets it for the current PowerShell session and saves it for your Windows user:
$env:NETWORKSDB_API_KEY = Read-Host "NetworksDB API key" -MaskInput
[Environment]::SetEnvironmentVariable(
"NETWORKSDB_API_KEY", $env:NETWORKSDB_API_KEY, "User"
)
Launch your command-line agent from this PowerShell window, or restart your desktop client after saving the variable.
macOS
Open Terminal. In the default zsh shell, run these commands to enter your key without displaying it:
read -rs 'NETWORKSDB_API_KEY?NetworksDB API key: ' export NETWORKSDB_API_KEY printf '\n'
Launch your agent from this same Terminal window. Fully quit an existing desktop client first, then launch it from Terminal using its command-line launcher, such as code . or cursor . if installed. The variable lasts for this shell session.
Keep the variable for future Terminal sessions
Add this line to ~/.zshrc in a text editor, replacing the placeholder with your key:
export NETWORKSDB_API_KEY='YOUR_NETWORKSDB_API_KEY'
Save the file and open a new Terminal window, or run source ~/.zshrc. This stores your key in that file; keep it private. Apps opened from the Dock do not automatically inherit Terminal variables, so launch the client from your configured Terminal.
Linux
Open a Bash terminal and run these commands. The prompt hides your key and keeps its value out of command history:
read -rsp "NetworksDB API key: " NETWORKSDB_API_KEY export NETWORKSDB_API_KEY printf '\n'
Launch your agent from this same terminal. Fully quit an existing desktop client first, then use its command-line launcher, such as code . or cursor . if installed. The variable lasts for this shell session.
Keep the variable for future Bash sessions
Add this line to ~/.bashrc in a text editor, replacing the placeholder with your key:
export NETWORKSDB_API_KEY='YOUR_NETWORKSDB_API_KEY'
Save the file and open a new Bash terminal, or run source ~/.bashrc. This stores your key in that file; keep it private. Desktop launchers may not read ~/.bashrc, so launch your client from the configured terminal. For zsh, use the macOS tab’s zsh commands and ~/.zshrc instead.
2. Configure your AI client
Choose your client below. When editing an existing configuration, merge the NetworksDB entry with your other servers.
Codex
After setting your environment variable, add the server with the Codex CLI:
codex mcp add networksdb \ --url https://networksdb.io/mcp \ --bearer-token-env-var NETWORKSDB_API_KEY codex mcp list
Restart Codex and ask it to use NetworksDB. The CLI and IDE extension share MCP configuration; make sure the environment variable is available to the one you use. Official Codex MCP guide.
Claude Code
Add this configuration to .mcp.json in your project directory. Claude Code expands the environment-variable reference when it connects:
{
"mcpServers": {
"networksdb": {
"type": "http",
"url": "https://networksdb.io/mcp",
"headers": {
"X-Api-Key": "${NETWORKSDB_API_KEY}"
}
}
}
}
Start Claude Code from that project, approve the project MCP server if prompted, and use /mcp to check the connection. Official Claude Code MCP guide.
VS Code / GitHub Copilot
For the Copilot harness, add this portable .mcp.json configuration at the root of your workspace. Ensure NETWORKSDB_API_KEY is available to VS Code or the remote host running the session.
{
"mcpServers": {
"networksdb": {
"type": "http",
"url": "https://networksdb.io/mcp",
"headers": {
"X-Api-Key": "${NETWORKSDB_API_KEY}"
}
}
}
}
Reopen the workspace, enable NetworksDB in the agent’s MCP tools, and try one of the example prompts below. Portable configuration uses mcpServers; VS Code’s separate .vscode/mcp.json format uses servers, so the files are not interchangeable. Official VS Code MCP configuration guide.
Cursor
Add the following to your personal ~/.cursor/mcp.json, or merge it into your existing configuration. Cursor uses the ${env:NAME} syntax for environment variables:
{
"mcpServers": {
"networksdb": {
"url": "https://networksdb.io/mcp",
"headers": {
"X-Api-Key": "${env:NETWORKSDB_API_KEY}"
}
}
}
}
Restart Cursor with the environment variable available, enable the NetworksDB server in MCP settings, and use it from Agent. Official Cursor MCP guide.
OpenCode
For OpenCode v1, add this to your project’s opencode.json. OpenCode uses {env:NAME} for environment variables. OAuth is disabled here because NetworksDB authenticates with your API key.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"networksdb": {
"type": "remote",
"url": "https://networksdb.io/mcp",
"enabled": true,
"oauth": false,
"headers": {
"X-Api-Key": "{env:NETWORKSDB_API_KEY}"
}
}
}
}
OpenCode v2 configuration
OpenCode v2 places server entries under mcp.servers and connects automatically. Use this version of opencode.json instead:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"networksdb": {
"type": "remote",
"url": "https://networksdb.io/mcp",
"oauth": false,
"headers": {
"X-Api-Key": "{env:NETWORKSDB_API_KEY}"
}
}
}
}
}
Start OpenCode with NETWORKSDB_API_KEY available, then check the connection:
opencode mcp list
Ask your agent to use NetworksDB once connected. See the official OpenCode v1 MCP guide or OpenCode v2 MCP guide.
Available MCP tools
Your API plan determines which lookups are available. Use the exact tool names below when asking your agent to make a specific lookup.
| Tool | Required input | What it returns |
|---|---|---|
| lookup_ip | IP address | Recorded organisation, network, ASN and domain count for an IPv4 or IPv6 address. |
| geolocate_ip | IP address | Approximate country, region, city and coordinates, when available. |
| search_organisations | Search term | Matching organisations and their identifiers, with an optional country filter. |
| get_organisation | Organisation ID | Details about an organisation identified by a search result. |
| get_organisation_networks | Organisation ID | Recorded IPv4 or IPv6 networks associated with an organisation. |
| get_ip_domains | IP address | Domains recorded on an IP address. This is a reverse-IP lookup, not a DNS PTR lookup. |
| get_domain_ips | Domain name | Recorded IP addresses for a domain; the API may resolve DNS if none are recorded. |
| get_asn | Numeric ASN | Autonomous system details, organisation and network counts. |
| get_asn_networks | Numeric ASN | IPv4 or IPv6 networks associated with an autonomous system. |
| get_network_domains | Network CIDR | Recorded IP/domain pairs within a network, subject to your plan. |
| get_api_usage | None | Your API plan, remaining monthly allowance and reset time. |
Use numeric ASNs such as 15169, and network CIDRs such as 8.8.8.0/24. Search for an organisation before requesting its networks so the agent can select the correct identifier.
Things to ask your AI agent
Once connected, try one of these prompts. Naming NetworksDB helps your agent choose the right tools.
Compare IP addresses
“Use NetworksDB to look up 8.8.8.8 and 1.1.1.1. Compare their recorded organisations, networks and ASNs in a table.”
Explore company networks
“Find Google LLC in NetworksDB and list its first 25 IPv4 and 25 IPv6 networks. Ask me to choose if several organisations match.”
Investigate a domain
“Use NetworksDB to find IP addresses associated with google.com, then look up the organisations behind the first five addresses.”
Look up an autonomous system
“Use NetworksDB to summarise AS15169 and show the first 25 IPv4 networks associated with it.”
Explore domain associations
“Show up to 25 domains recorded on 8.8.8.8 in NetworksDB. Tell me if the results are limited by my plan.”
Check your allowance
“Check my NetworksDB API allowance and reset time before doing any data lookups. Ask before fetching more result pages.”
A single prompt can lead to several tool calls. Ask your agent to keep the scope small, report incomplete results and get your approval before continuing through large result sets.
Plans, query usage and result limits
Each successful data tool call uses one query from your existing API allowance. Discovering tools and checking get_api_usage do not consume data queries. An active API key with remaining allowance is required to connect.
List tools return 25 results by default and accept a limit of up to 300 results per call. Response-size and plan limits can reduce the number returned. Results include continuation arguments when more data can be requested; each continuation is another API query. Free plans are limited to the available first API page.
Recorded associations can change and do not prove current ownership or control. IP geolocation is approximate. The response retrieval time is not the underlying dataset’s update time.
For connection errors, check that your key is active, your allowance remains and your client is sending the authentication header. Refresh the client’s MCP tools after a server update. See API documentation for the underlying data operations, or contact us for help.
|
Domains -
IP to Org -
AS -
Github -
X -
Licensing IP Geolocation by DB-IP |
Rendered in 0.00s |