GeoNeMo API credential setup#

Resolve the endpoint and trust#

Use the GeoNeMo server HTTPS origin from the user, trusted host configuration, or the GEONEMO_SERVICES_API_ENDPOINT environment variable (read by the stdio MCP bridge). Examples use https://geonemo.example.com; substitute the deployment’s origin. Paths below are appended to the origin without changing it. Credential values never belong in an endpoint’s userinfo, query, or fragment.

Keep TLS verification enabled. Python/GeoNeMo CLI clients can use SSL_CERT_FILE referencing a host-approved PEM bundle when the certificate chain is absent from their default trust. The bundle must also contain any other roots needed by browser-login HTTP requests. Use the actual client’s supported trust mechanism; Python trust configuration does not establish trust for an editor’s native MCP client. Missing CA trust is a TLS failure, not an invalid credential. Do not create or install a new CA or replace global trust as part of routine credential setup.

Reuse or obtain API authorization#

Use the existing client package; a missing executable/package is a prerequisite to report, not a reason to implement a replacement authentication client. Its CLI supports:

geonemo --url https://geonemo.example.com whoami
geonemo --url https://geonemo.example.com login
geonemo --url https://geonemo.example.com login --token

Run whoami for an existing saved login. Run only the appropriate login command when credentials are missing or the user requests replacement. Browser login uses PKCE and a loopback callback; the user signs in and approves the requested access. For a personal token, use Console → Access, choose audience API, select the required scopes, and enter the issued value at the login --token non-echoing prompt. A bearer credential cannot mint more personal tokens through the API; personal-token issuance requires browser sign-in. Do not paste tokens into commands.

The current CLI browser flow requests all five standard GeoNeMo server scopes and has no scope flag. When the requested scope limit excludes those grants, use a scoped API personal token instead. Report the actual granted scopes rather than claiming the browser flow requests only read access.

The official client owns $XDG_CONFIG_HOME/geonemo/credentials.json, falling back to ~/.config/geonemo/credentials.json. Entries are keyed by the GeoNeMo server origin. On POSIX, the directory is owned by the user with mode 0700 and the file has mode 0600. Let the CLI manage this store, preserve other origins, and do not edit it manually. OAuth login refreshes through the client; a personal token has no automatic refresh. Do not rotate or revoke credentials merely because setup was requested. On hosts without the POSIX cache, use an explicit host-held bearer credential or supported native OAuth client.

Python and host HTTP usage#

GEONEMO_SERVICES_TOKEN is an explicit host environment convention. The Python client does not automatically read that variable; pass it through token=. Without an explicit token, it reuses the CLI cache:

import os
from geonemo.client import GeoNeMoClient

with GeoNeMoClient(
    "https://geonemo.example.com",
    token=os.environ.get("GEONEMO_SERVICES_TOKEN"),
) as client:
    identity = client.transport.request_json(
        "GET", "/v1/auth/me", dict, operation="identity"
    )
    discovery = client.transport.request_json(
        "GET", "/v1/discovery", dict, operation="capability discovery"
    )

For a generic HTTP client, have the host supply Authorization: Bearer … from its API credential reference on GET /v1/auth/me and GET /v1/discovery. Keep headers out of logs and use finite timeouts without redirects to another origin. The snippet above illustrates host-side use; this skill bundles no network code. Output only the sanitized identity, scopes, capabilities, and discovered MCP endpoint. Do not dump credential files or response headers containing secrets.

Scopes and completion#

services:read supports reads and discovery; tools:execute is additionally needed for detector execution; gkb:publish, agents:control, and connections:manage grant separate operations. Setup requests do not imply a need for all scopes. Report missing operation-specific scopes without testing a destructive or costly operation.

API completion requires both successful identity and discovery checks through the selected credential source. If configuring both connections, pass only the trusted advertised MCP URL to independent MCP setup and select an MCP credential there. Report pending browser consent, missing token entry, or unavailable client capabilities explicitly.