geoservercloud-mcp 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,6 @@ Configuration via environment variables:
11
11
  """
12
12
 
13
13
  import os
14
- from functools import lru_cache
15
14
  from typing import Any
16
15
 
17
16
  from fastmcp import FastMCP
@@ -24,6 +23,11 @@ mcp = FastMCP(
24
23
  instructions="""
25
24
  GeoServer MCP provides tools for managing GeoServer via natural language.
26
25
 
26
+ IMPORTANT: Before using any GeoServer tools, you should:
27
+ 1. First call get_geoserver_connection_info() to check if configured
28
+ 2. If not configured or using wrong server, call configure_geoserver_connection()
29
+ to set the GeoServer URL, username, and password
30
+
27
31
  Available capabilities:
28
32
  - Workspaces: Create, list, get, delete workspaces
29
33
  - Datastores: Manage PostGIS, JNDI, PMTiles, and generic datastores
@@ -35,23 +39,22 @@ mcp = FastMCP(
35
39
  - Users & Roles: Manage GeoServer security
36
40
  - ACL Rules: Configure access control
37
41
  - OGC Services: WMS GetMap, WFS GetFeature, WMTS GetTile
38
-
39
- Before using tools, ensure GeoServer connection is configured via:
40
- - GEOSERVER_URL environment variable
41
- - GEOSERVER_USER environment variable
42
- - GEOSERVER_PASSWORD environment variable
43
42
  """,
44
43
  )
45
44
 
46
45
 
47
- @lru_cache(maxsize=1)
46
+ # Mutable configuration that can be updated at runtime
47
+ _geoserver_config: dict[str, str] = {
48
+ "url": os.getenv("GEOSERVER_URL", "http://localhost:8080/geoserver"),
49
+ "user": os.getenv("GEOSERVER_USER", "admin"),
50
+ "password": os.getenv("GEOSERVER_PASSWORD", "geoserver"),
51
+ "configured": "false" if not os.getenv("GEOSERVER_URL") else "true",
52
+ }
53
+
54
+
48
55
  def get_geoserver_config() -> dict[str, str]:
49
- """Get GeoServer configuration from environment variables."""
50
- return {
51
- "url": os.getenv("GEOSERVER_URL", "http://localhost:8080/geoserver"),
52
- "user": os.getenv("GEOSERVER_USER", "admin"),
53
- "password": os.getenv("GEOSERVER_PASSWORD", "geoserver"),
54
- }
56
+ """Get current GeoServer configuration."""
57
+ return _geoserver_config
55
58
 
56
59
 
57
60
  def get_geoserver() -> GeoServerCloud:
@@ -74,13 +77,45 @@ def get_geoserver_connection_info() -> dict[str, str]:
74
77
  """
75
78
  Get current GeoServer connection information.
76
79
  Shows the configured URL and username (password is hidden).
80
+ Check 'configured' field to see if connection was explicitly set.
81
+ If configured is 'false', ask the user for connection details
82
+ and use configure_geoserver_connection() to set them.
77
83
  """
78
84
  config = get_geoserver_config()
79
85
  return {
80
86
  "url": config["url"],
81
87
  "user": config["user"],
82
88
  "password": "***hidden***",
83
- "status": "configured",
89
+ "configured": config["configured"],
90
+ }
91
+
92
+
93
+ @mcp.tool
94
+ def configure_geoserver_connection(
95
+ url: str,
96
+ user: str = "admin",
97
+ password: str = "geoserver",
98
+ ) -> dict[str, str]:
99
+ """
100
+ Configure the GeoServer connection at runtime.
101
+ Use this to set the GeoServer URL and credentials when they are not
102
+ pre-configured via environment variables.
103
+
104
+ Args:
105
+ url: GeoServer base URL (e.g., http://localhost:8080/geoserver)
106
+ user: GeoServer username (default: admin)
107
+ password: GeoServer password (default: geoserver)
108
+ """
109
+ _geoserver_config["url"] = url
110
+ _geoserver_config["user"] = user
111
+ _geoserver_config["password"] = password
112
+ _geoserver_config["configured"] = "true"
113
+
114
+ return {
115
+ "message": f"GeoServer connection configured: {url}",
116
+ "url": url,
117
+ "user": user,
118
+ "configured": "true",
84
119
  }
85
120
 
86
121
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoservercloud-mcp
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: MCP (Model Context Protocol) server for GeoServer - enables AI assistants to manage GeoServer workspaces, datastores, layers, and styles through natural language
5
5
  License: BSD-2-Clause
6
6
  License-File: LICENSE
@@ -47,32 +47,30 @@ Once connected, you can ask your AI assistant things like:
47
47
 
48
48
  ---
49
49
 
50
- ## Quick Start
50
+ ## Installation
51
51
 
52
- ### Option 1: Full Local Development Stack
53
-
54
- Start the MCP server with a local GeoServer and PostGIS:
52
+ ### From PyPI
55
53
 
56
54
  ```bash
57
- cd mcp
58
- docker compose up -d
55
+ pip install geoservercloud-mcp
59
56
  ```
60
57
 
61
- This starts:
62
- - **geoservercloud-mcp**: The MCP server on port 8000
63
- - **geoserver**: GeoServer instance on port 8080
64
- - **postgis**: PostGIS database on port 5433
58
+ Or use `uvx` to run without installing (requires [uv](https://docs.astral.sh/uv/)):
65
59
 
66
- ### Option 2: MCP Server Only (Connect to External GeoServer)
60
+ ```bash
61
+ # Install uv first (if not already installed)
62
+ curl -LsSf https://astral.sh/uv/install.sh | sh
67
63
 
68
- If you have an existing GeoServer:
64
+ # Run the MCP server
65
+ uvx geoservercloud-mcp
66
+ ```
69
67
 
70
- ```bash
71
- cd mcp
72
- GEOSERVER_URL=http://your-geoserver:8080/geoserver \
73
- GEOSERVER_USER=admin \
74
- GEOSERVER_PASSWORD=your-password \
75
- docker compose up -d geoservercloud-mcp
68
+ ### From MCP Registry
69
+
70
+ This server is published to the [MCP Registry](https://registry.modelcontextprotocol.io) as:
71
+
72
+ ```text
73
+ io.github.ronitjadhav/geoservercloud-mcp
76
74
  ```
77
75
 
78
76
  ---
@@ -81,21 +79,14 @@ docker compose up -d geoservercloud-mcp
81
79
 
82
80
  ### VS Code / Cursor
83
81
 
84
- 1. Open Command Palette **"MCP: Add Server"**
85
- 2. Select **"Command (stdio)"**
86
- 3. Enter command: `poetry run geoservercloud-mcp`
87
- 4. Enter server ID: `geoserver`
88
-
89
- VS Code will create an MCP configuration file. Update it with the working directory and environment variables:
82
+ Add to your MCP configuration (`.vscode/mcp.json`):
90
83
 
91
84
  ```json
92
85
  {
93
86
  "servers": {
94
87
  "geoserver": {
95
- "type": "stdio",
96
- "command": "poetry",
97
- "args": ["run", "geoservercloud-mcp"],
98
- "cwd": "/path/to/python-geoservercloud",
88
+ "command": "uvx",
89
+ "args": ["geoservercloud-mcp"],
99
90
  "env": {
100
91
  "GEOSERVER_URL": "http://localhost:8080/geoserver",
101
92
  "GEOSERVER_USER": "admin",
@@ -117,9 +108,8 @@ Add to your Claude Desktop config:
117
108
  {
118
109
  "mcpServers": {
119
110
  "geoserver": {
120
- "command": "poetry",
121
- "args": ["run", "geoservercloud-mcp"],
122
- "cwd": "/path/to/python-geoservercloud",
111
+ "command": "uvx",
112
+ "args": ["geoservercloud-mcp"],
123
113
  "env": {
124
114
  "GEOSERVER_URL": "http://localhost:8080/geoserver",
125
115
  "GEOSERVER_USER": "admin",
@@ -132,20 +122,21 @@ Add to your Claude Desktop config:
132
122
 
133
123
  Restart Claude Desktop after saving the configuration.
134
124
 
135
- ---
136
-
137
- ## Testing with FastMCP Inspector
125
+ ### Dynamic Configuration (No Hardcoded Credentials)
138
126
 
139
- The MCP server includes a built-in inspector UI for debugging:
127
+ You can omit the `env` section entirely. The AI will ask you for the GeoServer URL, username, and password at runtime:
140
128
 
141
- ```bash
142
- # From project root
143
- poetry install
144
- poetry run fastmcp dev geoservercloud/mcp/server.py
129
+ ```json
130
+ {
131
+ "mcpServers": {
132
+ "geoserver": {
133
+ "command": "uvx",
134
+ "args": ["geoservercloud-mcp"]
135
+ }
136
+ }
137
+ }
145
138
  ```
146
139
 
147
- Open http://127.0.0.1:6274 in your browser to test individual tools.
148
-
149
140
  ---
150
141
 
151
142
  ## Environment Variables
@@ -158,25 +149,6 @@ Open http://127.0.0.1:6274 in your browser to test individual tools.
158
149
 
159
150
  ---
160
151
 
161
- ## Docker Commands
162
-
163
- ```bash
164
- # Start all services
165
- cd mcp
166
- docker compose up -d
167
-
168
- # Stop services
169
- docker compose down
170
-
171
- # Stop and remove volumes (data)
172
- docker compose down -v
173
-
174
- # View logs
175
- docker compose logs -f geoservercloud-mcp
176
- ```
177
-
178
- ---
179
-
180
152
  ## Python Library
181
153
 
182
154
  This MCP server is built on the **python-geoservercloud** library. For programmatic access without MCP, see the [library documentation](docs/LIBRARY.md).
@@ -194,3 +166,9 @@ geoserver.create_workspace("my_workspace")
194
166
 
195
167
  Full documentation: <https://camptocamp.github.io/python-geoservercloud/>
196
168
 
169
+ ---
170
+
171
+ ## Development
172
+
173
+ For local development, testing, and publishing, see the [Developer Guide](docs/DEVELOPER.md).
174
+
@@ -57,7 +57,7 @@ geoservercloud/gridsets/2056.xml,sha256=EgLOGMs6Teg_GJzI7X5I2rgUGJ0jprB7eZBOCnCK
57
57
  geoservercloud/gridsets/21781.xml,sha256=rYwituL0LaNgHMjwXHxsi8cKz64ksWO2qPs5FhL3fdE,2368
58
58
  geoservercloud/gridsets/3857.xml,sha256=3TMnhEFMfW1whNmfG2tewzQHi3DLESvt6AQ35IsiZ2Q,3624
59
59
  geoservercloud/mcp/__init__.py,sha256=KcmRGcSo16FYqsSq5QlRVt_8GMFzb80bPTYGH3azcgg,311
60
- geoservercloud/mcp/server.py,sha256=z_to5QCma74sIopKIqEkzbh-bJJtDB1L7yoH1NSa8Lc,39260
60
+ geoservercloud/mcp/server.py,sha256=daWnc8EeliBliFVQb5e9eZB5xZhTj18H4jxV46WI5d8,40468
61
61
  geoservercloud/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  geoservercloud/models/abstractlayer.py,sha256=lddsRK7WxzyXhZuCHcBQYwHk5GGdxb1qSeJRoNnNwS4,3940
63
63
  geoservercloud/models/common.py,sha256=Rx2mDkzAJH94L5tRxUknZFXRi-vrjF_2osmRSrkaSPo,13411
@@ -86,8 +86,8 @@ geoservercloud/services/restlogger.py,sha256=XNnjDKRjMJrYk3xM7qedufzCaFixxmZ8Pag
86
86
  geoservercloud/services/restservice.py,sha256=tTT6RFe-iQ1hdUdwKyCHvGDGNx1B_r1UKMDjnx7QV1c,43364
87
87
  geoservercloud/templates.py,sha256=FZ4P6QoS7KTdw7A_AK9M77uqmwUi5qdbzhAZqZXIsx8,2718
88
88
  geoservercloud/utils.py,sha256=WlW0ZduWgUOa9mXju8p9SaMAy0Llk_0m-ik0sVJKNac,2561
89
- geoservercloud_mcp-0.1.6.dist-info/METADATA,sha256=HpNBo_-1XIRhlnImZhoYhQjKVnXOVHrr2mtg56ahb3w,5247
90
- geoservercloud_mcp-0.1.6.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
91
- geoservercloud_mcp-0.1.6.dist-info/entry_points.txt,sha256=zW3SvltRh_f57n75keNnCKpqiyzrf9NrNZ43QWcId0o,244
92
- geoservercloud_mcp-0.1.6.dist-info/licenses/LICENSE,sha256=O4xo3D90ZdQcUrVxXBq5tsjlYHJpNUpIFGIKfxmyaH0,1302
93
- geoservercloud_mcp-0.1.6.dist-info/RECORD,,
89
+ geoservercloud_mcp-0.1.7.dist-info/METADATA,sha256=bWq-OPTzAdSnilnFwASZicix3lefLTscFpoINhS6AXM,4684
90
+ geoservercloud_mcp-0.1.7.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
91
+ geoservercloud_mcp-0.1.7.dist-info/entry_points.txt,sha256=zW3SvltRh_f57n75keNnCKpqiyzrf9NrNZ43QWcId0o,244
92
+ geoservercloud_mcp-0.1.7.dist-info/licenses/LICENSE,sha256=O4xo3D90ZdQcUrVxXBq5tsjlYHJpNUpIFGIKfxmyaH0,1302
93
+ geoservercloud_mcp-0.1.7.dist-info/RECORD,,