Skip to main content
Glama
mahdin75

GeoServer MCP Server

list_workspaces

Retrieve available workspaces in GeoServer to manage and organize geospatial data effectively through the MCP server.

Instructions

List available workspaces in GeoServer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_workspaces' MCP tool. It connects to GeoServer via get_geoserver(), retrieves the list of workspaces using geo.get_workspaces(), and returns them as a List[str]. Includes error handling with logging and raises ValueError on failure. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool() def list_workspaces() -> List[str]: """List available workspaces in GeoServer.""" geo = get_geoserver() if geo is None: raise ValueError("Not connected to GeoServer") try: # Use the actual GeoServer REST API to list workspaces workspaces = geo.get_workspaces() return workspaces except Exception as e: logger.error(f"Error listing workspaces: {str(e)}") raise ValueError(f"Failed to list workspaces: {str(e)}")

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mahdin75/geoserver-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server