Make a first call#
Call the Toolkit offline with a fake client, then against a local stack. The stack that Tutorial: find ships off a port started works for this page.
Offline#
FakeGeoNeMoClient mirrors the production client’s shape with in-memory data. It needs no network, stack or credentials. It provides gkb, catalog, media and status areas and a discovery document.
from geonemo.client import FakeGeoNeMoClient
from geonemo.client.catalog import (
CatalogRecord,
CatalogSearchRequest,
)
with FakeGeoNeMoClient(project_id="demo") as client:
client.catalog.add_collection("imagery")
client.catalog.add_record(
CatalogRecord(
id="scene-001",
collection="imagery",
text="Sentinel-2 scene over Rotterdam harbor",
metadata={"platform": "sentinel-2"},
)
)
print(client.discover().api_version)
print(client.status.readiness().status)
for c in client.catalog.list_collections():
print(c.name, c.record_count)
page = client.catalog.search(
CatalogSearchRequest(collection="imagery", text="harbor")
)
for hit in page.items:
print(hit.id, hit.metadata)
Saved to a file and run with .venv/bin/python, it prints:
v1
ready
imagery 1
scene-001 {'platform': 'sentinel-2'}
Code written against the fake runs unchanged against GeoNeMoClient.
Local stack#
Start the development stack as described in Run the local stack: prepare the release inputs, run deploy/development/dev.sh up --build, and note the addresses from dev.sh urls. The stack starts without access to the GeoNeMo image registry; only agents, the L1B ortho image and the default Milvus image need it. It starts with seed data (a collection named preview-imagery) and without sign-in.
Prerequisites#
Install completed, including the full-history clone and
.venv.The local stack running on
http://127.0.0.1:8101(API) andhttp://127.0.0.1:8201/mcp(MCP).
Steps#
Call it with the client.
from geonemo.client import GeoNeMoClient
with GeoNeMoClient("http://127.0.0.1:8101") as client:
print(client.discover())
print(client.status.readiness())
print(client.catalog.list_collections())
Call it with
curl.
curl http://127.0.0.1:8101/v1/discovery
curl http://127.0.0.1:8101/v1/health/ready
curl http://127.0.0.1:8101/v1/catalog/collections
Connect an MCP harness to
http://127.0.0.1:8201/mcp(streamable HTTP) with the lines in Connect an MCP client under “Local stack, no sign-in”, and ask it which collections GeoNeMo has. The endpoint expects a bearer token and accepts any value on this stack.Continue with Tutorial: an agent question, end to end, or stop the stack with
deploy/development/dev.sh down, as described in Run the local stack.
Result#
Discovery returns the server version and the public endpoints, and the collections call
lists the seeded collection preview-imagery with three records. Readiness lists one
check per service. On this stack its overall status is ready, and every check is
ready or disabled: a part’s feature that the stack does not turn on, such as vessel
detection, is disabled. Every route is in Reference.