Skip to main content

Location MCP Server

提供银行、身份证、IP、手机号归属地查询的 MCP (Model Context Protocol) 服务,基于 FastMCP 框架构建。

功能特性

  • 银行卡归属地查询: 根据银行卡号查询银行名称、卡类型等信息
  • 身份证归属地查询: 根据身份证号查询地区归属信息
  • IP归属地查询: 根据IP地址查询地理位置和ISP信息
  • 手机号归属地查询: 根据手机号查询省份、城市和运营商信息

支持批量查询,每次最多可查询1000条记录。

安装和使用

方式 1: uvx 运行(推荐)

uvx data-wise-location-mcp-server

方式 2: 安装后运行

pip install data-wise-location-mcp-server
data-wise-location-mcp-server

方式 3: Python 模块运行

python -m location.main

IDE 配置

Windsurf/Codeium 配置

在 ~/.codeium/windsurf/mcp_config.json 中添加以下配置:

{
  "mcpServers": {
    "data-wise-location": {
      "command": "uvx",
      "args": [
        "data-wise-location-mcp-server"
      ],
      "disabled": false,
      "env": {}
    }
  }
}

Cursor 配置

在 Cursor 的 MCP 设置中添加:

{
  "mcpServers": {
    "data-wise-location": {
      "command": "uvx",
      "args": [
        "data-wise-location-mcp-server"
      ],
      "disabled": false,
      "env": {}
    }
  }
}

Claude Desktop 配置

在 ~/Library/Application Support/Claude/claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "data-wise-location": {
      "command": "uvx",
      "args": [
        "data-wise-location-mcp-server"
      ],
      "disabled": false,
      "env": {}
    }
  }
}

可用工具

  1. bank_attribution_batch

    • 描述: 批量查询银行卡归属地信息
    • 参数: card_numbers (string[]) - 银行卡号列表
  2. id_attribution_batch

    • 描述: 批量查询身份证归属地信息
    • 参数: id_numbers (string[]) - 身份证号列表
  3. ip_attribution_batch

    • 描述: 批量查询IP地址归属地信息
    • 参数: ip_addresses (string[]) - IP地址列表
  4. mobile_attribution_batch

    • 描述: 批量查询手机号归属地信息
    • 参数: phone_numbers (string[]) - 手机号列表

技术架构

  • FastMCP: 基于 FastAPI 的 MCP 框架,提供类型安全的工具定义
  • Pydantic: 用于请求验证和数据模型定义
  • DuckDB: 高性能嵌入式数据库,存储归属地数据

数据来源

服务使用 DuckDB 数据库存储归属地数据,数据库文件位于:

  • bank_card_bin_data.duckdb - 银行卡BIN数据
  • id_location.duckdb - 身份证地区代码数据
  • ip_location.duckdb - IP地址归属地数据
  • mobile_location.duckdb - 手机号归属地数据

返回格式

所有工具返回统一的JSON格式:

{
  "success": true,
  "data": [
    {
      // 具体的归属地信息字段
    }
  ],
  "count": 10
}

错误处理

当查询失败时,返回:

{
  "success": false,
  "error": "错误信息",
  "data": null
}

开发说明

本项目从 DataWiseCenter 主项目的 location 数据集模块独立出来,适配 MCP 协议标准。

项目结构

location/
├── __init__.py          # 包初始化
├── main.py              # FastMCP 服务主程序
├── query.py             # 查询引擎
├── requirements.txt     # 依赖包
└── README.md           # 说明文档

FastMCP 优势

  • 类型安全: 使用 Pydantic 模型进行参数验证
  • 自动文档: 自动生成工具文档和schema
  • FastAPI 集成: 与 FastAPI 生态系统无缝集成
  • 简化开发: 减少样板代码,提高开发效率

Metadata

Release files for data-wise-location-mcp-server 1.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for data-wise-location-mcp-server 1.0.12
File Size Uploaded Provenance Actions
data_wise_location_mcp_server-1.0.12.tar.gz 4.2 MB Without provenance Details for data_wise_location_mcp_server-1.0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for data-wise-location-mcp-server 1.0.12
File Interpreter ABI Platform Actions
data_wise_location_mcp_server-1.0.12-py3-none-any.whl Python 3 none any Details for data_wise_location_mcp_server-1.0.12-py3-none-any.whl

Total release size: 8.6 MB

Release files / data_wise_location_mcp_server-1.0.12.tar.gz

Download URL data_wise_location_mcp_server-1.0.12.tar.gz
Size 4.2 MB
Tags Source
SHA-256 checksum
How to use checksums
27fbedd052e4c3ea3db9a20e9bcaaa69b298a54b2562cd5d21f0941aea95c786
BLAKE2b-256 checksum
How to use checksums
3c4c8beb30942cb464c8ec09de56c320acf210e3348e0aa1d42923ae7134180f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / data_wise_location_mcp_server-1.0.12-py3-none-any.whl

Download URL data_wise_location_mcp_server-1.0.12-py3-none-any.whl
Size 4.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2fe30ada257ccaf753a15d152e46cd32d6f20a0b33256d3d26655355922d9abe
BLAKE2b-256 checksum
How to use checksums
172379a87de6f824fbf383a69b61144e8950251d4f69f7c560d85566907c9243
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for data-wise-location-mcp-server 1.0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page