GeoServer MCP Server
The GeoServer MCP Server enables AI assistants to interact with geospatial data and services via the GeoServer REST API. It acts as a gateway using the Model Context Protocol (MCP) for managing geospatial resources.
Capabilities include:
🔍 List, create, and manage GeoServer workspaces and layers
🗺️ Execute spatial queries on vector data using CQL filters
🎨 Generate map images with WMS GetMap
🛠️ Create and apply SLD styles for map visualization
🗑️ Delete resources (workspaces, layers, styles, etc.)
📊 Retrieve detailed metadata about layers and workspaces
🌐 Interact with OGC-compliant web services (WMS, WFS)
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GeoServer MCP Server list all layers in the 'public' workspace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GeoServer MCP Server
Version 0.5.0 (Beta) is under active development and will be released shortly. We are open to contributions and welcome developers to join us in building this project.
🎥 Demo
Related MCP server: QGISMCP
📋 Table of Contents
🚀 Features
🔍 Query and manipulate GeoServer workspaces, layers, and styles
🗺️ Execute spatial queries on vector data
🎨 Generate map visualizations
🌐 Access OGC-compliant web services (WMS, WFS)
🛠️ Easy integration with MCP-compatible clients
🚀 Deployment Options
GeoServer MCP can run in two ways. They share the same product idea (MCP tools over GeoServer) but are separate artifacts. The Python package is unchanged.
GeoServer MCP
│
┌───────────┴───────────┐
│ │
Python MCP Server GeoServer Extension
│ │
▼ ▼
GeoServer GeoServer
│ │
└───────────┬───────────┘
│
MCP Interface
│
▼
AI AgentsPython MCP Server
Run GeoServer MCP separately (pip, Docker, or Smithery). The process speaks MCP to the agent and calls the GeoServer REST API. This is the original, currently published deployment.
See Installation below.
GeoServer Extension
Install the GeoServer MCP Extension directly into GeoServer and expose a remote MCP endpoint at /geoserver/mcp. No Python sidecar is required. Targets GeoServer 2.28.x.
See extension/README.md for architecture, installation, configuration, security, and client examples.
📋 Prerequisites
Python 3.10 or higher
Running GeoServer instance with REST API enabled
MCP-compatible client (like Claude Desktop or Cursor)
Internet connection for package installation
🛠️ Installation
Choose the installation method that best suits your needs:
Installing via Smithery
To install GeoServer MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mahdin75/geoserver-mcp --client claude🛠️ Installation (Docker)
The Docker installation is the quickest and most isolated way to run the GeoServer MCP server. It's ideal for:
Quick testing and evaluation
Production deployments
Environments where you want to avoid Python dependencies
Consistent deployment across different systems
Run geoserver-mcp:
docker pull mahdin75/geoserver-mcp
docker run -d mahdin75/geoserver-mcpConfigure the clients:
If you are using Claude Desktop, edit claude_desktop_config.json
If you are using Cursor, Create .cursor/mcp.json
{
"mcpServers": {
"geoserver-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GEOSERVER_URL=http://localhost:8080/geoserver",
"-e",
"GEOSERVER_USER=admin",
"-e",
"GEOSERVER_PASSWORD=geoserver",
"-p",
"8080:8080",
"mahdin75/geoserver-mcp"
]
}
}
}🛠️ Installation (pip)
The pip installation is recommended for most users who want to run the server directly on their system. This method is best for:
Regular users who want to run the server locally
Systems where you have Python 3.10+ installed
Users who want to customize the server configuration
Development and testing purposes
Install uv package manager.
pip install uvCreate the Virtual Environment (Python 3.10+):
Linux/Mac:
uv venv --python=3.10Windows PowerShell:
uv venv --python=3.10Install the package using pip:
uv pip install geoserver-mcpConfigure GeoServer connection:
Linux/Mac:
export GEOSERVER_URL="http://localhost:8080/geoserver"
export GEOSERVER_USER="admin"
export GEOSERVER_PASSWORD="geoserver"Windows PowerShell:
$env:GEOSERVER_URL="http://localhost:8080/geoserver"
$env:GEOSERVER_USER="admin"
$env:GEOSERVER_PASSWORD="geoserver"Start the server:
If you are going to use Claude desktop you don't need this step. For cursor or your own custom client you should run the following code.
Linux:
source .venv/bin/activate
geoserver-mcpor
source .venv/bin/activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debugWindows PowerShell:
.\.venv\Scripts\activate
geoserver-mcpor
.\.venv\Scripts\activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debugConfigure Clients:
If you are using Claude Desktop, edit claude_desktop_config.json
If you are using Cursor, Create .cursor/mcp.json
Windows:
{
"mcpServers": {
"geoserver-mcp": {
"command": "C:\\path\\to\\geoserver-mcp\\.venv\\Scripts\\geoserver-mcp",
"args": [
"--url",
"http://localhost:8080/geoserver",
"--user",
"admin",
"--password",
"geoserver"
]
}
}
}Linux:
{
"mcpServers": {
"geoserver-mcp": {
"command": "/path/to/geoserver-mcp/.venv/bin/geoserver-mcp",
"args": [
"--url",
"http://localhost:8080/geoserver",
"--user",
"admin",
"--password",
"geoserver"
]
}
}
}🛠️ Development installation
The development installation is designed for contributors and developers who want to modify the codebase. This method is suitable for:
Developers contributing to the project
Users who need to modify the source code
Testing new features
Debugging and development purposes
Install uv package manager.
pip install uvCreate the Virtual Environment (Python 3.10+):
uv venv --python=3.10Install the package using pip:
uv pip install -e .Configure GeoServer connection:
Linux/Mac:
export GEOSERVER_URL="http://localhost:8080/geoserver"
export GEOSERVER_USER="admin"
export GEOSERVER_PASSWORD="geoserver"Windows PowerShell:
$env:GEOSERVER_URL="http://localhost:8080/geoserver"
$env:GEOSERVER_USER="admin"
$env:GEOSERVER_PASSWORD="geoserver"Start the server:
If you are going to use Claude desktop you don't need this step. For cursor or your own custom client you should run the following code.
Linux:
source .venv/bin/activate
geoserver-mcpor
source .venv/bin/activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debugWindows PowerShell:
.\.venv\Scripts\activate
geoserver-mcpor
.\.venv\Scripts\activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debugConfigure Clients:
If you are using Claude Desktop, edit claude_desktop_config.json
If you are using Cursor, Create .cursor/mcp.json
Windows:
{
"mcpServers": {
"geoserver-mcp": {
"command": "C:\\path\\to\\geoserver-mcp\\.venv\\Scripts\\geoserver-mcp",
"args": [
"--url",
"http://localhost:8080/geoserver",
"--user",
"admin",
"--password",
"geoserver"
]
}
}
}Linux:
{
"mcpServers": {
"geoserver-mcp": {
"command": "/path/to/geoserver-mcp/.venv/bin/geoserver-mcp",
"args": [
"--url",
"http://localhost:8080/geoserver",
"--user",
"admin",
"--password",
"geoserver"
]
}
}
}File Storage and --storage Usage
GeoServer MCP server supports an optional --storage flag to specify a base directory for all file read/write operations, such as uploading shapefiles, GeoTIFFs, or exporting results.
Overview
The
--storageflag sets the root folder for file operations from all data-related tools.You may supply relative paths (relative to storage root) or absolute paths (bypassing the storage root) as arguments to relevant tools.
If
--storageis not set, paths are resolved as provided by the user (relative to working directory or absolute).
CLI Example
python -m geoserver_mcp.main --storage D:/my/data/dirThis sets D:/my/data/dir as the base path for all files.
Example tool call in Python:
# Will read from D:/my/data/dir/roads.zip if --storage is set to D:/my/data/dir
create_shp_datastore('workspace', 'datastore_name', 'roads.zip')Absolute paths (e.g. 'C:/input/other.shp') are always used as-is.
When Running in Docker
If using Docker, ensure the storage directory is mounted as a volume, e.g.:
docker run -v D:/my/data:/opt/data ...Then launch the server with:
python -m geoserver_mcp.main --storage /opt/dataBest Practices
Use relative paths when interacting with the API/tools as it keeps your setup portable.
For remote or container deployment, always ensure your file data is accessible within the container (use Docker volumes if needed).
Check tool docstrings for which arguments use the storage system.
The --storage system streamlines file management for all users and makes deployment much more flexible!
🛠️ Available Tools
This section details all the available tools and resources exposed by the GeoServer MCP server. These tools allow LLMs to interact with GeoServer's REST API for comprehensive geospatial data management.
🌍 Resource Endpoints
Resource endpoints provide direct access to GeoServer resources via a URI pattern.
Resource URI | Description |
| List available workspaces |
| Get information about a specific layer |
| Handle WMS resource requests |
| Handle WFS resource requests |
📦 Workspace Management
Tool | Description |
| List available workspaces in GeoServer |
| Create a new workspace in GeoServer |
📁 Datastore & Coveragestore Management
Tool | Description |
| Create a new datastore in the given workspace |
| Create a new featurestore in the given workspace |
| Create a GeoPackage (GPKG) datastore |
| Create an ESRI Shapefile datastore |
| Create a new coveragestore in a workspace |
| Delete a coveragestore from a workspace |
| Get details about a single coveragestore |
| Get all coveragestores for a workspace |
| Get a specific datastore by name |
| List all datastores in the given workspace |
🗺️ Layer Management
Tool | Description |
| Get detailed information about a layer |
| List layers in GeoServer, optionally filtered by workspace |
| Create a new layer in GeoServer |
| Delete a resource from GeoServer (generic) |
🧩 Layer Group Management
Tool | Description |
| Create a new layer group with specific layers and (optionally) styles |
| Get a layer group from a workspace |
| List all layer groups in a workspace |
| Add a specific layer to a layer group |
| Remove a layer from a group |
| Delete a layer group from a workspace |
| Update a layer group's details and configuration |
👥 User & User Group Management
Tool | Description |
| Create a new user for GeoServer security |
| Delete a user by name |
| List all users in the GeoServer instance |
| Modify an existing user's properties |
| Create a new user group |
| Delete a user group |
| Return all user groups |
📊 Feature Type & Attribute Management
Tool | Description |
| Query features from a vector layer using CQL filter |
| Publish an existing featurestore |
| Publish a featurestore using a SQL view definition |
| Edit the settings of a feature type in a store |
| List all feature types in a given store |
| Get feature attribute schema/details |
🎨 Style Management
Tool | Description |
| Create a new SLD style in GeoServer |
| Assign/publish a style to a layer |
| Create a categorized style for features |
| Create a classified style for features |
| Create a raster coverage style |
| Create a simple outline-only style for features |
⚙️ System & Service Operations
Tool | Description |
| Get GeoServer manifest metadata/details |
| Obtain general server status |
| Get system status overview/info from GeoServer |
| Fetch GeoServer version string |
| Reload catalog and config from disk |
| Reset all GeoServer caches/connections |
| Update selected OGC service options |
| Add or update a time dimension for a coverage store (for time series) |
📝 Style XML Utilities
Tool | Description |
| Generate SLD for categorized vector style |
| Get SLD XML for classified vector style |
| Generate color map entries for raster SLD |
| Generate XML for raster/coverage SLD |
| XML for outline-only style for a geometry |
🛠️ Client Development
If you're planning to develop your own client to interact with the GeoServer MCP server, you can find inspiration in the example client implementation at examples/client.py. This example demonstrates:
How to establish a connection with the MCP server
How to send requests and handle responses
Basic error handling and connection management
Example usage of various tools and operations
The example client serves as a good starting point for understanding the protocol and implementing your own client applications.
Also, here is the example usgage:
List Workspaces
Tool: list_workspaces
Parameters: {}
Response: ["default", "demo", "topp", "tiger", "sf"]
Get Layer Information
Tool: get_layer_info
Parameters: {
"workspace": "topp",
"layer": "states"
}
Query Features
Tool: query_features
Parameters: {
"workspace": "topp",
"layer": "states",
"filter": "PERSONS > 10000000",
"properties": ["STATE_NAME", "PERSONS"]
}
Generate Map
Tool: generate_map
Parameters: {
"layers": ["topp:states"],
"styles": ["population"],
"bbox": [-124.73, 24.96, -66.97, 49.37],
"width": 800,
"height": 600,
"format": "png"
}
🔮 Planned Features
Coverage and raster data management
Security and access control
Advanced styling capabilities
WPS processing operations
GeoWebCache integration
🤝 Contributing
We welcome contributions! Here's how you can help:
Fork the repository
Create a feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
Please ensure your PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Projects
Model Context Protocol - The core MCP implementation
GeoServer REST API - Official GeoServer REST documentation
GeoServer REST Python Client - Python client for GeoServer REST API
🌐 See Also: GIS MCP
For broader geospatial data automation and even more GIS-related MCP features, see GIS MCP by mahdin75.
📞 Support
For support, please Open an issue
🏆 Badges
Available Tools
9 toolscreate_layerC
Create a new layer in GeoServer.
Args:
workspace: The workspace for the new layer
layer: The name of the layer to create
data_store: The data store to use
source: The source data (file, table name, etc.)
Returns:
Dict with status and layer information
Inputs: data_store (required), layer (required), source (required), workspace (required).
create_styleB
Create a new SLD style in GeoServer.
Args:
name: Name for the style
sld: SLD XML content
workspace: Optional workspace for the style
Returns:
Dict with status and style information
Inputs: name (required), sld (required), workspace.
create_workspaceC
Create a new workspace in GeoServer.
Args:
workspace: Name of the workspace to create
Returns:
Dict with status and result information
Inputs: workspace (required).
delete_resourceC
Delete a resource from GeoServer.
Args:
resource_type: Type of resource to delete (workspace, layer, style, etc.)
workspace: The workspace containing the resource
name: The name of the resource
Returns:
Dict with status and result information
Inputs: name (required), resource_type (required), workspace (required).
generate_mapB
Generate a map image using WMS GetMap.
Args:
layers: List of layers to include (format: workspace:layer)
styles: Optional styles to apply (one per layer)
bbox: Bounding box [minx, miny, maxx, maxy]
width: Image width in pixels
height: Image height in pixels
format: Image format (png, jpeg, etc.)
Returns:
Dict with map information and URL
Inputs: layers (required), bbox, format, height, +2 more.
get_layer_infoC
Get detailed information about a layer.
Args:
workspace: The workspace containing the layer
layer: The name of the layer
Returns:
Dict with layer metadata
Inputs: layer (required), workspace (required).
list_layersB
List layers in GeoServer, optionally filtered by workspace.
Args:
workspace: Optional workspace to filter layers
Returns:
List of layer information dictionaries
Inputs: workspace.
list_workspacesB
List available workspaces in GeoServer.
Inputs: no named parameters.
query_featuresB
Query features from a vector layer using CQL filter.
Args:
workspace: The workspace containing the layer
layer: The layer to query
filter: Optional CQL filter expression
properties: Optional list of properties to return
max_features: Maximum number of features to return
Returns:
GeoJSON FeatureCollection with query results
Inputs: layer (required), workspace (required), filter, max_features, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose with no ambiguity. The tools cover different operations like creation (create_layer, create_style, create_workspace), deletion (delete_resource), retrieval (get_layer_info, list_layers, list_workspaces), querying (query_features), and visualization (generate_map). There is no overlap in functionality.
Tool names follow a consistent verb_noun pattern throughout, using snake_case. All tools start with a clear action verb (create, delete, generate, get, list, query) followed by a specific noun, making them predictable and readable.
With 9 tools, this server is well-scoped for managing a GeoServer instance. It covers essential operations for workspaces, layers, styles, and maps without being overly complex or too sparse, making it efficient for agents to handle geospatial data tasks.
The tool set provides comprehensive coverage for core GeoServer operations, including CRUD for layers, styles, and workspaces, along with querying and map generation. A minor gap exists in updating resources (e.g., update_layer or update_style), but agents can work around this by deleting and recreating.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Geospatial AI MCP server — satellite imagery, embeddings, weather, GNS governance
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.10,266 npm301MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that connects Claude AI to QGIS, enabling direct interaction with the GIS software for project creation, layer manipulation, code execution, and processing algorithms through natural language prompts.1510Creative Commons Zero v1.0 Universal
- AlicenseCqualityCmaintenanceA Model Context Protocol server that connects LLMs to GIS operations, enabling AI assistants to perform accurate geospatial analysis including geometric operations, coordinate transformations, and spatial measurements.87204MIT
- AlicenseBqualityDmaintenanceA server application that provides PostGIS database connection using Model Context Protocol (MCP), enabling spatial database functionality through natural language interactions.2221ISC