Skip to main content
Glama
ip-info-mcp

ip-info-mcp

by yuwan0405

ip-info-mcp

基于 MCP (Model Context Protocol) 协议的 IP 地址信息查询服务器,通过 stdio 传输层 与 AI 客户端通信。

功能

  • 查本机 IP — 获取当前公网 IP 及归属地信息

  • 查指定 IP — 查询任意 IP 地址的归属地、ISP、经纬度等

  • 综合查询 — 支持 IPv4/IPv6,含主机名、组织、邮编、时区等

Related MCP server: personal-mcp-server

MCP stdio 通信机制

本项目使用 MCP 协议的 stdio 传输层:

┌─────────────────┐         ┌──────────────────────┐
│  AI 客户端        │  stdin  │  MCP Server (本进程)  │
│  (CodeBuddy 等)   │◄───────►│  python server.py     │
│                   │  stdout │                       │
└─────────────────┘         └──────────────────────┘
  • 客户端通过 stdin 发送 JSON-RPC 请求(如 tools/call)

  • 服务器通过 stdout 返回 JSON-RPC 响应

  • stderr 用于日志输出,不影响通信协议

  • 无需 HTTP 服务,启动轻量,适合本地工具集成

快速开始

1. 安装依赖

pip install -r requirements.txt

2. 配置到 AI 客户端

在 CodeBuddy 的 Settings → MCP → Add MCP 中添加:

{
  "mcpServers": {
    "ip-info": {
      "type": "stdio",
      "command": "python",
      "args": ["path/to/server.py"],
      "description": "IP 地址信息查询工具"
    }
  }
}

3. 使用

配置后直接在对话中提问:

  • "我的公网 IP 是什么?"

  • "查询 8.8.8.8 的归属地"

  • "查一下这个 IP 的信息:114.114.114.114"

项目结构

ip-info-mcp/
├── server.py          # MCP 服务器主文件
├── requirements.txt   # Python 依赖
├── README.md          # 本文件
└── chatmcp.yaml       # chatmcp 平台配置

技术栈

许可证

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that provides access to the Netdetective API for querying information about IP addresses. It enables users to retrieve metadata for a specified IP address or the connecting client's default IP address.
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server providing IP address lookup capabilities. Enables AI assistants to fetch details about public IP addresses or the user's current device IP.
    141 npm
    ISC
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides IP geolocation data via ipinfo.io, enabling querying IP addresses for location, ISP, and other details through natural language.
    483 npm
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables looking up approximate location of public or specific IP addresses, returning country, city, ISP, and coordinates via ip-api.com.
    -