Skip to main content

MCP (Model Context Protocol) server for GeoServer - enables AI assistants to manage GeoServer workspaces, datastores, layers, and styles through natural language

Project description

GeoServer MCP Server

mcp-name: io.github.ronitjadhav/geoservercloud-mcp

A Model Context Protocol (MCP) server that exposes GeoServer REST API functionality for natural language interaction through AI assistants like Claude, VS Code Copilot, and other MCP-compatible clients.

About

This MCP server wraps the python-geoservercloud library, exposing 80+ GeoServer operations as MCP tools. This enables AI assistants to manage GeoServer workspaces, datastores, layers, styles, and more through natural language commands.

Example Interactions

Once connected, you can ask your AI assistant things like:

  • "List all workspaces in GeoServer"
  • "Create a new workspace called 'test_data'"
  • "What layers are available in the 'topp' workspace?"
  • "Create a PostGIS datastore connection"

Quick Start

Option 1: Full Local Development Stack

Start the MCP server with a local GeoServer and PostGIS:

cd mcp
docker compose up -d

This starts:

  • geoservercloud-mcp: The MCP server on port 8000
  • geoserver: GeoServer instance on port 8080
  • postgis: PostGIS database on port 5433

Option 2: MCP Server Only (Connect to External GeoServer)

If you have an existing GeoServer:

cd mcp
GEOSERVER_URL=http://your-geoserver:8080/geoserver \
GEOSERVER_USER=admin \
GEOSERVER_PASSWORD=your-password \
docker compose up -d geoservercloud-mcp

Connecting to AI Clients

VS Code / Cursor

  1. Open Command Palette → "MCP: Add Server"
  2. Select "Command (stdio)"
  3. Enter command: poetry run geoservercloud-mcp
  4. Enter server ID: geoserver

VS Code will create an MCP configuration file. Update it with the working directory and environment variables:

{
  "servers": {
    "geoserver": {
      "type": "stdio",
      "command": "poetry",
      "args": ["run", "geoservercloud-mcp"],
      "cwd": "/path/to/python-geoservercloud",
      "env": {
        "GEOSERVER_URL": "http://localhost:8080/geoserver",
        "GEOSERVER_USER": "admin",
        "GEOSERVER_PASSWORD": "geoserver"
      }
    }
  }
}

Claude Desktop

Add to your Claude Desktop config:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "geoserver": {
      "command": "poetry",
      "args": ["run", "geoservercloud-mcp"],
      "cwd": "/path/to/python-geoservercloud",
      "env": {
        "GEOSERVER_URL": "http://localhost:8080/geoserver",
        "GEOSERVER_USER": "admin",
        "GEOSERVER_PASSWORD": "geoserver"
      }
    }
  }
}

Restart Claude Desktop after saving the configuration.


Testing with FastMCP Inspector

The MCP server includes a built-in inspector UI for debugging:

# From project root
poetry install
poetry run fastmcp dev geoservercloud/mcp/server.py

Open http://127.0.0.1:6274 in your browser to test individual tools.


Environment Variables

Variable Default Description
GEOSERVER_URL http://localhost:8080/geoserver GeoServer base URL
GEOSERVER_USER admin GeoServer username
GEOSERVER_PASSWORD geoserver GeoServer password

Docker Commands

# Start all services
cd mcp
docker compose up -d

# Stop services
docker compose down

# Stop and remove volumes (data)
docker compose down -v

# View logs
docker compose logs -f geoservercloud-mcp

Python Library

This MCP server is built on the python-geoservercloud library. For programmatic access without MCP, see the library documentation.

from geoservercloud import GeoServerCloud

geoserver = GeoServerCloud(
    url="http://localhost:8080/geoserver",
    user="admin",
    password="geoserver",
)
geoserver.create_workspace("my_workspace")

Full documentation: https://camptocamp.github.io/python-geoservercloud/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geoservercloud_mcp-0.1.4.tar.gz (16.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geoservercloud_mcp-0.1.4-py3-none-any.whl (16.2 MB view details)

Uploaded Python 3

File details

Details for the file geoservercloud_mcp-0.1.4.tar.gz.

File metadata

  • Download URL: geoservercloud_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 16.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.10 Linux/6.14.0-37-generic

File hashes

Hashes for geoservercloud_mcp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a2687400813d504c482193669e48cd766e01c9e8e1dc7ec94c885e1164cccad9
MD5 384b0aa82e1b238e2944379d7063efcb
BLAKE2b-256 8c903fa934c2e47eb0f2642d12c64633cb157064872c6b2ca4c1ccfa2e3e726e

See more details on using hashes here.

File details

Details for the file geoservercloud_mcp-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: geoservercloud_mcp-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 16.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.10 Linux/6.14.0-37-generic

File hashes

Hashes for geoservercloud_mcp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8444365d394858d8a1f5ee2ecd054eb0a24c029a75882e5c55730688d02ad5
MD5 a6d8e971e0a8efea29bb384a2c4f1080
BLAKE2b-256 592274262092b53aac2b6295eccaf357411c528ef5a524be715f2e62691f1b89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page