A Model Context Protocol (MCP) server for interacting with Esri file geodatabases (FGDB) and enterprise geodatabases (via SDE connection files) through ArcPy. This server provides tools for querying, modifying, and managing geodatabase datasets via the MCP protocol.
Version: 0.1.0
See the tutorial for more information about the Model Context Protocol.
Model Context Protocol server for Esri Databases (SDE and GDB). Enables AI assistants to interact with FGDB/SDE databases through AI Agent for data querying, modification, and schema management.
Connection Management: Connect to a file geodatabase (.gdb directory) or an enterprise geodatabase using a full absolute path to an SDE connection file (.sde)
Data Querying: Query feature classes and tables with filtering, field selection, and pagination
Data Modification: Insert, update, and delete records with safety confirmation workflows
Schema Management: Add and delete fields from datasets
Metadata Operations: List feature classes, describe datasets, and count records
Domains: List all geodatabase domains (coded values or ranges) and find feature classes and tables whose fields use a given domain
Safety System: Built-in confirmation workflow for high-risk operations
Comprehensive Logging: Configurable logging with rotation support
Error Handling: Standardized exception handling with custom error types
Requirements
System Requirements
Python: >= 3.10
ArcGIS Pro: Installed with ArcPy support (ArcPy is not installable via pip)
Operating System: Windows (ArcPy is primarily available on Windows)
Python Dependencies
mcp[cli] >= 1.21.0 - Model Context Protocol server framework
pydantic >= 2.0.0 - Data validation (installed as dependency of mcp)
ArcPy Requirements
ArcPy is provided by ArcGIS Pro and is only available in the ArcGIS Pro conda environment. It cannot be installed via pip. See the Installation section for setup instructions.
Installation
Clone the repository:
git clone <repository-url>
cd fgdb-mcp-server
Set up ArcPy environment:
Use the ArcGIS Pro conda environment directly:
# Activate ArcGIS Pro conda environment
& "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\proenv.bat"
conda activate arcgispro-py3
# Install your project dependencies
# Note: Run your terminal with Administrator privileges
pip install -e .
Verify ArcPy availability:
try:
import arcpy
print(f"ArcPy version: {arcpy.__version__}")
print("ArcPy is available!")
except ImportError:
print("ArcPy is not available")
Notes
ArcPy is only available when ArcGIS Pro is installed
The default ArcGIS Pro Python path is typically: C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\
The code already handles ArcPy unavailability gracefully with try/except blocks
MCP Client Configuration
To use this server with an MCP client, add the following configuration to your MCP client's configuration file (typically mcp.json):
FGDB_LOG_MAX_BYTES: Maximum log file size in bytes before rotation (default: 10485760 = 10MB)
FGDB_LOG_BACKUP_COUNT: Number of backup log files to keep (default: 5)
API Versioning
FGDB_API_VERSION: Current API version (default: v1)
FGDB_SUPPORTED_VERSIONS: Comma-separated list of supported API versions (default: v1)
Feature Flags
FGDB_FEATURE_EXPERIMENTAL: Enable experimental features (default: false)
Note: Mutating operations (insert, update, delete, add_field, delete_field) do not use feature flags. They are controlled by the safety confirmation system, which requires explicit user confirmation for each operation.
This server currently supports API Version 1 (v1). All endpoints are part of the v1 API.
Note: Product version (0.1.0) and API version (v1) are independent:
Product version tracks the software release (semantic versioning: major.minor.patch)
API version tracks the API contract (v1, v2, etc.) and changes when breaking API changes occur
API Version Information
Current API Version: v1
Supported API Versions: v1
Deprecation Policy: Endpoints will be marked as deprecated at least one version before removal
Version Configuration
The API version can be configured via environment variables:
# Set the default API version (default: v1)
$env:FGDB_API_VERSION = "v1"
# Specify supported API versions (comma-separated, default: v1)
$env:FGDB_SUPPORTED_VERSIONS = "v1"
Feature Flags
The server supports feature flags for experimental features. Mutating operations (insert, update, delete, add_field, delete_field) do not use feature flags - they are controlled by the safety confirmation system, which requires explicit user confirmation for each operation.
Available Feature Flags
Feature
Environment Variable
Default
Description
Experimental
FGDB_FEATURE_EXPERIMENTAL
false
Enable experimental features
Why No Feature Flags for Mutating Operations?
Mutating operations are protected by the safety confirmation system:
All mutating operations require explicit user confirmation via tokens
The agent cannot bypass the confirmation requirement
User confirmation is the authorization mechanism
Feature flags would be redundant since confirmation already provides the necessary control
Configuring Feature Flags
Feature flags can be set via environment variables:
# Enable experimental features (if any)
$env:FGDB_FEATURE_EXPERIMENTAL = "true"
API Reference
The server provides 13 MCP tools for geodatabase operations:
API Version 1 (v1) - Current
All endpoints below are part of the v1 API:
Connection & Discovery
set_database_connection (v1): Establishes a connection using a full absolute path to either a file geodatabase (directory ending in .gdb) or an SDE connection file (file ending in .sde). ArcPy uses that path as the workspace.
list_all_feature_classes (v1): Lists all feature classes available in the connected geodatabase
describe (v1): Returns metadata and schema information for a specified dataset (feature class or table)
count (v1): Returns the total number of records in a specified dataset
Domains
list_domains (v1): Lists all domains in the connected geodatabase with details (name, type, coded values or numeric range)
list_datasets_by_domain (v1): Lists feature classes and tables (including inside feature datasets) that have at least one field assigned the given domain; returns dataset paths and matching field names
Data Querying
select (v1): Queries records from a dataset with optional filtering, field selection, and pagination support
Supports SQL WHERE clauses
Field selection (returns all fields if not specified)
Pagination with configurable page size
Maximum limit protection (configurable, default: 50,000 records)
Data Modification
insert (v1): Inserts new records into a dataset (requires confirmation for medium-risk operations)
update (v1): Updates existing records based on WHERE clause (requires confirmation for medium-risk operations)
delete (v1): Deletes records from a dataset based on WHERE clause (requires confirmation for high-risk operations)
Schema Management
add_field (v1): Adds a new field to a dataset schema (requires confirmation for medium-risk operations)
delete_field (v1): Deletes a field from a dataset schema (requires confirmation for high-risk operations)
Safety & Confirmation
confirm_operation (v1): Confirms and executes pending high-risk or medium-risk operations using a confirmation token
Safety System
The server implements a safety system that requires confirmation for medium and high-risk operations:
Medium Risk: Requires confirmation (e.g., insert, update, add_field)
High Risk: Requires confirmation (e.g., delete, delete_field)
Extreme Risk: Blocked entirely
When a confirmation is required, the operation returns a confirmation token that must be used with the confirm_operation tool to execute the operation.
For questions, issues, or contributions, please use the GitHub issue tracker.
F
Fgdb
bgtdevhub·11 estrellas·
Model Context Protocol server for Esri Databases (SDE and GDB). Enables AI assistants to interact with FGDB/SDE databases through AI Agent for data querying, modification, and schema management.
Aún no hay lista de herramientas. Los servidores remotos la reciben tras la primera comprobación de estado.
Preguntas frecuentes
Preguntas
¿Cómo instalo Fgdb?
Copia en esta página la configuración stdio para Cursor, Claude Desktop, Claude Code o VS Code. Usa la instalación del publicador, no un proxy de PlugMCP.
¿Fgdb necesita una clave de API?
Este registro no indica ninguna variable de entorno obligatoria.
¿Qué transporte usa Fgdb?
Fgdb se ejecuta localmente por stdio.
¿Cuándo se comprobó Fgdb por última vez?
Última comprobación: 2026-11-05. Model Context Protocol server for Esri Databases (SDE and GDB). Enables AI assistants to interact with FGDB/SDE databases through AI Agent for data querying, modification, and schema management.