Skip to content

feat(ndp): 11 new MCP tools — registration, resource search, streaming, status#285

Closed
SIslamMun wants to merge 1 commit into
mainfrom
feat/ndp-mcp-11-new-tools
Closed

feat(ndp): 11 new MCP tools — registration, resource search, streaming, status#285
SIslamMun wants to merge 1 commit into
mainfrom
feat/ndp-mcp-11-new-tools

Conversation

@SIslamMun
Copy link
Copy Markdown
Contributor

Summary

Extends the NDP MCP server from 3 read-only catalog tools to 14 total by covering the rest of the NDP-EndPoint REST surface at `http://155.101.6.191:8003\`. Same FastMCP 3.0 conventions; same `NDPClient` retry/backoff design.

Tool inventory (3 existing + 11 new)

Existing (unchanged)

  • `list_organizations`, `search_datasets`, `get_dataset_details`

Registration (4, bearer auth)

  • `register_dataset`, `register_kafka_topic`, `register_s3_resource`, `register_url_resource`

Resource discovery (1)

  • `search_resources` — `GET /resources/search` (local catalog)

Status / user (2, bearer auth)

  • `get_jupyter_details`, `get_user_info`

Streaming / EarthScope GNSS UI pattern (4)

  • `list_kafka_streams` — `GET /resources/search?format=kafka` (no auth on `local`); unpacks the resource's `description` JSON into `{name, topic, host, port, url}` rows.
  • `get_kafka_details`, `get_system_metrics`
  • `register_derived_stream` — `POST /kafka` with `mapping={source_topic, sncl_filter}` — matches the pattern behind `vdc-192.chpc.utah.edu/gnss-ui/`.

Implementation

  • `NDPClient` bearer-auth via `NDP_BEARER_TOKEN` env or config key, propagated through `_headers()`. Reads still work without it.
  • All new tools have FastMCP 3.0 `annotations` + `tags` and raise `ToolError`.
  • `FastMCP("ndp", list_page_size=10)`. `server.json` updated.

Tests — 97/97 passing

One existing test in `test_ndp_client.py` updated for the new `headers=` kwarg. `tests/test_new_tools.py` adds 18 cases.

Live-verification

```
list_organizations → 84 orgs
search_datasets(["data"]) → 1000 datasets
list_kafka_streams(name=gnss) → earthscope_kafka_gnss_observations
get_kafka_details → 401 (expected; needs bearer)
```

Test plan

  • `cd clio-kit-mcp-servers/ndp && uv run pytest -q`
  • Smoke `uvx clio-kit ndp` from any MCP-aware client
  • `uv run python ../../scripts/validate_fastmcp.py`

🤖 Generated with Claude Code

…g, status

Upstream NDP MCP exposed 3 read-only catalog tools. Adds 11 more
covering the rest of the NDP-EndPoint REST surface
(http://155.101.6.191:8003):

Registration (4, bearer auth):
  register_dataset           POST /dataset
  register_kafka_topic       POST /kafka
  register_s3_resource       POST /s3
  register_url_resource      POST /url

Resource discovery (1):
  search_resources           GET  /resources/search

Status / user (2, bearer auth):
  get_jupyter_details        GET  /status/jupyter
  get_user_info              GET  /user/info

Streaming / EarthScope GNSS UI pattern (4):
  list_kafka_streams         GET  /resources/search?format=kafka  (no auth on local)
  get_kafka_details          GET  /status/kafka-details
  get_system_metrics         GET  /status/metrics
  register_derived_stream    POST /kafka with mapping={source_topic, sncl_filter}

Total: 14 tools (3 upstream + 11 new). FastMCP gets list_page_size=10.

Implementation details:
  - Bearer-auth wiring on NDPClient (NDP_BEARER_TOKEN env or config key)
  - list_kafka_streams unpacks the kafka resource's `description` JSON
    blob into compact rows (host/port/topic) so the model gets a clean
    schema instead of nested strings.
  - register_derived_stream encodes the filter in NDP-EP's `mapping`
    field — matches what the vdc-192.chpc.utah.edu/gnss-ui pattern does.
  - All write tools raise ToolError on 4xx/5xx with the upstream message.

Tests: +97 passing (+18 new in test_new_tools.py covering all 11 new
tools' happy paths + error paths + parsing edge cases). One existing
test in test_ndp_client.py updated for the new `headers=` kwarg on
httpx.post.

Live-verified against the demo backend:
  list_organizations           → 84 orgs
  search_datasets(["data"])    → 1000 datasets
  list_kafka_streams(name=gnss) → earthscope_kafka_gnss_observations
  get_kafka_details            → 401 (expected; needs auth)

server.json manifest updated with all 14 tool descriptions.
@SIslamMun SIslamMun closed this May 21, 2026
@SIslamMun SIslamMun deleted the feat/ndp-mcp-11-new-tools branch May 21, 2026 17:32
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 81.69935% with 28 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
clio-kit-mcp-servers/ndp/src/ndp_mcp/server.py 81.69% 28 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant