npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mcpcn/mcp-ip-query

v1.0.6

Published

IP Query MCP Server

Readme

IP Query MCP

这是一个基于 Model Context Protocol (MCP) 的 IP 地址查询服务,提供 IP 地址查询功能。

功能特点

  • 查询当前IP地址:获取当前设备的公共 IP 地址及其地理位置信息。
  • 查询指定IP地址:获取指定 IP 地址的地理位置信息。

环境配置

注意:您需要拥有阿里云 IP 地址查询 API 的密钥才能使用此服务。请将密钥配置为环境变量 ALIYUN_IP_API_KEY

使用方法

{
  "mcpServers": {
    "mcp-server/ip-query": {
      "command": "node",
      "args": [
        "index.js" 
      ],
      "env": {
        "ALIYUN_IP_API_KEY": "您的阿里云IP API密钥"
      },
      "autoApprove": [
        "get_my_ip",
        "get_ip_location"
      ]
    }
  }
}

工具功能

该 MCP 提供以下工具:

  1. 查询当前IP地址 (get_my_ip)

    • 输入:无
    • 输出:当前IP地址及其地理位置信息
  2. 查询指定IP地址 (get_ip_location)

    • 输入:IP 地址 (字符串, 例如: "8.8.8.8")
    • 输出:指定IP地址的地理位置信息

示例

查询当前IP地址示例

调用工具:

{
  "name": "get_my_ip",
  "arguments": {}
}

预期输出 (示例):

{
  "ip": "114.114.114.114",
  "pro": "江苏省",
  "proCode": "320000",
  "city": "南京市",
  "cityCode": "320100",
  "region": "",
  "regionCode": "0",
  "addr": "江苏省南京市 电信",
  "regionNames": "",
  "err": ""
}

查询指定IP地址示例

调用工具:

{
  "name": "get_ip_location",
  "arguments": {
    "ip": "8.8.8.8"
  }
}

预期输出 (示例):

{
  "ip": "8.8.8.8",
  "pro": "美国",
  "proCode": "0",
  "city": "",
  "cityCode": "0",
  "region": "",
  "regionCode": "0",
  "addr": "美国 加利福尼亚州山景市谷歌公司DNS服务器",
  "regionNames": "",
  "err": ""
}

技术实现

  • 基于 Model Context Protocol (MCP) SDK 构建。
  • 使用阿里云 IP 地址查询 API 获取 IP 地理位置数据。
  • 通过 stdio 传输实现与 AI 模型的通信。
  • 自动处理 API 响应,提供格式化的 JSON 输出。

注意事项

  • 请确保已正确配置 ALIYUN_IP_API_KEY 环境变量。
  • API 调用可能受到阿里云的频率限制,请查阅相关文档了解详情。

许可证

本项目采用 MIT 许可证。详情请参阅 LICENSE 文件(如果项目包含)。