ArcGIS MCP Demo Repo
ArcGIS MCP Server
ArcGIS MCP Server exposes ArcGIS Online search and feature-layer analysis through both HTTP and MCP.
Attribution
This repository was started from and is based on Garrick Garcia's ArcGISMCP.
Credit to Garrick Garcia for the original project foundation and upstream work.
Disclaimer
This project is "vibe coded": it was assembled rapidly with AI-assisted iteration and should be reviewed, tested, and validated before production use.
Setup
Prerequisites
- Python 3.11+
uv- An ArcGIS Online account
1. Install uv
If needed, install uv first:
macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2. Create the Virtual Environment and Install Dependencies
uv sync
This creates .venv and installs the project plus its dependencies.
You do not need to activate the environment if you run commands through uv directly.
3. Configure Environment Variables
Create your local environment file from the example before you run the server.
macOS/Linux:
cp .env.example .env
Windows PowerShell:
Copy-Item .env.example .env
Windows Command Prompt:
copy .env.example .env
Then update .env with your ArcGIS credentials and any optional overrides:
ARCGIS_USERNAME=your_username
ARCGIS_PASSWORD=your_password
ARCGIS_URL=https://www.arcgis.com
ARCGISMCP_HOST=127.0.0.1
ARCGISMCP_PORT=8000
ARCGISMCP_CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
4. Run the Server
After .env is configured, start the server with uv:
uv run python main.py
When the server starts, these endpoints are available:
- REST API:
http://127.0.0.1:8000/ - Swagger docs:
http://127.0.0.1:8000/docs - MCP endpoint:
http://127.0.0.1:8000/mcp - Health check:
http://127.0.0.1:8000/health
/mcp is for MCP clients, not for manual browser testing.
What It Provides
search_layers: find matching feature layers and return REST layer URLsget_feature_table: return a sample of attribute rows as CSVsummarize_field: return stats and top values for one fieldsearch_content: search general ArcGIS content such as dashboards and web maps
Examples
Check the service
curl "http://127.0.0.1:8000/health"
Find feature layers
curl "http://127.0.0.1:8000/api/search/layers?keyword=Hydrants"
Example response shape:
{
"keyword": "Hydrants",
"count": 2,
"matches": [
{
"name": "Fire Hydrants",
"url": "https://services.arcgis.com/.../FeatureServer/0",
"item_title": "Fire Hydrants"
}
]
}
Preview a layer table
curl "http://127.0.0.1:8000/api/feature-table?service_url=https://services.arcgis.com/.../FeatureServer/0"
Summarize a field
curl "http://127.0.0.1:8000/api/field-summary?service_url=https://services.arcgis.com/.../FeatureServer/0&field_name=Status"
Search general ArcGIS content
curl "http://127.0.0.1:8000/api/search/content?keyword=Traffic&item_type=Dashboard"
Common Flow
- Call
search_layersor/api/search/layerswith a keyword. - Copy a returned feature layer URL.
- Call
get_feature_tableor/api/feature-tableto inspect fields. - Call
summarize_fieldor/api/field-summaryfor a field you care about.
Notes
- The server authenticates lazily using the credentials in
.env. get_feature_tablereturns a sample, not the full dataset.- Local frontend CORS is enabled by default for Vite-style localhost origins.