Skip to main content

Apache-2.0 read-only Model Context Protocol (MCP) server for GeoLens. Lets coding agents discover datasets, inspect schemas, and ask spatial questions against any GeoLens instance.

Project description

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, and read features and maps from inside a dev session.

Read-only by design. Every tool is a GET against an existing API endpoint — no writes, ingest, or admin. 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.

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.
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

A query tool (run 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's safe to point at a production instance. Tracked in #565.

Develop

cd mcp
uv run --extra dev python -m pytest -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geolens_mcp-1.4.11.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geolens_mcp-1.4.11-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file geolens_mcp-1.4.11.tar.gz.

File metadata

  • Download URL: geolens_mcp-1.4.11.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geolens_mcp-1.4.11.tar.gz
Algorithm Hash digest
SHA256 47aaf81df1d78c0f7fb10a8222eec416eee770965c6e5dc7e9b2fbce54773935
MD5 a32f32c9f0c8bf10f5aa806e212e4add
BLAKE2b-256 e3c9561d87ac50b54ea596ee84edab229a52a98f7dcc08ac94073c47ab0c12ce

See more details on using hashes here.

File details

Details for the file geolens_mcp-1.4.11-py3-none-any.whl.

File metadata

  • Download URL: geolens_mcp-1.4.11-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geolens_mcp-1.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 8689fff567439aca7de04cfd0801ad1e534c955f05c8da1f1c68bcfb64a94de8
MD5 398b549bb7a23e0c4147d08847837da9
BLAKE2b-256 eb7c3e0556a000ce6b6e8f594f60a0fb98a5913e6be3b60432bc846f80f1b492

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page