feat(ndp): 11 new MCP tools — registration, resource search, streaming, status#285
Closed
SIslamMun wants to merge 1 commit into
Closed
feat(ndp): 11 new MCP tools — registration, resource search, streaming, status#285SIslamMun wants to merge 1 commit into
SIslamMun wants to merge 1 commit into
Conversation
…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.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
Registration (4, bearer auth)
Resource discovery (1)
Status / user (2, bearer auth)
Streaming / EarthScope GNSS UI pattern (4)
Implementation
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
🤖 Generated with Claude Code