经 AI Skill Hub 精选评估,CitySense 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
CitySense是一款开源的Python库,用于连接地理空间城市数据,提供地理空间数据处理和分析功能。它可以帮助开发者更好地理解城市数据,提高城市规划和管理的效率。
CitySense 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
CitySense是一款开源的Python库,用于连接地理空间城市数据,提供地理空间数据处理和分析功能。它可以帮助开发者更好地理解城市数据,提高城市规划和管理的效率。
CitySense 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/olaflaitinen/citysense
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"citysense": {
"command": "npx",
"args": ["-y", "citysense"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 CitySense 执行以下任务... Claude: [自动调用 CitySense MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"citysense": {
"command": "npx",
"args": ["-y", "citysense"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p><b>Geospatial RAG + MCP Toolkit for Urban Intelligence</b></p> <p><sub>Built for SDG 11 workflows, pilot countries, and research-grade city analytics.</sub></p>
<p><sub><b>QUICK LINKS</b></sub></p> <p> <a href="https://citysense.readthedocs.io">Documentation</a> | <a href="https://pypi.org/project/citysense/">PyPI</a> | <a href="https://github.com/olaflaitinen/citysense/issues">Issues</a> | <a href="https://modelcontextprotocol.io/">MCP</a> </p>
<p> <sub><b>PARTNERS</b></sub><br> <img src="docs/assets/partners/unh_sqr_logo.svg" alt="UN-Habitat Logo" height="34"/> <img src="docs/assets/partners/wuf-logo.svg" alt="World Urban Forum Logo" height="34"/> <img src="docs/assets/partners/arxkom_logo_en.svg" alt="Arxkom Logo" height="34"/> </p>
<p> <sub><b>PILOT COUNTRIES</b></sub><br> <img src="https://flagcdn.com/16x12/az.png" alt="Azerbaijan flag" width="16" height="12"/> <sub></sub> <img src="https://flagcdn.com/16x12/fi.png" alt="Finland flag" width="16" height="12"/> <sub></sub> <img src="https://flagcdn.com/16x12/se.png" alt="Sweden flag" width="16" height="12"/> <sub></sub> <img src="https://flagcdn.com/16x12/dk.png" alt="Denmark flag" width="16" height="12"/> <sub></sub> <img src="https://flagcdn.com/16x12/no.png" alt="Norway flag" width="16" height="12"/> <sub></sub> </p>
<br>
<p><sub><b>PACKAGE</b></sub></p> <p> <a href="https://pypi.org/project/citysense/"><img src="https://img.shields.io/pypi/v/citysense?logo=pypi&logoColor=white&style=flat&cacheSeconds=3600" alt="PyPI version"></a> <a href="https://pypi.org/project/citysense/"><img src="https://img.shields.io/pypi/pyversions/citysense?logo=python&logoColor=white&style=flat&cacheSeconds=3600" alt="PyPI - Python Version"></a> <a href="https://pypi.org/project/citysense/"><img src="https://img.shields.io/pypi/wheel/citysense?logo=pypi&logoColor=white&style=flat&cacheSeconds=3600" alt="PyPI - Wheel"></a> <a href="https://pypi.org/project/citysense/"><img src="https://img.shields.io/pypi/format/citysense?logo=pypi&logoColor=white&style=flat&cacheSeconds=3600" alt="PyPI - Format"></a> <a href="https://pypi.org/project/citysense/"><img src="https://img.shields.io/pypi/status/citysense?logo=pypi&logoColor=white&style=flat&cacheSeconds=3600" alt="PyPI - Status"></a> <a href="https://pepy.tech/projects/citysense"><img src="https://static.pepy.tech/badge/citysense/month" alt="PyPI - Downloads"></a> </p>
<p><sub><b>REPOSITORY</b></sub></p> <p> <a href="https://github.com/olaflaitinen/citysense/stargazers"><img src="https://img.shields.io/github/stars/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub stars"></a> <a href="https://github.com/olaflaitinen/citysense/network/members"><img src="https://img.shields.io/github/forks/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub forks"></a> <a href="https://github.com/olaflaitinen/citysense/issues"><img src="https://img.shields.io/github/issues/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub issues"></a> <a href="https://github.com/olaflaitinen/citysense/issues?q=is%3Aissue+is%3Aclosed"><img src="https://img.shields.io/github/issues-closed/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub issues closed"></a> <a href="https://github.com/olaflaitinen/citysense/pulls"><img src="https://img.shields.io/github/issues-pr/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub PRs"></a> <a href="https://github.com/olaflaitinen/citysense/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub PRs closed"></a> <a href="https://github.com/olaflaitinen/citysense/graphs/contributors"><img src="https://img.shields.io/github/contributors/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub contributors"></a> <a href="https://github.com/olaflaitinen/citysense/commits/main"><img src="https://img.shields.io/github/last-commit/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub last commit"></a> <a href="https://github.com/olaflaitinen/citysense/commits/main"><img src="https://img.shields.io/github/commit-activity/m/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="GitHub commit activity"></a> <a href="https://github.com/olaflaitinen/citysense"><img src="https://img.shields.io/github/languages/code-size/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="Code size"></a> <a href="https://github.com/olaflaitinen/citysense"><img src="https://img.shields.io/github/languages/top/olaflaitinen/citysense?logo=python&logoColor=white&style=flat&cacheSeconds=3600" alt="Top language"></a> <a href="https://github.com/olaflaitinen/citysense"><img src="https://img.shields.io/github/repo-size/olaflaitinen/citysense?logo=github&logoColor=white&style=flat&cacheSeconds=3600" alt="Repo size"></a> </p>
<p><sub><b>QUALITY</b></sub></p> <p> <a href="https://github.com/olaflaitinen/citysense/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/olaflaitinen/citysense/ci.yml?branch=main&label=CI&logo=githubactions&logoColor=white&style=flat&cacheSeconds=3600" alt="CI"></a> <a href="https://github.com/olaflaitinen/citysense/actions/workflows/scorecard-analysis.yml"><img src="https://img.shields.io/github/actions/workflow/status/olaflaitinen/citysense/scorecard-analysis.yml?branch=main&label=Scorecard&logo=githubactions&logoColor=white&style=flat&cacheSeconds=3600" alt="Scorecard CI"></a> <a href="https://codecov.io/gh/olaflaitinen/citysense"><img src="https://img.shields.io/codecov/c/github/olaflaitinen/citysense?logo=codecov&logoColor=white&style=flat&cacheSeconds=3600" alt="Codecov"></a> <a href="https://scorecard.dev/viewer/?uri=github.com/olaflaitinen/citysense"><img src="https://img.shields.io/badge/dynamic/json?url=https://api.scorecard.dev/projects/github.com/olaflaitinen/citysense&query=$.score&label=OpenSSF%20Scorecard&suffix=%2F10&logo=securityscorecard&logoColor=white&style=flat&cacheSeconds=3600" alt="OpenSSF Scorecard"></a> <a href="https://app.deepsource.com/gh/olaflaitinen/citysense/?ref=repository-badge"><img alt="DeepSource" title="DeepSource" src="https://app.deepsource.com/gh/olaflaitinen/citysense.svg/?label=active+issues&show_trend=true"></a> <a href="https://opensource.org/licenses/EUPL-1.2"><img src="https://img.shields.io/badge/license-EUPL--1.2-green?logo=europeanunion&logoColor=white&style=flat&cacheSeconds=3600" alt="License"></a> </p>
<p><sub><b>STANDARDS</b></sub></p> <p> <a href="https://docs.astral.sh/ruff/"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=flat&cacheSeconds=3600" alt="Ruff"></a> <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg?logo=black&logoColor=white&style=flat&cacheSeconds=3600" alt="Code style: black"></a> <a href="https://mypy-lang.org/"><img src="https://img.shields.io/badge/type%20checker-mypy-2a6db2.svg?logo=python&logoColor=white&style=flat&cacheSeconds=3600" alt="mypy"></a> <a href="https://pycqa.github.io/isort/"><img src="https://img.shields.io/badge/imports-isort-1674B1?logo=pycqa&logoColor=white&style=flat&cacheSeconds=3600" alt="isort"></a> <a href="https://pre-commit.com/"><img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=precommit&logoColor=white&style=flat&cacheSeconds=3600" alt="Pre-commit"></a> <a href="https://github.com/editorconfig/editorconfig"><img src="https://img.shields.io/badge/EditorConfig-enabled-cyan?logo=editorconfig&logoColor=white&style=flat&cacheSeconds=3600" alt="EditorConfig"></a> <a href="https://pypi.org/project/bandit/"><img src="https://img.shields.io/badge/security-bandit-F29F05?logo=pycqa&logoColor=white&style=flat&cacheSeconds=3600" alt="Security: bandit"></a> </p>
<p><sub><b>TECH STACK</b></sub></p> <p> <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/Protocol-MCP-6366F1?logo=modelcontextprotocol&logoColor=white&style=flat" alt="MCP"></a> <a href="https://sdgs.un.org/goals/goal11"><img src="https://img.shields.io/badge/UN--SDG-11-009EDB?logo=unitednations&logoColor=white&style=flat" alt="SDG 11"></a> <a href="https://www.openstreetmap.org/"><img src="https://img.shields.io/badge/Data-OpenStreetMap-7EBC6F?logo=openstreetmap&logoColor=white&style=flat" alt="OpenStreetMap"></a> <a href="https://www.mapillary.com/"><img src="https://img.shields.io/badge/Data-Mapillary-05CB63?logo=mapillary&logoColor=white&style=flat" alt="Mapillary"></a> <a href="https://sentinel.esa.int/"><img src="https://img.shields.io/badge/Data-Sentinel--2-4B6A9C?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8%2BIDwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPiA8c3ZnIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4wIiB3aWR0aD0iMjQyLjg4NjA2IiBoZWlnaHQ9IjI0Mi45NzUxMyIgaWQ9InN2ZzI0MjkiPiAgIDxkZWZzIGlkPSJkZWZzMjQzMSIvPiAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yODQuMzQ1MjksLTMxMC44NzQ2MikiIGlkPSJsYXllcjEiPiAgICAgPHBhdGggZD0iTSA0NDEuMjc2NTYsNDIxLjY5MDkxIEwgNDg5LjA2ODUxLDQyMS42OTA5MSBDIDQ4OS4wNjg1MSw0MjEuNjkwOTEgNDkwLjk1OTQyLDQxNC41MDY0NyA0ODIuNDQ4LDQwMy43MzU1NiBDIDQ2NS42MzU3OCwzODYuMzYyNDUgNDQ2Ljc1MDk2LDM5Ny44ODQyNSA0NDYuNzUwOTYsMzk3Ljg4NDI1IEMgNDM3LjQ5MDk3LDQwMi43OTQ2NiA0MjUuNTk4MjcsNDIzLjE5OTUxIDQzMi41NzUyLDQ1Mi40ODA1NyBDIDQ0MS4yNzY1Niw0ODEuNzY3NzcgNDc0LjcwODAyLDQ4Ny43OTQ0NCA0OTUuNDgw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NiAwIi8%2BCiAgPHBvbHlnb24gZmlsbD0iIzlFMEQzOCIgcG9pbnRzPSIxMTkuMDggMTQzLjc1IDExOS4wOCAxODEuMjUgODYuNiAyMDAgODYuNiAxNjIuNSAxMTkuMDggMTQzLjc1Ii8%2BCiAgPHBvbHlnb24gZmlsbD0iIzlFMEQzOCIgcG9pbnRzPSIxNzMuMjEgNTAgMTczLjIxIDE3NSAxNDAuNzMgMTkzLjc1IDE0MC43MyA2OC43NSAxNzMuMjEgNTAiLz4KICA8cG9seWdvbiBmaWxsPSIjRkY1MTZCIiBwb2ludHM9IjE3My4yMSA1MCAxNDAuNzMgNjguNzUgODYuNiAzNy41IDMyLjQ4IDY4Ljc1IDAgNTAgODYuNiAwIDE3My4yMSA1MCIvPgogIDxwb2x5Z29uIGZpbGw9IiNEQzI0NEMiIHBvaW50cz0iODYuNiAxNjIuNSA4Ni42IDIwMCAwIDE1MCAwIDUwIDMyLjQ4IDY4Ljc1IDMyLjQ4IDEzMS4yNSA4Ni42IDE2Mi41Ii8%2BCiAgPHBvbHlnb24gZmlsbD0iI0ZGNTE2QiIgcG9pbnRzPSIxMTkuMDggODEuMjUgODYuNiAxMDAgNTQuMTMgODEuMjUgODYuNiA2Mi41IDExOS4wOCA4MS4yNSIvPgogIDxwb2x5Z29uIGZpbGw9IiNEQzI0NEMiIHBvaW50cz0iODYuNiAxMDAgODYuNiAxMzcuNSA1NC4xMyAxMTguNzUgNTQuMTMgODEuMjUgODYuNiAxMDAiLz4KICA8cG9seWdvbiBmaWxsPSIjOUUwRDM4IiBwb2ludHM9IjExOS4wOCA4MS4yNSAxMTkuMDggMTE4Ljc1IDg2LjYgMTM3LjUgODYuNiAxMDAgMTE5LjA4IDgxLjI1Ii8%2BCjwvc3ZnPg%3D%3D&style=flat" alt="Qdrant"></a> <a href="https://shapely.readthedocs.io/"><img src="https://img.shields.io/badge/Geometry-Shapely%202.1%2B-3776AB?logo=python&logoColor=white&style=flat" alt="Shapely"></a> <a href="https://geopandas.org/"><img src="https://img.shields.io/badge/Geospatial-GeoPandas%201.1%2B-3776AB?logo=geopandas&logoColor=white&style=flat" alt="GeoPandas"></a> <a href="https://numpy.org/"><img src="https://img.shields.io/badge/Compute-NumPy-013243?logo=numpy&logoColor=white&style=flat" alt="NumPy"></a> <a href="https://pandas.pydata.org/"><img src="https://img.shields.io/badge/Data-Pandas-150458?logo=pandas&logoColor=white&style=flat" alt="Pandas"></a> <a href="https://pydantic.dev/"><img src="https://img.shields.io/badge/Validation-Pydantic-E92063?logo=pydantic&logoColor=white&style=flat" alt="Pydantic"></a> <a href="https://h3geo.org/"><img src="https://img.shields.io/badge/Index-H3-FFFF00?logo=h3&logoColor=black&style=flat" alt="H3"></a> </p> <p><sub><b>PLATFORM</b></sub></p> <p> <a href="https://ubuntu.com/"><img src="https://img.shields.io/badge/OS-Linux-FCC624?logo=linux&logoColor=black&style=flat" alt="Linux"></a> <a href="https://www.apple.com/macos/"><img src="https://img.shields.io/badge/OS-macOS-000000?logo=macos&logoColor=white&style=flat" alt="macOS"></a> <a href="https://www.microsoft.com/windows/"><img src="https://img.shields.io/badge/OS-Windows-0078D6?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iODgiIHdpZHRoPSI4OCIgeG1sbnM6dj0iaHR0cHM6Ly92ZWN0YS5pby9uYW5vIj48cGF0aCBkPSJNMCAxMi40MDJsMzUuNjg3LTQuODYuMDE2IDM0LjQyMy0zNS42Ny4yMDN6bTM1LjY3IDMzLjUyOWwuMDI4IDM0LjQ1M0wuMDI4IDc1LjQ4TC4wMjYgNDUuN3ptNC4zMjYtMzkuMDI1TDg3LjMxNCAwdjQxLjUyN2wtNDcuMzE4LjM3NnptNDcuMzI5IDM5LjM0OWwtLjAxMSA0MS4zNC00Ny4zMTgtNi42NzgtLjA2Ni0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8%2BPC9zdmc%2B&logoColor=white&style=flat" alt="Windows"></a> <a href="https://hub.docker.com/r/olaflaitinen/citysense"><img src="https://img.shields.io/badge/Container-Docker-2496ED?logo=docker&logoColor=white&style=flat" alt="Docker"></a> <a href="https://conda.io/"><img src="https://img.shields.io/badge/Env-Conda-44A833?logo=anaconda&logoColor=white&style=flat" alt="Conda"></a> </p> </div>
---
CitySense is an open-source Python library for geospatial retrieval-augmented generation (RAG) and MCP-based AI tooling for urban analysis. It combines natural-language intent parsing, geospatial indexing, and an MCP server so applications can query urban context with minimal boilerplate. The project aligns with SDG 11, the New Urban Agenda, and WUF13 framing. The current codebase includes active pilot configs for Azerbaijan and Finland, OSM-powered indexing, and modular connectors for Sentinel-2, Mapillary, and KartaView integrations.
---
| Capability | Description |
|---|---|
| Natural language queries | Intent parsing and semantic retrieval over geospatial knowledge bases |
| Multi-source architecture | OSM active CLI path; Sentinel-2, Mapillary, and KartaView connector modules included |
| MCP integration | Native Model Context Protocol server for Cursor, Claude, VS Code |
| WUF13 alignment | Pilot-aware schema and indicator model aligned to WUF13 framing |
| SDG 11 metrics | Land consumption rate (11.3.1), urban resilience composite score |
| Spectral indices | NDVI, NDWI, NDBI, EVI, MNDWI, BSI from Sentinel-2 L2A |
| Reciprocal Rank Fusion | Hybrid dense and sparse retrieval with configurable parameter k |
| Requirement | Version |
|---|---|
| Python | 3.12 or 3.13 |
| Qdrant | Default endpoint http://localhost:6333 |
| GDAL | 3.10+ (for rasterio, geopandas; conda recommended) |
---
pip install "citysense[clip]"
pip install "citysense[sentinelhub]"
Then set connector credentials (MAPILLARY_ACCESS_TOKEN, CDSE_CLIENT_ID, CDSE_CLIENT_SECRET) as needed.
---
citysense index build --city Helsinki --sources osm| Package | Version | Purpose |
|---|---|---|
| shapely | >=2.1.2, <3.0 | Geometry operations |
| geopandas | >=1.1.2, <2.0 | Geospatial DataFrames |
| pyproj | >=3.7.1, <4.0 | Coordinate transformations |
| pyogrio | >=0.10.0 | Vector I/O |
| numpy | >=2.2.0, <3.0 | Numerical arrays |
| pandas | >=2.3.0, <4.0 | Tabular data |
| h3 | >=4.1.0, <5.0 | Hexagonal spatial index |
| rasterio | >=1.4.3, <2.0 | Raster I/O |
| xarray | >=2023.1.0 | Multidimensional arrays |
| pydantic | >=2.12.0, <3.0 | Data validation |
| pydantic-settings | >=2.7.0, <3.0 | Configuration |
| qdrant-client | >=1.17.0, <2.0 | Vector store client |
| fastembed | >=0.4.2, <1.0 | Embedding models |
| rank-bm25 | >=0.2.2 | BM25 sparse retrieval |
| litellm | >=1.57.0, <2.0 | LLM abstraction |
| mcp | >=1.4.0, <2.0 | Model Context Protocol |
| pystac-client | >=0.8.5, <1.0 | STAC catalog access |
| rio-cogeo | >=5.4.0, <8.0 | Cloud-optimized GeoTIFF |
| httpx | >=0.28.0, <1.0 | HTTP client |
| Pillow | >=11.1.0, <13.0 | Image processing |
| APScheduler | >=3.11.0, <4.0 | Task scheduling |
| structlog | >=25.1.0, <26.0 | Structured logging |
| typer | >=0.15.0, <1.0 | CLI framework |
| Extra | Packages | Purpose |
|---|---|---|
| clip | transformers, torch | CLIP ViT-B/32 for street imagery |
| sentinelhub | sentinelhub | Sentinel Hub Process API |
| dev | ruff, mypy, pytest, mkdocs, pre-commit | Development tooling |
---
git clone https://github.com/olaflaitinen/citysense.git
cd citysense
pip install -e ".[dev]"
---
citysense index build --city Helsinki --country fi --sources osm
citysense index build --city Helsinki --country fi --sources osm
City + country input
|
v
OSMConnector.fetch(bbox)
|
v
GeoDataFrame normalization
|
v
H3 assignment + chunk text
|
v
Embedding generation
|
v
Qdrant upsert
git clone https://github.com/olaflaitinen/citysense.git
cd citysense
pip install -e ".[dev,clip]"
pre-commit install
CITYSENSE_PILOT_COUNTRY=fi
CITYSENSE_VECTOR_STORE_URL=http://localhost:6333
MAPILLARY_ACCESS_TOKEN=your_token
CDSE_CLIENT_ID=your_id
CDSE_CLIENT_SECRET=your_secret
---
```bash
| Extra | Purpose |
|---|---|
| clip | CLIP ViT-B/32 for street imagery embedding |
| sentinelhub | Sentinel Hub Process API |
| dev | ruff, mypy, pytest, mkdocs, pre-commit |
pip install "citysense[clip]"
pip install "citysense[dev]"
Configuration is read in priority order: environment variables (prefix CITYSENSE_), .env file at project root, defaults.
| Variable | Default | Description |
|---|---|---|
| CITYSENSE_PILOT_COUNTRY | None | Pilot key (az, fi fully available; se, dk, no reserved for upcoming profiles) |
| CITYSENSE_VECTOR_STORE_URL | http://localhost:6333 | Qdrant URL |
| CITYSENSE_EMBEDDING_MODEL | BAAI/bge-m3 | Text embedding model |
| MAPILLARY_ACCESS_TOKEN | None | Mapillary API token |
| CDSE_CLIENT_ID | None | Copernicus Data Space client ID |
| CDSE_CLIENT_SECRET | None | Copernicus Data Space client secret |
| Attribute | Description |
|---|---|
| country | ISO2 code |
| language | IETF BCP 47 tag |
| national_crs | EPSG string |
| default_cities | City name to BBox mapping |
| connector_priority | Ordered connector IDs |
| wuf13_primary_dimensions | WUF13 dimension tags |
| data_gaps | Known gaps and fallback strategies |
| informality_heuristic | SAR/spectral heuristic for tenure |
---
from citysense.pilot.az import AZ_CONFIG
from citysense.pilot.fi import FI_CONFIG
config = FI_CONFIG
print(config.country, config.national_crs, config.default_cities)
---
| Command | Description |
|---|---|
| citysense --version | Print package version |
| citysense pilot init <country> | Initialize pilot country in .env (az, fi, se, dk, no) |
| citysense pilot status | Show active pilot country |
| citysense index build --city <name> [--country <iso2>] | Build index for selected city |
| citysense index status [--country <iso2>] | Show Qdrant collection point count |
| citysense query <natural language> [--country <iso2>] [--city <name>] | Execute semantic spatial query |
| citysense serve --transport stdio | Start FastMCP server for local MCP clients |
| citysense serve --transport sse --port 7832 | SSE transport placeholder (status output) |
Notes: - index build currently uses the OSM connector path. - --sources is present for forward compatibility and not fully wired yet. - index build city routing is currently optimized for Helsinki and Baku.
All spectral indices are computed from Sentinel-2 L2A surface reflectance bands.
| Band ID | Centre Wavelength (nm) | Resolution (m) |
|---|---|---|
| B02 | 490 (Blue) | 10 |
| B03 | 560 (Green) | 10 |
| B04 | 665 (Red) | 10 |
| B08 | 842 (NIR broad) | 10 |
| B11 | 1610 (SWIR-1) | 20 |
| B12 | 2190 (SWIR-2) | 20 |
| Resolution | Avg hexagon area (km^2) | Use case |
|---|---|---|
| 5 | 252.9 | City-scale analysis |
| 6 | 36.1 | District-scale |
| 7 | 5.2 | Neighborhood-scale |
| 8 | 0.74 | Block-scale |
| 9 | 0.11 | Building-scale |
| Module | Responsibility |
|---|---|
| citysense.cli | Typer-based command-line interface |
| citysense.core | Configuration, session, logging, registry, exceptions |
| citysense.geo | CRS, H3, bbox, geometry, OSM utilities |
| citysense.connectors | OSM, Mapillary, KartaView, Sentinel, base connector |
| citysense.rag | Intent parsing, retriever, embedder, reranker, assembler |
| citysense.imagery | Street and satellite processing |
| citysense.housing | Housing analytics primitives |
| citysense.governance | Governance-related scoring hooks |
| citysense.urban | SDG 11 indicators |
| citysense.climate | Resilience scoring |
| citysense.realtime | Realtime stream utilities |
| citysense.pilot | Country-specific configurations |
| citysense.mcp | MCP server and tools |
```bash
| Issue | Cause | Resolution |
|---|---|---|
| Qdrant connection refused | Qdrant not running | Start Qdrant: docker run -p 6333:6333 qdrant/qdrant |
| Index empty after build | Connector returned no data | Check city name, pilot config, OSM coverage |
| Mapillary 401 | Invalid or missing token | Set MAPILLARY_ACCESS_TOKEN |
| CDSE auth failure | Invalid credentials | Set CDSE_CLIENT_ID, CDSE_CLIENT_SECRET |
| CRS transform error | Mismatched EPSG | Verify pilot national_crs |
| H3 antimeridian error | Query crosses date line | Use bbox that does not span antimeridian |
---
CitySense 是一个专为城市智能分析设计的开源 Python 库,集成了地理空间检索增强生成(Geospatial RAG)与 MCP 工具集。它能够将自然语言意图解析与地理空间索引相结合,通过 MCP server 为 Cursor、Claude 和 VS Code 提供原生支持,让开发者能够以极低的样板代码量实现对城市上下文的智能查询。本项目紧密结合联合国可持续发展目标 SDG 11、新城市议程及 WUF13 框架,适用于研究级城市分析与试点国家的工作流。
CitySense 提供强大的地理空间 AI 能力:支持通过自然语言进行语义检索,实现对地理空间知识库的意图解析;采用多源架构,内置了 OSM、Sentinel-2、Mapillary 和 KartaView 的连接器模块;原生集成 Model Context Protocol (MCP) server,完美适配主流 AI 编辑器;同时具备 WUF13 标准对齐的 Schema 设计,确保城市数据分析符合国际标准。
运行 CitySense 需要 Python 3.12 或 3.13 环境。系统必须配置并运行 Qdrant 向量数据库(默认地址为 http://localhost:6333)。此外,由于涉及地理空间计算,建议通过 conda 安装 GDAL 3.10+ 版本以支持 rasterio 和 geopandas。如果需要使用卫星影像或街景功能,还需根据需求安装特定的 Connector Modules(如 clip 或 sentinelhub)并配置相应的 API 访问令牌。
你可以通过多种方式安装 CitySense。对于开发者,推荐使用可编辑模式进行源码安装:通过 git clone 项目仓库后,执行 `pip install -e ".[dev]"`。对于普通用户,可以使用 pip 安装基础版或包含扩展功能的版本(如 `pip install "citysense[clip]"`)。安装完成后,请务必确保 Qdrant 服务已启动,并根据需���通过 CLI 命令构建索引(如使用 OSM 数据源)。
快速上手指南:首先,请配置好 `.env` 文件,设置必要的环境变量(如 `CITYSENSE_PILOT_COUNTRY` 和 `CITYSENSE_VECTOR_STORE_URL`)。接着,使用 CLI 工具构建城市索引,例如:`citysense index build --city Helsinki --country fi --sources osm`。构建完成后,你即可通过命令行或集成 MCP 的 AI 工具对特定城市的地理空间数据进行交互式查询。
项目配置遵循优先级顺序:环境变量(以 `CITYSENSE_` 为前缀) > 项目根目录下的 `.env` 文件 > 系统默认值。你可以通过环境变量灵活配置 Qdrant URL、Embedding 模型(默认使用 BAAI/bge-m3)以及各类影像服务的 API 凭证(如 `MAPILLARY_ACCESS_TOKEN` 和 `CDSE_CLIENT_ID`)。对于开发环境,可以通过 `pip install "citysense[dev]"` 获取 ruff、mypy 等工具。
CitySense 提供了一套完整的 CLI 命令行接口,用于管理试点国家配置、构建索引及查看状态。核心命令包括 `citysense pilot init <country>` 用于初始化试点环境,以及 `citysense index build` 用于数据索引构建。此外,系统内置了针对 Sentinel-2 卫星波段的参考标准,确保所有光谱指数的计算均基于 L2A ���表反射率波段,保证了地理空间分析的科学性。
项目采用模块化设计:`citysense.cli` 基于 Typer 构建命令行界面;`citysense.core` 负责配置、会话、日志及异常处理;`citysense.geo` 处理 CRS、H3、bbox 及 OSM 工具函数;`citysense.connectors` 则负责与 OSM、Mapillary、KartaView 和 Sentinel 等外部数据源进行对接。这种结构确保了从数据采集到 RAG 检索再到 AI 交互的完整工作流能够高效运行。
常见问题解答:若遇到 Qdrant 连接拒绝,请检查 Docker 容器是否正常运行(建议使用 `docker run -p 6333:6333 qdrant/qdrant`);若构建索引后发现数据为空,请核对城市名称、试点国家配置及 OSM 数据覆盖范围;若 Mapillary 接口返回 401 错误,通常是由于 Access Token 无效或过期所致。通过检查环境变量与连接器状态,可以解决大部分集成问题。
CitySense是一款开源的Python库,提供了地理空间数据处理和分析功能。它可以帮助开发者更好地理解城市数据,提高城市规划和管理的效率。然而,CitySense的使用和安装需要一定的技术基础。
该工具使用 EUPL-1.2 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 EUPL-1.2 — 请查阅原始协议条款了解具体使用限制。
AI Skill Hub 点评:CitySense 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | citysense |
| 原始描述 | 开源MCP工具:CitySense is an open-source Python library that bridges geospatial urban data wi。⭐11 · Python |
| Topics | geopandasgeospatialopenstreetmappython |
| GitHub | https://github.com/olaflaitinen/citysense |
| License | EUPL-1.2 |
| 语言 | Python |
收录时间:2026-05-23 · 更新时间:2026-05-26 · License:EUPL-1.2 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端