MCP Server

Give AI assistants access to NetLoc8 IP geolocation via the Model Context Protocol.

Overview

The NetLoc8 MCP server lets AI assistants (Claude Code, Claude Desktop, Cursor, VS Code Copilot, and others) perform IP geolocation lookups, manage API keys, and access account data — all through natural conversation.

The server works with or without an API key. Without a key, you get country-level geo data and local utility tools. With a free key, you unlock city-level detail, coordinates, timezone, and account management.

Installation

Bash
go install github.com/netloc8/netloc8-mcp@latest

Prerequisites

Requires Go 1.26+. The binary installs to $GOPATH/bin (or $HOME/go/bin).

Configuration

Add the server to your AI client's MCP configuration. Replace sk_live_YOUR_KEY with your API key, or remove the env block to run in unauthenticated mode.

Claude Code

One-liner:

Bash
claude mcp add --env NETLOC8_API_KEY=sk_live_YOUR_KEY netloc8 -- netloc8-mcp

Or add to .mcp.json in your project root (committable):

JSON
{
  "mcpServers": {
    "netloc8": {
      "command": "netloc8-mcp",
      "env": {
        "NETLOC8_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

JSON
{
  "mcpServers": {
    "netloc8": {
      "command": "netloc8-mcp",
      "env": {
        "NETLOC8_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project root:

JSON
{
  "mcpServers": {
    "netloc8": {
      "command": "netloc8-mcp",
      "env": {
        "NETLOC8_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json in your project root:

JSON
{
  "servers": {
    "netloc8": {
      "command": "netloc8-mcp",
      "env": {
        "NETLOC8_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

OpenAI Codex

One-liner:

Bash
codex mcp add --env NETLOC8_API_KEY=sk_live_YOUR_KEY netloc8 -- netloc8-mcp

Or add to ~/.codex/config.toml (global) or .codex/config.toml (project):

toml
[mcp_servers.netloc8]
command = "netloc8-mcp"
env = { NETLOC8_API_KEY = "sk_live_YOUR_KEY" }

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

JSON
{
  "mcpServers": {
    "netloc8": {
      "command": "netloc8-mcp",
      "env": {
        "NETLOC8_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

Antigravity

Add to ~/.gemini/config/mcp_config.json:

JSON
{
  "mcpServers": {
    "netloc8": {
      "command": "netloc8-mcp",
      "env": {
        "NETLOC8_API_KEY": "sk_live_YOUR_KEY"
      }
    }
  }
}

Environment Variables

VariableRequiredDescription
NETLOC8_API_KEYNoYour NetLoc8 API key. Enables city-level data and account management.
NETLOC8_API_URLNoOverride the API base URL (default: https://api.netloc8.com).

Available Tools

Geo Lookup

Work with or without an API key. Unauthenticated mode returns country-level data only.

ToolDescription
geolocate_ipLook up geolocation for any IPv4/IPv6 address
geolocate_meLook up geolocation for the server's own IP
get_timezoneGet IANA timezone for an IP address
validate_ipCheck if a string is a valid IP address

Local Utilities

Run locally with no API call and no quota usage.

ToolDescription
is_public_ipCheck if an IP is publicly routable
normalize_ipClean up IP strings (brackets, ::ffff: prefix, whitespace)
get_subnetDerive /24 CIDR prefix from an IPv4 address

Account Management

Require an API key. Not registered in unauthenticated mode.

ToolDescription
list_api_keysList all API keys on your account
get_usageGet request counts and plan limits
get_profileGet account profile (name, email)
get_audit_logView account activity log
create_api_keyCreate a new API key
delete_api_keyRevoke an API key (irreversible)
renew_api_keyExtend an API key's expiration

What You Get

FeatureNo API KeyFree KeyPaid Key
Country-level geo
City, coordinates, timezone
Local utility tools
Account management
Monthly requests5,00025,000+

Get a free API key

Sign up at netloc8.com — no credit card required. Your free plan includes 5,000 requests/month.