Skip to main content
Glama
GeoServer MCP Server

GeoServer MCP Server

by mahdin75

Servidor MCP de GeoServer

Alfa

La versión 0.4.0 (Alfa) está en desarrollo activo y se lanzará próximamente. Estamos abiertos a contribuciones y damos la bienvenida a los desarrolladores a unirse a este proyecto.

🎥 Demostración

Related MCP server: QGISMCP

📋 Índice de contenidos

🚀 Características

  • 🔍 Consultar y manipular espacios de trabajo, capas y estilos de GeoServer

  • 🗺️ Ejecutar consultas espaciales en datos vectoriales

  • 🎨 Generar visualizaciones de mapas

  • 🌐 Acceda a servicios web compatibles con OGC (WMS, WFS)

  • 🛠️ Fácil integración con clientes compatibles con MCP

📋 Requisitos previos

  • Python 3.10 o superior

  • Ejecución de una instancia de GeoServer con la API REST habilitada

  • Cliente compatible con MCP (como Claude Desktop o Cursor)

  • Conexión a Internet para la instalación del paquete

🛠️ Instalación

Elija el método de instalación que mejor se adapte a sus necesidades:

🛠️ Instalación (Docker)

La instalación de Docker es la forma más rápida y aislada de ejecutar el servidor GeoServer MCP. Es ideal para:

  • Pruebas y evaluaciones rápidas

  • Despliegues de producción

  • Entornos en los que desea evitar las dependencias de Python

  • Implementación consistente en diferentes sistemas

  1. Ejecute geoserver-mcp:

docker pull mahdin75/geoserver-mcp
docker run -d mahdin75/geoserver-mcp
  1. Configurar los clientes:

Si está usando Claude Desktop, edite claude_desktop_config.json Si está usando Cursor, cree .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"
      ]
    }
  }
}

🛠️ Instalación (pip)

Se recomienda la instalación de pip para la mayoría de los usuarios que desean ejecutar el servidor directamente en su sistema. Este método es ideal para:

  • Usuarios habituales que quieran ejecutar el servidor localmente

  • Sistemas donde tenga instalado Python 3.10+

  • Usuarios que quieran personalizar la configuración del servidor

  • Fines de desarrollo y prueba

  1. Instalar el administrador de paquetes uv.

pip install uv
  1. Crear el entorno virtual (Python 3.10+):

Linux/Mac:

uv venv --python=3.10

Windows PowerShell:

uv venv --python=3.10
  1. Instale el paquete usando pip:

uv pip install geoserver-mcp
  1. Configurar la conexión GeoServer:

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"
  1. Iniciar el servidor:

Si va a usar el escritorio Claude, no necesita este paso. Para el cursor o su propio cliente personalizado, debe ejecutar el siguiente código.

Linux:

source .venv/bin/activate

geoserver-mcp

o

source .venv/bin/activate

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

Windows PowerShell:

.\.venv\Scripts\activate
geoserver-mcp

o

.\.venv\Scripts\activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debug
  1. Configurar clientes:

Si está usando Claude Desktop, edite claude_desktop_config.json Si está usando Cursor, cree .cursor/mcp.json

Ventanas:

{
  "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"
      ]
    }
  }
}

🛠️ Instalación de desarrollo

La instalación de desarrollo está diseñada para colaboradores y desarrolladores que desean modificar el código base. Este método es adecuado para:

  • Desarrolladores que contribuyen al proyecto

  • Usuarios que necesitan modificar el código fuente

  • Probando nuevas funciones

  • Fines de depuración y desarrollo

  1. Instalar el administrador de paquetes uv.

pip install uv
  1. Crear el entorno virtual (Python 3.10+):

uv venv --python=3.10
  1. Instale el paquete usando pip:

uv pip install -e .
  1. Configurar la conexión GeoServer:

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"
  1. Iniciar el servidor:

Si va a usar el escritorio Claude, no necesita este paso. Para el cursor o su propio cliente personalizado, debe ejecutar el siguiente código.

Linux:

source .venv/bin/activate

geoserver-mcp

o

source .venv/bin/activate

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

Windows PowerShell:

.\.venv\Scripts\activate
geoserver-mcp

o

.\.venv\Scripts\activate
geoserver-mcp --url http://localhost:8080/geoserver --user admin --password geoserver --debug
  1. Configurar clientes:

Si está usando Claude Desktop, edite claude_desktop_config.json Si está usando Cursor, cree .cursor/mcp.json

Ventanas:

{
  "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"
      ]
    }
  }
}

🛠️ Herramientas disponibles

🛠️ Gestión de espacios de trabajo y capas

Herramienta

Descripción

list_workspaces

Obtener espacios de trabajo disponibles

create_workspace

Crear un nuevo espacio de trabajo

get_layer_info

Obtener metadatos de capa detallados

list_layers

Enumerar capas en un espacio de trabajo

create_layer

Crear una nueva capa

delete_resource

Eliminar recursos

Operaciones de datos

Herramienta

Descripción

query_features

Ejecutar consultas CQL en datos vectoriales

update_features

Modificar atributos de características

delete_features

Eliminar funciones según criterios

🛠️ Visualización

Herramienta

Descripción

generate_map

Crear imágenes de mapas con estilo

create_style

Definir nuevos estilos SLD

apply_style

Aplicar estilos existentes a las capas

🛠️ Desarrollo de clientes

Si planea desarrollar su propio cliente para interactuar con el servidor GeoServer MCP, puede inspirarse en el ejemplo de implementación de cliente en examples/client.py . Este ejemplo demuestra:

  • Cómo establecer una conexión con el servidor MCP

  • Cómo enviar solicitudes y gestionar respuestas

  • Manejo básico de errores y gestión de conexiones

  • Ejemplo de uso de diversas herramientas y operaciones

El cliente de ejemplo sirve como un buen punto de partida para comprender el protocolo e implementar sus propias aplicaciones cliente.

Además, aquí está el ejemplo de uso:

Lista de espacios de trabajo


Tool: list_workspaces
Parameters: {}
Response: ["default", "demo", "topp", "tiger", "sf"]

Obtener información de la capa


Tool: get_layer_info
Parameters: {
"workspace": "topp",
"layer": "states"
}

Características de consulta


Tool: query_features
Parameters: {
"workspace": "topp",
"layer": "states",
"filter": "PERSONS > 10000000",
"properties": ["STATE_NAME", "PERSONS"]
}

Generar mapa


Tool: generate_map
Parameters: {
"layers": ["topp:states"],
"styles": ["population"],
"bbox": [-124.73, 24.96, -66.97, 49.37],
"width": 800,
"height": 600,
"format": "png"
}

🔮 Funciones planificadas

  • [ ] Gestión de cobertura y datos ráster

  • [ ] Seguridad y control de acceso

  • [ ] Capacidades de estilo avanzadas

  • [ ] Operaciones de procesamiento de WPS

  • [ ] Integración de GeoWebCache

🤝 Contribuyendo

¡Agradecemos tus contribuciones! Puedes ayudarnos de la siguiente manera:

  1. Bifurcar el repositorio

  2. Crear una rama de características ( git checkout -b feature/AmazingFeature )

  3. Confirme sus cambios ( git commit -m 'Add some AmazingFeature' )

  4. Empujar a la rama ( git push origin feature/AmazingFeature )

  5. Abrir una solicitud de extracción

Asegúrese de que la descripción de su solicitud de relaciones públicas describa claramente el problema y la solución. Incluya el número de problema correspondiente, si corresponde.

📄 Licencia

Este proyecto está licenciado bajo la licencia MIT: consulte el archivo de LICENCIA para obtener más detalles.

🔗 Proyectos relacionados

📞 Soporte

Para obtener ayuda, abra un problema.

🏆 Insignias

Available Tools

9 tools
create_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

    A3.5/5.0

    Scored across 9 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      A server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.
      12,706 npm
      302
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A 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.
      15
      10
      Creative Commons Zero v1.0 Universal
    • A
      license
      C
      quality
      D
      maintenance
      A 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.
      87
      208
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A server application that provides PostGIS database connection using Model Context Protocol (MCP), enabling spatial database functionality through natural language interactions.
      22
      21
      ISC