GeoLens — Claude Code MCP server: read-only spatial catalog access
Hooks your coding agent up to a GeoLens instance so it can list datasets, read schemas, features and maps, and run read-only SQL during a dev session.
claude mcp add geolens -e GEOLENS_INSTANCE=<GEOLENS_INSTANCE> -e GEOLENS_API_KEY=<GEOLENS_API_KEY> -e GEOLENS_TOKEN=<GEOLENS_TOKEN> -- uvx geolens-mcpWhat GeoLens does
This is a Model Context Protocol server that points an agent at your own GeoLens deployment. From inside the session the agent can browse datasets, inspect their schemas, pull features and maps, and send read-only queries. There are no tools for writing, ingesting or admin work, and every call is limited to the caller's access.
Install it from PyPI with pip install geolens-mcp, or run it through uvx geolens-mcp. Configuration comes from the environment: GEOLENS_INSTANCE, plus GEOLENS_API_KEY when the data is not public. No instance variable means the server will not start, so set it in your client config first.
The tool list and credential rules live in the GeoLens MCP guide. To work on the server itself, run uv run --extra dev python -m pytest -v from the mcp directory.
What it helps with
- find the right dataset in a GeoLens catalog without leaving the editor
- check a layer schema before writing a query against it
- pull features and maps into the current dev session
- run read-only SQL over spatial data
- confirm the agent holds no write permissions
Example prompts for the agent
- List every dataset in GeoLens with its schema
- Run a read-only query: how many features are in the
roadslayer - Fetch the
city_centermap and list its layers
How to install GeoLens
Platform CLI
claude mcp add geolens -e GEOLENS_INSTANCE=<GEOLENS_INSTANCE> -e GEOLENS_API_KEY=<GEOLENS_API_KEY> -e GEOLENS_TOKEN=<GEOLENS_TOKEN> -- uvx geolens-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from geolens-mcp <command>
Platform CLI
codex mcp add mcp --env GEOLENS_INSTANCE=<GEOLENS_INSTANCE> --env GEOLENS_API_KEY=<GEOLENS_API_KEY> --env GEOLENS_TOKEN=<GEOLENS_TOKEN> -- uvx geolens-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from geolens-mcp <command>
Config file
{
"mcpServers": {
"mcp": {
"command": "uvx",
"args": [
"geolens-mcp"
],
"env": {
"GEOLENS_INSTANCE": "<GEOLENS_INSTANCE>",
"GEOLENS_API_KEY": "<GEOLENS_API_KEY>",
"GEOLENS_TOKEN": "<GEOLENS_TOKEN>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from geolens-mcp <command>
Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"geolens-mcp"
],
"env": {
"GEOLENS_INSTANCE": "<GEOLENS_INSTANCE>",
"GEOLENS_API_KEY": "<GEOLENS_API_KEY>",
"GEOLENS_TOKEN": "<GEOLENS_TOKEN>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from geolens-mcp <command>
Platform CLI
gemini mcp add -e GEOLENS_INSTANCE=<GEOLENS_INSTANCE> -e GEOLENS_API_KEY=<GEOLENS_API_KEY> -e GEOLENS_TOKEN=<GEOLENS_TOKEN> mcp uvx geolens-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from geolens-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about GeoLens
How do I install GeoLens in Claude Code?
Run `claude mcp add geolens -e GEOLENS_INSTANCE=<GEOLENS_INSTANCE> -e GEOLENS_API_KEY=<GEOLENS_API_KEY> -e GEOLENS_TOKEN=<GEOLENS_TOKEN> -- uvx geolens-mcp. Install the package first with pip install geolens-mcp`.
What does GeoLens do?
It gives an agent access to your GeoLens instance: dataset discovery, schema inspection, reading features and maps, and read-only SQL. Writing and admin tools are absent.
Which environment variables does it need?
GEOLENS_INSTANCE holds the instance address and is required. Add GEOLENS_API_KEY for non-public data.