Get the FREE Ultimate OpenClaw Setup Guide →

aiwen -geoip

埃文IP定位MCP

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ipfred-aiwen-mcp-server-geoip npx -y aiwen-mcp-server-geoip \
  --env AIWEN_API_KEY="xxxxxx" \
  --env IPV4_ACCURACY="city" \
  --env IPV6_ACCURACY="city"

How to use

This MCP server provides a suite of IP geolocation and related intelligence endpoints powered by Aiwen IP Location data. The server exposes capabilities such as IP location lookup (city/district/street precision), current network IP retrieval with location, IP usage scene classification, WHOIS and AS information, host attributes, risk portrait, identity checks, and IPv4 industry classification. When deployed via MCP, you can query these endpoints by supplying an IP address (where required) and receiving structured results including continent, country, city, district, street address, latitude/longitude, organization, ISP, ASN, and more. To run it in your MCP host, configure the aiwen-iplocation server in your mcp host file using npx and provide the required environment variables to tailor precision and authentication.

Use cases include enriching traffic with precise geolocation for access control, fraud prevention, content localization, network analytics, and risk assessment. The environment variables let you control the IPv4/IPv6 precision levels (city, district, street) to match the API plan you’ve purchased, ensuring responses align with your desired granularity.

How to install

Prerequisites:

  • Node.js and npm installed on the host
  • Internet access to install npm packages
  • An Aiwen API key (AIWEN_API_KEY) and awareness of the IPv4/IPv6 precision you intend to use

Step-by-step installation:

  1. Verify prerequisites

    • node -v
    • npm -v
  2. Prepare environment variables (replace placeholders with your actual values)

    • AIWEN_API_KEY=your_api_key_here
    • IPV4_ACCURACY=city # or district / street
    • IPV6_ACCURACY=city # or district / street
  3. Run the MCP server locally (example using npx directly)

    • On first run: AIWEN_API_KEY=your_api_key_here IPV4_ACCURACY=city IPV6_ACCURACY=city npx -y aiwen-mcp-server-geoip
  4. Integrate with MCP host configuration

    • Add the aiwen-iplocation server to your MCP host JSON as shown in the mcp_config example.
    • Use your host's environment to inject the AIWEN_API_KEY and precision settings as needed.
  5. Verify operation

    • Ensure the host can resolve and start the aiwen-iplocation MCP server and that queries return the expected fields (location, ISP, ASN, etc.).

Additional notes

Tips and notes:

  • The server relies on the Aiwen API; ensure your API key is active and has the required permissions for geolocation and related data.
  • IPV4_ACCURACY and IPV6_ACCURACY control the maximum precision returned for respective IP versions; set these to city, district, or street according to your plan.
  • In MCP deployments, environment variables are typically injected via the mcpServers.env block; keep secrets secure and avoid committing actual keys in public repos.
  • If you encounter rate limiting or authentication errors, verify the API key scope, usage quotas, and network access to Aiwen endpoints.
  • The mcp_config structure expects a single server name under mcpServers; you can extend with additional Aiwen endpoints if supported by the underlying MCP package.

Related MCP Servers

Sponsor this space

Reach thousands of developers