
ArcGIS MCP Bridge
io.github.muend由 GitHub 账号 muend 发布v0.6.8更新于 Oct 25, 2026
Secure local-first MCP server for licensed ArcGIS Pro and ArcPy on Windows.
概览
本地 Windows MCP 服务器,通过 100 个声明式地理处理工具,让助手调用已授权的 ArcGIS Pro ArcPy 引擎。
- 可以做什么
- 执行地理处理与分析:叠加、融合、连接、邻近、网络分析、空间统计、栅格地图代数、坡度与水文工具,以及坐标参考定义、投影和 CRS 查询。管理数据与地图:要素类和地理数据库生命周期、字段、Describe、Excel/GeoJSON/CSV 交换,以及 .aprx 图层顺序、可见性、符号和保存。编辑与校验:几何检查与修复、追加、去重、差异比较和拓扑校验,破坏性工具需显式确认令牌。导出布局为 PDF 或 PNG,可控制 DPI、地图框、文本和图例。通过图像配准把手绘草图照片转换为地理数据库要素类。
- 适用场景
- 适用于在 Windows 上拥有已授权 ArcGIS Pro 安装、希望助手直接对本地 GIS 数据执行 ArcPy 地理处理、地图文档操作、数据转换、布局导出或空间分析的场景,无需手动操作 ArcGIS Pro 或编写脚本。
- 运行要求
- Windows 上已授权的 ArcGIS Pro 安装,以及 Python 3.11 或更高版本。安装 PyPI 包并用安装命令克隆 ArcGIS Pro 的 Python 环境。必须设置 ARCPY_PYTHON_PATH 指向已授权的 worker 解释器;ARCGIS_MCP_ALLOWED_ROOTS、ARCGIS_MCP_SCRATCH_GDB(须已存在)和 ARCGIS_MCP_MAX_WORKERS 为可选。相关工具还需可选的 Spatial 和 Network 扩展许可。
安装
在 SourceWeft 中
- 打开 控制台中的 ArcGIS MCP Bridge,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[PyPI - Version] [PyPI - Downloads] [CI] [Python 3.11+] [License] [Tools] [Ruff] [uv] [arcgis-mcp-bridge MCP server] [smithery badge]
arcgis-mcp-bridge
Quick Start
arcgis-mcp-bridge requires Windows, a licensed ArcGIS Pro installation, and
Python 3.11 or newer for the bridge package.
Install the bootstrap package using one package manager:
Then clone ArcGIS Pro's Python environment:
If the installed console command is available on PATH,
arcgis-mcp-setup is equivalent to py -m arcgis_mcp.setup_env.
Important for Windows systems with multiple Python installations: the setup is not complete until
arcgis-mcp-bridgeis installed into the reportedarcgis-mcp-env\python.exe. Use that same interpreter for both the MCP servercommandandARCPY_PYTHON_PATH. This prevents worker failures caused by packages or native extensions being loaded from another Python environment.
See 05 — Installation for the complete setup and configuration.
100 declarative geoprocessing tools. Two isolated processes. One security floor.
A secure, local-first, asynchronous MCP server exposing ArcGIS Pro's ArcPy engine to Claude Desktop and other MCP hosts over stdio JSON-RPC.
Technical write-up: Building a Secure MCP Bridge for ArcGIS Pro and ArcPy
Why arcgis-mcp-bridge?
Highlight: Sketch → GIS Pipeline
Hand-drawn parcel boundary → photo → geodatabase feature class. ORB+RANSAC image registration, HSV ink segmentation, direct GDB commit. No manual digitizing required.
Demo coming soon. To preview the sketch-to-GIS pipeline:
- Draw a polygon on paper and photograph it.
- Ask Claude: "Use extract_sketch_to_gis to register this photo against my basemap and commit the result to my GDB."
- The feature class appears in ArcGIS Pro — no manual digitizing.
00 — Example Prompts
After health_check succeeds, talk to Claude naturally:
01 — Core Architecture & Philosophy
Layer A — Async Event-Driven Server (arcgis_mcp/server.py).
FastMCP on the bridge interpreter. Owns the stdio channel, validates every
request against frozen Pydantic v2 contracts, dispatches work via
asyncio.create_subprocess_exec — the event loop never blocks on a
geoprocessing call and never holds a thread lock. Layer A contains zero
module-level arcpy or cv2 imports (verified by grep in the audit
gate); it cannot crash on Esri's native code because it never touches it.
Layer B — Subprocess ArcPy Isolation Worker (arcgis_mcp/worker.py).
Spawned per job on the licensed ArcGIS Pro interpreter
(ARCPY_PYTHON_PATH). The only place import arcpy is legal; cv2 loads
lazily inside the one vision tool that needs it. Worker stdout is rebound
to stderr at startup — the single sanctioned stdout write is the final
NDJSON result frame, so native ArcObjects chatter can never corrupt the
JSON-RPC channel. A native crash terminates the worker, not the server:
the parent converts a non-zero exit into a structured error frame.
Declarative registry (arcgis_mcp/registry.py).
Each tool is one ToolSpec(name, category, description, input_model, worker_fn, destructive). One generic proxy factory materializes all 100
catalog MCP endpoints in Layer A; one generic run_tool dispatcher serves
them in Layer B. The catalog is exposed alongside three core endpoints:
health_check, list_layers, and execute_spatial_tool. Adding catalog
tool #101 touches two files — never the runtime loops.
Every failure crossing the process boundary is classified:
validation · security · not_found (an input path does not exist; the
message names the field and path) · license · geoprocessing (with the full
arcpy.GetMessages() stack, or ArcPy's own message for non-geoprocessing
calls such as Describe) · internal (exception type and message; the
traceback stays in the server log).
02 — The 100-Tool Census Matrix
Esri extension licenses (Spatial, Network) are managed through one shared
context manager and checked back in via finally on normal Python exception
paths. Worker-process isolation contains native failures to the current job,
while unavailable licenses return a structured error frame instead of
terminating the MCP server.
Destructive Mutation Safety Floor
Ten state-mutating tools refuse to run without an explicit
confirm: true payload token. The gate fires in the dispatcher before
the 10–30 s arcpy import is paid, and the registry refuses to even
register a destructive spec whose contract lacks a confirm field:
calculate_field carries an additional expression-channel floor: the
default expression_type is ARCADE (Esri's sandboxed expression
language), and PYTHON3 — which executes code inside the worker — is
rejected at the Layer-A contract boundary unless confirm: true is
explicitly supplied. raster_calculator expressions are constrained to a
pure map-algebra grammar (identifiers, numbers, operators; no quotes, no
dunder access) by a contract validator.
03 — Automated Quality Gate & Testing
Licensed-runtime evidence is reported separately in the
benchmarks/ method card. Its committed result uses a real
ArcGIS Pro worker and a dedicated scratch GDB; it is not pooled with the mocked
unit-test count or presented as validation of all 100 geoprocessing tools.
Scope, stated plainly: the automated gate currently consists of
86 unit tests spanning the PathGuard boundary, the Pydantic contracts,
the generic registry path-guard and registration invariants, the worker's
error-boundary mapping, and Settings environment validation. It exercises
the catalog's structural contracts and every security-critical seam — it does
not claim multi-scenario validation of the 100 geoprocessing tools themselves,
which execute against a licensed ArcGIS runtime that no CI runner has.
In-memory test architecture. tests/conftest.py injects MagicMock
proxies into sys.modules["arcpy"] and sys.modules["arcpy.sa"] (with
CheckExtension answering "Available") before any package import
resolves. The entire suite executes in well under a second, with no ArcGIS
installation, no license checkout, and no Esri runtime — locally and in CI
identically.
Test scopes.
tests/test_security.py&tests/test_pathguard.py— the PathGuard boundary firewall, exercised against real directories via pytest'stmp_pathfixture: valid reads/writes inside the sandbox pass; traversal (..-segments), UNC, relative, NUL-byte, reserved-device, over-length and out-of-root paths are rejected; write discipline (ArcGIS dataset-name rules, overwrite opt-in) is enforced.tests/test_contracts.py— Pydantic contract enforcement: per-tool parameter specs, cross-field validators,frozen/extra="forbid", and theok-xor-errorinvariant on the IPC envelope.tests/test_registry.py&tests/test_registry_guard.py— registry stream integrity plus genericapply_path_guardenforcement andregisterinvariants — every schema must be aToolInputsubclass, everypath_fieldsentry must reference a valid role, duplicate names are rejected, and every destructive spec must carry itsconfirmgate.tests/test_worker.py—process_frameerror-boundary mapping: every failure class (validation, security, license, geoprocessing, internal) maps to its distinctWorkerError.kind.tests/test_config.py—Settings.from_environmentvalidation: required variables, directory/file checks, integer bounds, and the fail-fast on a missing scratch geodatabase.
The side-effect import import arcgis_mcp.tools in the registry test is
what populates the catalog; it is # noqa-pinned so no linter ever strips
it again.
Static analysis. Ruff enforces canonical formatting plus
E/W/F/I/B/RUF at 88 columns against a py311 floor (code must parse on
the oldest supported interpreter — Layer B). Turkish comments are
first-class: the dotless ı/İ are registered under
allowed-confusables, so prose is configured around, never rewritten.
Mypy runs strict = true with the Pydantic plugin across all 31 source
files.
04 — Security Framework (PathGuard Sandbox)
Every filesystem argument in every contract declares its role —
"read", "write", or "read_list" — in the model's path_fields
mapping. One shared enforcement function applies those declarations in
both processes: Layer A pre-checks before a worker is ever spawned;
Layer B re-validates because it never trusts its parent.
Two boundary controls:
validate_read(raw: str)— fully resolves the path (symlinks,.., relative segments collapsed before any comparison) and requires containment inside a configuredallowed_rootsdirectory. Existence is enforced via a deepest-existing-prefix resolution strategy: the targeted path or its filesystem-resolvable geodatabase prefix must exist. This is what makes GDB-internal datasets (…\city.gdb\roads) first-class — the.gdbcontainer is validated on the filesystem, while the logical tail is constrained to plain dataset names only arcpy can resolve.validate_write(raw: str, *, overwrite: bool)— same resolution and containment, plus ArcGIS-legal dataset naming and the overwrite discipline: an existing target is never replaced unless the request explicitly setsoverwrite: true.
Any escape pattern — traversal sequences, UNC shares, NUL bytes, reserved
device names, out-of-root targets — raises PathSecurityError
immediately: the request is answered with a structured security frame
and no subprocess is ever orchestrated for it.
05 — 📦 Installation
Choose the onboarding path that matches your use case.
Prerequisites
- Windows with a licensed ArcGIS Pro installation
- Python 3.11 or newer for
arcgis-mcp-bridge - An existing writable directory for
ARCGIS_MCP_ALLOWED_ROOTS - An existing file geodatabase for
ARCGIS_MCP_SCRATCH_GDB, unless<first allowed root>\scratch.gdbalready exists
Path A: Pure PyPI Installation — Recommended for Windows Users
This is the simplest and most reliable setup for Claude Desktop and other MCP
hosts on Windows. The recommended configuration uses the same
arcgis-mcp-env\python.exe for both Layer A (the MCP server) and Layer B
(the ArcPy worker).
Choose one bootstrap installation command:
Then clone ArcGIS Pro's Python environment:
If the installed console command is available on PATH,
arcgis-mcp-setup is equivalent to py -m arcgis_mcp.setup_env.
Copy the python_exe value from the JSON report and assign it below:
Choose one installation command:
Do not run both commands; the second command already installs the standard
package together with the vision extra.
Use $ArcGISMcpPython as both the MCP server interpreter and
ARCPY_PYTHON_PATH. This prevents arcgis_mcp, Pydantic, pydantic-core,
and other native dependencies from being resolved from a different Python
installation.
Path B: Git Clone & Deterministic Development — GIS Contributors
This path keeps Layer A in a hermetic development environment while running
ArcPy work in a separately cloned, licensed arcgis-mcp-env worker.
Choose one worker-provisioning command:
--with-vision implies runtime-dependency installation, so the two commands
should not be run consecutively.
The setup command is idempotent, accepts --env-name (default:
arcgis-mcp-env) and --dry-run, and emits a JSON report. Set
ARCGIS_CONDA_EXE if ArcGIS Pro's conda.exe is not available on PATH.
Worker Interpreter Integrity
Layer B is launched as:
The interpreter referenced by ARCPY_PYTHON_PATH must be able to import the
complete worker stack:
For a first-time Windows installation, use the same
arcgis-mcp-env\python.exe for the server command and
ARCPY_PYTHON_PATH. Separate server and worker environments remain supported
for development, but the worker interpreter must contain its own compatible
installation of arcgis-mcp-bridge and all runtime dependencies.
Run this preflight check before configuring the MCP host:
Environment Variables
Claude Desktop Configuration
ARCPY_PYTHON_PATH is required in every configuration and must point to the
licensed interpreter reported by the setup command.
Replace every placeholder path below with an existing path on your machine. The scratch geodatabase must already exist.
Option 1: Unified PyPI Environment — Recommended on Windows
Use the same interpreter for the MCP server and ArcPy worker:
The command and ARCPY_PYTHON_PATH values should be identical in this
configuration. Use the python_exe value returned by the setup command.
Option 2: Local Git Development Environment
Use the repository .venv for Layer A and the provisioned
arcgis-mcp-env for Layer B:
This split-environment configuration assumes that the worker was provisioned
from the repository with one of the Path B setup commands above. PYTHONPATH
is not required when uv sync --locked has installed the project into the
repository .venv.
A globally resolved arcgis-mcp-server command can work, but it creates a
split-environment deployment. It is not recommended for first-time Windows
setup unless the worker environment has been provisioned and verified
separately.
After restarting the MCP host, call health_check first. It verifies the
server-to-worker IPC path and reports the selected worker interpreter without
importing ArcPy. Then run a read-only ArcGIS tool or the ArcPy preflight command
above to validate the licensed runtime.
06 — Troubleshooting
Worker process exited with code 1
If the MCP server starts but every ArcGIS tool fails, inspect the server log for the worker traceback. Common environment-related causes include:
These errors usually mean that the worker is using a different Python installation, the bridge was not installed into the worker interpreter, or the worker contains an incomplete or incompatible Pydantic installation. The recommended fix is the unified-environment configuration documented above.
For the recommended unified configuration, confirm that both values are identical:
Install or update the bridge inside that exact interpreter:
Verify the selected executable and bridge dependencies:
Then verify ArcPy separately:
If the bridge verification still fails specifically inside pydantic_core,
reinstall Pydantic in the same environment so pip restores the matching
compiled dependency:
Restart the MCP host completely after changing its Python environment or configuration.
ARCPY_PYTHON_PATH points to the wrong executable
A Windows conda environment normally places its interpreter at the environment root:
Do not use another global Python installation or a nonexistent
arcgis-mcp-env\Scripts\python.exe path.
Scratch geodatabase startup error
The default scratch workspace is:
It must already exist. Create it in ArcGIS Pro or set
ARCGIS_MCP_SCRATCH_GDB to an existing file geodatabase before restarting the
MCP host.
health_check succeeds but ArcGIS tools still fail
health_check intentionally verifies the server-to-worker process boundary
without importing ArcPy. A successful result confirms IPC and interpreter
selection, but it does not prove that ArcPy or an optional Esri extension
license can be loaded.
Run the ArcPy preflight command above and inspect the structured worker error
for not_found, license, geoprocessing, or internal details.
The first ArcGIS tool call times out
Every tool call starts a fresh worker that imports ArcPy. That usually takes
10–30 s, but a cold import has been measured at ~230 s on a machine where
real-time antivirus scans ArcGIS Pro's native DLLs; later calls are fast once
the DLLs are cached. Keep ARCGIS_MCP_TOOL_TIMEOUT at its 600 s default (or
higher) on such machines. Whether to exclude the ArcGIS Pro installation from
real-time scanning is a security decision for the machine's administrator.
import_from_geojson and geometry types
ArcPy's JSONToFeatures reads a .geojson file as polygons unless told
otherwise and silently drops other geometries. The bridge therefore detects the
geometry type from the file and passes it explicitly. A file that mixes points,
lines, and polygons is rejected with a count per type; import it once per type
with geometry_type set. An import that yields zero features fails loudly
instead of returning an empty feature class.
07 — Compatibility
Windows only. ArcPy requires a licensed ArcGIS Pro installation on Windows. Layer A can run on other platforms for development and mocked CI, but Layer B requires ArcGIS Pro.
The bridge package itself requires Python 3.11 or newer. ArcGIS Pro releases whose cloned Python environment is older than 3.11 cannot run the current worker package.
08 — License
Apache License 2.0. See LICENSE.
来源:README.md,提交 3f85729
工具
0版本历史
3- v0.6.8最新Oct 2, 2026
- v0.6.7Sep 26, 2026
- v0.6.6Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分