MCP Server
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
The GeoLens MCP server (geolens-mcp) is a read-only
Model Context Protocol server. Point a coding
agent (Claude Code, Cursor, Codex, and any other MCP client) at a GeoLens
instance and it can discover datasets, inspect schemas, and read features and
maps from inside a dev session. It is Apache-2.0 licensed and built on the
Python SDK, so every tool maps to a real endpoint in the
API reference.
Install
Section titled “Install”pip install geolens-mcp # or: uvx geolens-mcpuvx runs the server without a persistent
install, which is what the client-registration examples below use.
Configure
Section titled “Configure”The server reads its target instance and credentials from the environment — the same variable names the CLI uses:
| Variable | Required | Meaning |
|---|---|---|
GEOLENS_INSTANCE | Yes | Instance URL, e.g. https://geolens.example.com. The /api suffix is appended automatically if you omit it. |
GEOLENS_API_KEY | Recommended | API key, sent as X-Api-Key. Omit for public-only access. See Authentication → API keys for how to obtain one. |
GEOLENS_TOKEN | — | JWT bearer token, used only if GEOLENS_API_KEY is unset. |
Register with an MCP client
Section titled “Register with an MCP client”Claude Code — one command registers the server for the current project:
claude mcp add geolens \ -e GEOLENS_INSTANCE=https://geolens.example.com \ -e GEOLENS_API_KEY=... \ -- uvx geolens-mcpCursor, Codex, or any client that reads an mcpServers block:
{ "mcpServers": { "geolens": { "command": "uvx", "args": ["geolens-mcp"], "env": { "GEOLENS_INSTANCE": "https://geolens.example.com", "GEOLENS_API_KEY": "your-api-key" } } }}| Tool | What it does |
|---|---|
search_datasets | Catalog search by free text (semantic ranking where the instance enables it). Returns dataset records as GeoJSON features. |
get_dataset_schema | A dataset’s columns, geometry type, CRS/SRID, feature count, and extent. |
get_features | Bounded GeoJSON features for a dataset (OGC API — Features), with optional bbox. |
list_maps | Saved maps (id, name, visibility, layer count). |
get_map | One saved map’s full metadata, including layers and view state. |
Not yet included
Section titled “Not yet included”A query tool — running SQL through GeoLens’s read-only sandbox — is
intentionally not in this release. The sandbox has no direct REST endpoint
today, and exposing raw SQL over HTTP needs security hardening (cost/DoS bounds,
rate limiting, mandatory dataset scope) before it is safe to point at a
production instance. Follow
geolens#565 for progress.
See also
Section titled “See also”- Client SDKs: the Python SDK that
geolens-mcpbuilds on, and the CLI-vs-SDK-vs-MCP-vs-API decision table - CLI & Manifests: the same credential/instance environment variables, for terminal and CI ingestion
- API Authentication: JWT and API-key details for the credentials above
- Search & Discovery: what
search_datasetsreturns, including semantic ranking