关于 Ip Region And Ping A Test Mcp
IPCONFIG MCP Server 是运行在 Cloudflare Workers 上的网络查询与连通性测试服务,面向需要在 AI 助手中执行网络诊断的用户。它提供当前公网 IP 查询、IP 地理位置查询,以及从多个地区测试主机延迟。
主要功能
- 01查询当前公网 IP 信息
- 02查询 IPv4 或 IPv6 地理位置
- 03从多个地区测试网络连通性
- 04检测延迟与丢包情况
- 05支持 JSON 或文本结果
适用场景
- 01查看客户端当前公网 IP 与运营商信息
- 02查询 IP 地址对应的地理位置
- 03检查服务器在不同地区的网络延迟
MCP 相关
该 MCP 服务向 MCP 客户端提供当前 IP 查询、IP 地理位置查询和网络 Ping 测试工具。使用服务需配置 IPCONFIG_API_KEY。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
IPCONFIG MCP Server
中文文档 | English
基于 Cloudflare Workers 构建的强大 IPCONFIG MCP(Model Context Protocol)服务,为 AI 助手提供 IP 地址查询、地理位置查询和网络连通性测试工具。
🌟 功能
- IP 地址查询 - 获取当前客户端的公网 IP 地址
- IP 地理位置查询 - 获取任意 IP 地址的详细地理位置信息
- Ping 连通性测试 - 测试与任意主机的网络连通性和延迟
- CORS 支持 - 全面支持 CORS,可从任意域访问
- 高性能 - 基于 Cloudflare Workers 边缘计算平台构建
- 标准协议 - 完全兼容 MCP 协议规范
🔑 获取 API 密钥
配置任何 MCP 客户端之前,你需要先从 IPCONFIG 获取 API 密钥:
分步指南
-
创建账户
- 访问 IPCONFIG Console
- 注册免费账户,或登录现有账户
-
访问 API 密钥管理
- 在控制台中前往 API Keys 页面
- 你将看到 API 密钥管理面板
-
创建新的 API 密钥
- 点击“Create New Key”按钮
- 为 API 密钥输入一个易于识别的名称(例如,“MCP Client”、“Claude Desktop”)
- 点击“Create”
-
保存密钥
- ⚠️ 重要:立即复制 API 密钥并妥善保存
- 出于安全原因,密钥只会显示一次
- 如果丢失,需要创建新的密钥
API 密钥功能
| 功能 | 免费版 | Pro 版 |
|---|---|---|
| 速率限制 | 60 次请求/分钟 | 100 次请求/秒 |
| 每月额度 | 1,000 | 10,000+ |
| 获取我的 IP | ✅ 免费 | ✅ 免费 |
| IP 位置 | 1 点数/次查询 | 1 点数/次查询 |
| Ping 测试 | 1 点数/节点 | 1 点数/节点 |
如需了解更多详情,请参阅 API 密钥管理文档。
🚀 快速开始
用户使用
Cursor IDE 配置(推荐)
一键安装:
手动配置:
- macOS:
~/Library/Application Support/Cursor/mcp.json - Windows:
%APPDATA%\Cursor\mcp.json - Linux:
~/.config/Cursor/mcp.json
{
"mcpServers": {
"ipconfig": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.ipconfig.com/mcp"],
"env": {
"IPCONFIG_API_KEY": "your-api-key-here"
}
}
}
}
Claude Desktop 配置
-
获取 API 密钥:按照上方的 API 密钥指南获取 API 密钥
-
配置 Claude Desktop:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
添加配置:
{ "mcpServers": { "ipconfig": { "command": "npx", "args": ["mcp-remote", "https://mcp.ipconfig.com/mcp"], "env": { "IPCONFIG_API_KEY": "your-api-key-here" } } } } -
重启 Claude Desktop并进行测试:“我的 IP 地址是什么?”
开发者使用
1. 克隆仓库
git clone https://github.com/your-username/ipconfig-mcp.git
cd ipconfig-mcp
2. 安装依赖项
npm install
3. 配置环境
# Copy configuration file
cp wrangler.toml.example wrangler.toml
# Edit configuration (optional)
# - Modify project name
# - Configure custom domain
# - Set language preference
4. 设置 API 密钥(推荐)
wrangler secret put IPCONFIG_API_KEY
# Enter your API key (follow the API Key guide above to obtain one)
5. 本地开发
npm run dev
# Server will start at http://localhost:8787
6. 部署到 Cloudflare
npm run deploy
📡 MCP 工具
1. get_my_ip - 获取当前 IP 地址
获取当前客户端的公网 IP 地址和基本信息。
参数:
format(可选):json或text,默认为json
使用示例:
- “我的 IP 地址是什么?”
- “显示我当前的 IP 信息”
- “以文本格式获取我的公网 IP”
调用示例:
{
"name": "get_my_ip",
"arguments": {"format": "json"}
}
响应示例:
{
"ip": "203.0.113.1",
"country": "United States",
"region": "California",
"city": "San Francisco",
"isp": "Example ISP",
"timezone": "America/Los_Angeles"
}
2. get_ip_location - IP 地理位置查询
获取任意 IP 地址的详细地理位置信息。
参数:
ip(必填):IP 地址(IPv4 或 IPv6)format(可选):json或text,默认值为json
使用示例:
- “8.8.8.8 位于哪里?”
- “获取 1.1.1.1 的位置信息”
- “这个 IP 的地理位置是什么:208.67.222.222?”
调用示例:
{
"name": "get_ip_location",
"arguments": {"ip": "8.8.8.8", "format": "json"}
}
响应示例:
{
"ip": "8.8.8.8",
"country": "United States",
"region": "California",
"city": "Mountain View",
"latitude": 37.4056,
"longitude": -122.0775,
"isp": "Google LLC",
"asn": "AS15169",
"timezone": "America/Los_Angeles"
}
3. ping_test - 网络连通性测试
从多个全球位置测试与任意主机之间的网络连通性和延迟。
参数:
host(必填):主机名或 IP 地址count(可选):Ping 次数,默认值为 2,范围为 1-10ipVersion(可选):ipv4或ipv6,默认值为ipv4areas(可选):测试区域列表,默认为主要区域
使用示例:
- “测试与 google.com 的连通性”
- “从多个位置 Ping baidu.com”
- “检查与我在 example.com 的服务器之间的网络延迟”
调用示例:
{
"name": "ping_test",
"arguments": {
"host": "google.com",
"count": 4,
"areas": ["california", "london", "tokyo"]
}
}
响应示例:
{
"host": "google.com",
"results": [
{
"area": "california",
"avg_latency": "12.5ms",
"packet_loss": "0%",
"status": "success"
},
{
"area": "london",
"avg_latency": "45.2ms",
"packet_loss": "0%",
"status": "success"
}
]
}
🔧 配置
环境变量
在 wrangler.toml 中配置:
[vars]
MCP_SERVER_NAME = "IPCONFIG MCP Server"
MCP_SERVER_VERSION = "1.0.0"
LANGUAGE = "en" # or "zh" for Chinese
多语言支持
- 环境变量:
export LANGUAGE=zh - 客户端配置:在 MCP 配置中设置
"LANGUAGE": "zh" - 请求参数:在 MCP 请求中包含
"language": "zh"
API 密钥配置
- 生产环境:使用
wrangler secret put IPCONFIG_API_KEY - 客户端:在 MCP 配置的
env部分设置 - 获取密钥:请参阅上方的 API 密钥指南
🧪 测试
健康检查
curl https://mcp.ipconfig.com/health
MCP 工具测试
# Get tools list
curl -X POST https://mcp.ipconfig.com/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}'
# Test tool call
curl -X POST https://mcp.ipconfig.com/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 2, "method": "tools/call",
"params": {"name": "get_my_ip", "arguments": {"format": "json"}}
}'
使用 MCP Inspector
npx @modelcontextprotocol/inspector@latest
# Visit http://localhost:5173 in browser
# Connect to: https://mcp.ipconfig.com/mcp
📊 API 密钥使用限额
| API 密钥类型 | 每分钟请求数 | 每日请求数 | 功能 |
|---|---|---|---|
| 免费 | 100 | 1,000 | 基本功能 |
| Pro | 600 | 10,000 | 完整功能 |
| Enterprise | 2,000 | 50,000 | 高级功能 |
🏗️ 项目结构
ipconfig-mcp/
├── src/
│ ├── index.ts # Main entry file
│ ├── services/
│ │ └── ipconfig.ts # IPCONFIG API service
│ └── utils/
│ ├── cors.ts # CORS utilities
│ └── i18n.ts # Internationalization
├── wrangler.toml.example # Configuration template
├── cursor-mcp-config.json # Cursor IDE configuration
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
🔗 链接
❓ 常见问题
问:如何确认配置正常运行? 答:重启客户端并询问 AI:“我的 IP 地址是什么?”如果返回了结果,则表示配置成功。
问:遇到连接错误时该怎么办? 答:检查网络连接,确认 API 密钥正确,并确保配置文件格式有效。
问:支持哪些功能? 答:支持当前 IP 查询、IP 地理位置查询和网络连通性测试,并兼容 IPv4 和 IPv6。
📄 许可证
MIT 许可证
🤝 贡献
欢迎提交问题和 Pull Request!
IPCONFIG MCP Server - 为 AI 助手赋予网络诊断能力 🚀
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。