Token导航 LogoToken导航

MCP Server · AI代理

Geocode MCP Server

一个基于OpenStreetMap Nominatim API的地理编码服务,提供城市和位置的经纬度坐标,适用于MCP兼容工具。

stdio官方级别未说明来源级核验工具 0
地理编码位置天气PythonClaudeClaude DesktopCursorVS Code

快速开始

作者 / 组织
X-McKay
提供方
X-McKay
运行时
Python

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

5

仓库热度

收录来源

2 个

MCP World

选型结论

Geocode MCP Server 属于AI代理类 MCP Server,公开资料标注 0 个工具,通过stdio 本地进程接入,适配 Claude Desktop、Claude、Cursor,有可以直接复制的安装命令;接入前先确认权限范围。

分类

AI代理

传输方式

stdio

认证方式

无需认证

部署方式

支持远程部署

安装与配置

安装命令

uvx geocode-mcp

客户端配置示例

{
  "mcpServers": {
    "geocode-mcp": {
      "command": "uvx",
      "args": [
        "geocode-mcp"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 0 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

地理码MCP服务器

模型上下文协议(MCP)服务器,使用OpenStreetMap Nomatim API为城市和地点提供纬度/经度坐标。

特性

  • 🌍 全球地理编码:获取全球任何位置的坐标
  • 🆓 免费API:使用OpenStreetMap Nomatim(不需要API密钥)
  • � MCP集成:适用于Cursor、VS Code、Claude Desktop和其他MCP兼容工具
  • 📦 简易安装:通过PyPI安装 uvx geocode-mcp
  • �️ 现代工具:使用Python 3.12+、async/await和全面测试构建

快速开始

安装

使用uvx从PyPI安装软件包(推荐):

uvx geocode-mcp

或者用pip安装:

pip install geocode-mcp

MCP配置

添加到MCP客户端配置中:

{
  "mcpServers": {
    "geocoding": {
      "command": "uvx",
      "args": ["geocode-mcp"]
    }
  }
}

请参阅 config/ 不同工具的具体示例目录。

可用工具

mcp_geocoding_get_coordinates

获取城市或地点的纬度和经度坐标。

参数:

  • location (必填):城市名称、地址或位置(例如,“纽约”、“法国巴黎”、“西雅图主街123号”)
  • limit (可选):返回的最大结果数(默认值:1,最大值:10)

示例用法:

Get coordinates for Tokyo, Japan
Find the latitude and longitude of London, UK  
What are the coordinates for New York City?
Get coordinates for "1600 Pennsylvania Avenue, Washington DC" with limit 5

响应格式:

{
  "query": "Tokyo, Japan",
  "results_count": 1,
  "coordinates": [
    {
      "latitude": 35.6762,
      "longitude": 139.6503,
      "display_name": "Tokyo, Japan",
      "place_id": "282885117",
      "type": "city",
      "class": "place",
      "importance": 0.9,
      "bounding_box": {
        "south": 35.619,
        "north": 35.739,
        "west": 139.619,
        "east": 139.682
      }
    }
  ]
}

集成指南

光标

从以下位置复制配置 config/cursor-mcp.json 到您的光标MCP设置。

VS代码

从以下位置复制配置 config/vscode-mcp.json 您的VS代码MCP设置。

克劳德桌面

从以下位置复制配置 config/claude-desktop.json 到您的Claude Desktop配置文件。

请参阅 配置README 有关详细的设置说明。

发展

设置

# Clone the repository
git clone https://github.com/X-McKay/geocode-mcp.git
cd geocode-mcp

# Install with development dependencies
pip install -e ".[dev]"

运行测试

# Run all tests
pytest

# Run with coverage
pytest --cov=src/geocode_mcp --cov-report=html

# Run specific test files
pytest tests/test_geocoding.py -v
pytest tests/test_mcp_server.py -v

代码质量

# Format code
ruff format

# Lint code
ruff check

# Run all checks
ruff check && ruff format --check

地方发展

对于本地开发和测试,您可以直接运行服务器:

python -m geocode_mcp.server

或者使用MCP客户端中的开发配置:

{
  "mcpServers": {
    "geocoding": {
      "command": "python",
      "args": ["-m", "geocode_mcp.server"],
      "cwd": "/path/to/geocode-mcp",
      "env": {
        "PYTHONPATH": "/path/to/geocode-mcp/src"
      }
    }
  }
}

项目结构

geocode-mcp/
├── src/geocode_mcp/       # Main source code
│   └── server.py          # MCP server implementation
├── tests/                 # Test suite
│   ├── test_geocoding.py  # Geocoding functionality tests
│   ├── test_mcp_server.py # MCP server integration tests
│   ├── test_mcp.py        # MCP protocol tests
│   └── test_vscode.py     # VS Code integration tests
├── config/                # Configuration examples
│   ├── cursor-mcp.json    # Cursor configuration
│   ├── vscode-mcp.json    # VS Code configuration
│   ├── claude-desktop.json # Claude Desktop configuration
│   └── README.md          # Configuration guide
├── docs/                  # Documentation
├── pyproject.toml         # Project configuration
├── requirements.txt       # Production dependencies
├── requirements-dev.txt   # Development dependencies
└── README.md             # This file

api参考

核心功能

async def geocode_location(location: str, limit: int = 1) -> dict[str, Any]:
    """
    Geocode a location using OpenStreetMap Nominatim API.
    
    Args:
        location: The location to geocode
        limit: Maximum number of results (1-10)
        
    Returns:
        Dictionary containing query, results_count, and coordinates
    """

MCP服务器

服务器实现模型上下文协议,并提供 mcp_geocoding_get_coordinates 用于MCP兼容应用程序的工具。

贡献

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 进行更改
  4. 运行测试(pytest)
  5. 跑linting(ruff check && ruff format)
  6. 提交您的更改(git commit -m 'Add amazing feature')
  7. 推到分支(git push origin feature/amazing-feature)
  8. 打开拉取请求

看 贡献.md 了解更多详情。

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

致谢

制作棉绒

格式代码

制作格式

类型检查

进行类型检查

运行所有检查

检查全部


### Testing

Run all tests

make test

Run with coverage

make test-cov

Run specific test categories

pytest tests/test_geocoding.py -v # Geocoding tests pytest tests/test_mcp.py -v # MCP server tests python tests/test_mcp_server.py # Integration tests python tests/test_vscode.py # VSCode tests


### 安装

Install production dependencies

make install

Install development dependencies

make install-dev


## 配置

### 光标集成

看 [光标集成指南](docs/cursor-integration.md) 有关详细的设置说明。

### VSCode集成

运行VSCode集成测试:

python tests/test_vscode.py


## api参考

### 地理编码功能

async def geocode_location(location: str, limit: int = 1) -> dict[str, Any]: """Geocode a location using Nominatim API."""


### MCP服务器

服务器提供 `get_coordinates` 可以通过MCP协议调用的工具。

## 贡献

1. 分叉存储库
1. 创建要素分支
1. 进行更改
1. 运行测试: `make test`
1. 运行linting: `make lint`
1. 提交拉取请求

看 [贡献.md](CONTRIBUTING.md) 了解更多详情。

## 许可证

此项目根据MIT许可证获得许可-请参阅 [许可证](LICENSE) 文件以获取详细信息。

## 致谢

- [开放街道图](https://www.openstreetmap.org/) 用于提供Nominim地理编码服务
- [主控程序](https://modelcontextprotocol.io/) 对于协议规范

🚀 Quick Setup Instructions

  1. Create Project Folder:
   mkdir mcp-geocoding-server-python
   cd mcp-geocoding-server-python
  1. 复制文件:

将上面的每个文件部分复制到具有相应名称的文件中

  1. 安装依赖关系:
   pip install -r requirements.txt
  1. 运行服务器:
   python geocoding_server.py
  1. 配置MCP客户端:

添加到您的MCP客户端(如Claude Desktop)配置中:

   {
     "mcpServers": {
       "geocoding": {
         "command": "python",
         "args": ["/full/path/to/mcp-geocoding-server-python/geocoding_server.py"]
       }
     }
   }```

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

地理编码Python本地部署位置服务MCP集成Python开发

支持客户端

Claude DesktopClaudeCursorVS Code

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

多步任务编排

把拆解、检索、执行串成一条链,模型按步骤调用工具。

长期上下文

把会话、笔记和知识放到外部存储,换个会话还能接着做。

接自有流程

把内部系统和模型连起来,让助手调用已有的工作流。

选择建议

值得选的地方

  • 只提供 0 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Geocode MCP Server

MCP World · 本页

0stdio有2 个2026-05-17
Everything Claude Code

MCP World

0stdio有1 个2026-05-17
Filesystem 560c4363

MCP World

13未说明未标注2 个2026-05-17
Time 7365cb6d

MCP.so

2SSE有2 个2026-05-17
Server Everything (everything)

MCP World

11stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Geocode MCP Server 怎么安装?

公开资料给出的安装命令是 uvx geocode-mcp,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Geocode MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

Geocode MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Geocode MCP Server 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Geocode MCP Server 支持哪些客户端?

公开资料标注支持 Claude Desktop、Claude、Cursor、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP