GeoLens
io.github.geolens-io/geolens · 275 stars · Python · Apache-2.0
MCP server Read-only access to a self-hosted GeoLens spatial catalog: datasets, features, maps, sandboxed SQL.
Install
The repo has no one-line install. Follow its README.
Published as
- PyPI
geolens-mcpstdio
From the server's entry in the official MCP Registry.
Configuration
| Name | Set as | What it is |
|---|---|---|
GEOLENS_INSTANCERequired | Env var | Base URL of the GeoLens instance, e.g. https://geolens.example.com (the /api suffix is appended automatically). |
GEOLENS_API_KEYOptional · Secret | Env var | API key, sent as X-Api-Key. Omit for public-only access. |
GEOLENS_TOKENOptional · Secret | Env var | JWT bearer token, used only when GEOLENS_API_KEY is unset. |
Files
geolens-mcp
Apache-2.0 read-only Model Context Protocol server for GeoLens.
Point a coding agent (Claude Code, Cursor, Codex, …) at a GeoLens instance so it can discover datasets, inspect schemas, read features and maps, and run read-only SQL from inside a dev session.
Read-only by design. No writes, ingest, or admin. The discovery tools are GETs against existing API endpoints; query is a POST mechanically but executes inside the server's READ ONLY SQL sandbox, so it cannot modify anything. Calls are scoped to the caller's access: with an API key, the agent sees the datasets that key's user can see; with no credential it sees only public/published data (query additionally requires a credential whose user holds the AI-chat permission — read_only API keys work, via a route-specific server-side carve-out).
Install
pip install geolens-mcp # or: uvx geolens-mcp
Configure
The server reads its target instance and credentials from the environment (same names as the geolens CLI):
| 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. Create one in Settings → API keys. Omit for public-only access. |
GEOLENS_TOKEN |
— | JWT bearer token, used only if GEOLENS_API_KEY is unset. |
Register with an MCP client
Claude Code:
claude mcp add geolens -e GEOLENS_INSTANCE=https://geolens.example.com -e GEOLENS_API_KEY=... -- uvx geolens-mcp
Cursor / Codex / 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"
}
}
}
}
Tools
| Tool | What it does |
|---|---|
search_datasets |
Catalog search by free text (semantic ranking where the instance enables it). Returns dataset records as GeoJSON features with safe origin and freshness state; health/check/refresh keys are null when unavailable in the search summary. |
get_dataset_schema |
A dataset's columns, geometry type, CRS/SRID, feature count, extent, and source trust metadata. |
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. |
query |
One read-only SQL SELECT through the server's hardened sandbox (#565): single statement over data.* tables, allowlisted functions, a mandatory restrict_tables scope, and a strict server-side budget (statement timeout, self-join cap, row limit, rate limits). Needs a credential whose user has the AI-chat permission; requires GeoLens ≥ the release that ships POST /api/query/. |
Develop
cd mcp uv run --extra dev python -m pytest -v
Facts
- Kind
- MCP server
- Group
- Uncategorized
- Stars
- 275
- License
- Apache-2.0
- Language
- Python
- Last push
- 2026-10-11
- Forks
- 37
- MCP Registry
- io.github.geolens-io/geolens
- Homepage
- getgeolens.com
- Topics
- cloud-optimized-geotiff, data-catalog, fastapi, geojson, geospatial, gis, maplibre, ogc-api, pgvector, postgis, python, react, self-hosted, semantic-search, stac, typescript, vector-tiles, docker, postgresql, spatial-analysis
- 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
- 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
- 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
- 4Scrapling MCP Serverd4vinci/scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
- 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k