Logo: GeoServer MCP 服务器

GeoServer MCP 服务器

Communautéit
mahdin75

A Model Context Protocol (MCP) server implementation that connects LLMs to the GeoServer REST API

Editeurmahdin75
Repositorygeoserver-mcp
SproochJava
Forks
26
Stären
92
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    GeoServer MCP 服务器 bitt MCP-Funktiounen un, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • Disponibel Tools: 0

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an deem MCP-Client ze konfiguréieren, deen Dir am léifste benotzt.

  • Interessi vun der Communautéit um Open-Source-Projet

    Zuele vum verlinkte Repository – Stären: 92, Forks: 26.

PyPI Downloads

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

📋 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.

text
                    GeoServer MCP
                         │
             ┌───────────┴───────────┐
             │                       │
      Python MCP Server       GeoServer Extension
             │                       │
             ▼                       ▼
        GeoServer                GeoServer
             │                       │
             └───────────┬───────────┘
                         │
                    MCP Interface
                         │
                         ▼
                     AI Agents

Python 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:

bash
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
  1. Run geoserver-mcp:
bash
docker pull mahdin75/geoserver-mcp
docker run -d mahdin75/geoserver-mcp
  1. Configure the clients:

If you are using Claude Desktop, edit claude_desktop_config.json If you are using Cursor, Create .cursor/mcp.json

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
  1. Install uv package manager.
bash
pip install uv
  1. Create the Virtual Environment (Python 3.10+):

Linux/Mac:

bash
uv venv --python=3.10

Windows PowerShell:

bash
uv venv --python=3.10
  1. Install the package using pip:
bash
uv pip install geoserver-mcp
  1. Configure GeoServer connection:

Linux/Mac:

bash
export GEOSERVER_URL="http://localhost:8080/geoserver"
export GEOSERVER_USER="admin"
export GEOSERVER_PASSWORD="geoserver"

Windows PowerShell:

powershell
$env:GEOSERVER_URL="http://localhost:8080/geoserver"
$env:GEOSERVER_USER="admin"
$env:GEOSERVER_PASSWORD="geoserver"
  1. 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:

bash
source .venv/bin/activate

geoserver-mcp

or

bash
source .venv/bin/activate

geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debug

Windows PowerShell:

bash
.\.venv\Scripts\activate
geoserver-mcp

or

bash
.\.venv\Scripts\activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debug
  1. Configure Clients:

If you are using Claude Desktop, edit claude_desktop_config.json If you are using Cursor, Create .cursor/mcp.json

Windows:

json
{
  "mcpServers": {
    "geoserver-mcp": {
      "command": "C:\\path\\to\\geoserver-mcp\\.venv\\Scripts\\geoserver-mcp",
      "args": [
        "--url",
        "http://localhost:8080/geoserver",
        "--user",
        "admin",
        "--password",
        "geoserver"
      ]
    }
  }
}

Linux:

json
{
  "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
  1. Install uv package manager.
bash
pip install uv
  1. Create the Virtual Environment (Python 3.10+):
bash
uv venv --python=3.10
  1. Install the package using pip:
bash
uv pip install -e .
  1. Configure GeoServer connection:

Linux/Mac:

bash
export GEOSERVER_URL="http://localhost:8080/geoserver"
export GEOSERVER_USER="admin"
export GEOSERVER_PASSWORD="geoserver"

Windows PowerShell:

powershell
$env:GEOSERVER_URL="http://localhost:8080/geoserver"
$env:GEOSERVER_USER="admin"
$env:GEOSERVER_PASSWORD="geoserver"
  1. 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:

bash
source .venv/bin/activate

geoserver-mcp

or

bash
source .venv/bin/activate

geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debug

Windows PowerShell:

bash
.\.venv\Scripts\activate
geoserver-mcp

or

bash
.\.venv\Scripts\activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debug
  1. Configure Clients:

If you are using Claude Desktop, edit claude_desktop_config.json If you are using Cursor, Create .cursor/mcp.json

Windows:

json
{
  "mcpServers": {
    "geoserver-mcp": {
      "command": "C:\\path\\to\\geoserver-mcp\\.venv\\Scripts\\geoserver-mcp",
      "args": [
        "--url",
        "http://localhost:8080/geoserver",
        "--user",
        "admin",
        "--password",
        "geoserver"
      ]
    }
  }
}

Linux:

json
{
  "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 --storage flag 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 --storage is not set, paths are resolved as provided by the user (relative to working directory or absolute).

CLI Example

sh
python -m geoserver_mcp.main --storage D:/my/data/dir

This sets D:/my/data/dir as the base path for all files.

Example tool call in Python:

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.:

sh
docker run -v D:/my/data:/opt/data ...

Then launch the server with:

sh
python -m geoserver_mcp.main --storage /opt/data

Best 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 URIDescription
geoserver://catalog/workspacesList available workspaces
geoserver://catalog/layers/{workspace}/{layer}Get information about a specific layer
geoserver://services/wms/{request}Handle WMS resource requests
geoserver://services/wfs/{request}Handle WFS resource requests

📦 Workspace Management

ToolDescription
list_workspacesList available workspaces in GeoServer
create_workspaceCreate a new workspace in GeoServer

📁 Datastore & Coveragestore Management

ToolDescription
create_datastoreCreate a new datastore in the given workspace
create_featurestoreCreate a new featurestore in the given workspace
create_gpkg_datastoreCreate a GeoPackage (GPKG) datastore
create_shp_datastoreCreate an ESRI Shapefile datastore
create_coveragestoreCreate a new coveragestore in a workspace
delete_coveragestoreDelete a coveragestore from a workspace
get_coveragestoreGet details about a single coveragestore
get_coveragestoresGet all coveragestores for a workspace
get_datastoreGet a specific datastore by name
get_datastoresList all datastores in the given workspace

🗺️ Layer Management

ToolDescription
get_layer_infoGet detailed information about a layer
list_layersList layers in GeoServer, optionally filtered by workspace
create_layerCreate a new layer in GeoServer
delete_resourceDelete a resource from GeoServer (generic)

🧩 Layer Group Management

ToolDescription
create_layergroupCreate a new layer group with specific layers and (optionally) styles
get_layergroupGet a layer group from a workspace
get_layergroupsList all layer groups in a workspace
add_layer_to_layergroupAdd a specific layer to a layer group
remove_layer_from_layergroupRemove a layer from a group
delete_layergroupDelete a layer group from a workspace
update_layergroupUpdate a layer group's details and configuration

👥 User & User Group Management

ToolDescription
create_userCreate a new user for GeoServer security
delete_userDelete a user by name
get_all_usersList all users in the GeoServer instance
modify_userModify an existing user's properties
create_usergroupCreate a new user group
delete_usergroupDelete a user group
get_all_usergroupsReturn all user groups

📊 Feature Type & Attribute Management

ToolDescription
query_featuresQuery features from a vector layer using CQL filter
publish_featurestorePublish an existing featurestore
publish_featurestore_sqlviewPublish a featurestore using a SQL view definition
edit_featuretypeEdit the settings of a feature type in a store
get_featuretypesList all feature types in a given store
get_feature_attributeGet feature attribute schema/details

🎨 Style Management

ToolDescription
create_styleCreate a new SLD style in GeoServer
publish_styleAssign/publish a style to a layer
create_catagorized_featurestyleCreate a categorized style for features
create_classified_featurestyleCreate a classified style for features
create_coveragestyleCreate a raster coverage style
create_outline_featurestyleCreate a simple outline-only style for features

⚙️ System & Service Operations

ToolDescription
get_manifestGet GeoServer manifest metadata/details
get_statusObtain general server status
get_system_statusGet system status overview/info from GeoServer
get_versionFetch GeoServer version string
reload_geoserverReload catalog and config from disk
reset_geoserverReset all GeoServer caches/connections
update_serviceUpdate selected OGC service options
publish_time_dimension_to_coveragestoreAdd or update a time dimension for a coverage store (for time series)

📝 Style XML Utilities

ToolDescription
style_catagorize_xmlGenerate SLD for categorized vector style
style_classified_xmlGet SLD XML for classified vector style
style_coverage_style_colormapentryGenerate color map entries for raster SLD
style_coverage_style_xmlGenerate XML for raster/coverage SLD
style_outline_only_xmlXML 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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

🌐 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

MseeP.ai Security Assessment Badge

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "mahdin75-geoserver-mcp": {
      "command": "uvx",
      "args": [
        "geoserver-mcp"
      ]
    }
  }
}

GeoServer MCP 服务器 MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal GeoServer MCP 服务器 verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung, fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector: D'Optioun „Dësen Apparat“ ass ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Setzt de kopéierte Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

GeoServer MCP 服务器 als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a setzt d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Setzt d'MCP-Serverkonfiguratioun fir GeoServer MCP 服务器 an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert d'Säit, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "mahdin75-geoserver-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "geoserver-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vun der Integratioun GeoServer MCP 服务器. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vun der Integratioun GeoServer MCP 服务器.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierten MCP-Tools an engem ausgewielte KI-Modell
Kënnt Dir mir mat GeoServer MCP 服务器 bei dëser Aufgab hëllefen?
GeoServer MCP 服务器
Jo. Ech hunn et gelies.
Dat hunn ech mat GeoServer MCP 服务器 fonnt.

Heefeg gestallte Froen

Fir wat gëtt den MCP-Server GeoServer MCP 服务器 benotzt?

GeoServer MCP 服务器 ass en MCP-Server, deen et kompatibele KI-Clienten erlaabt, op extern Tools a Kontextinformatioune zouzegräifen. An TypingMind kënnt Dir dësen MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech GeoServer MCP 服务器 MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir GeoServer MCP 服务器 mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni den MCP-Server fir all Modell separat anzeriichten.

Firwat GeoServer MCP 服务器 MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann GeoServer MCP 服务器 verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Ären Aarbechtsoflaf beim Chatten an TypingMind organiséieren.

Wéi verbannen ech GeoServer MCP 服务器 MCP mat TypingMind?

GeoServer MCP 服务器 leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann den MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt GeoServer MCP 服务器 MCP an TypingMind zur Verfügung?

GeoServer MCP 服务器 stellt MCP-Funktioune zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agente zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir GeoServer MCP 服务器 MCP ze benotzen?

Nee. TypingMind ass nom Local-first-Prinzip opgebaut a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann GeoServer MCP 服务器 eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir deen MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇