feat: generate an MCP tool manifest from the enriched catalog#6
Merged
Conversation
95c492f to
bdbde06
Compare
bdbde06 to
e62bd13
Compare
Adds generator/mcp.py + generate_mcp.py: projects the enriched MEOS catalog (network/wire/typeEncodings) onto a Model Context Protocol tool manifest, so an LLM/agent can call the MEOS value algebra directly.
- one MCP tool per stateless-exposable function
- self-contained inputSchema (JSON Schema 2020-12); enums and opaque
types inlined, since MCP clients don't resolve external $refs
- spatiotemporal values passed as serialized strings; descriptions
state the encodings so the model formats them correctly
- annotations (readOnly/idempotent), x-meos.{category,decode,encode}
give a runtime everything to dispatch without extra metadata
- pure dict -> dict, deterministic (tools sorted by name)
Logically depends on the catalog being enriched. Validated against the
live MobilityDB master catalog: 2672 functions -> 1790 tools, all
well-formed. Documented in docs/mcp.md; tested in tests/test_mcp.py
(stdlib unittest).
e62bd13 to
23f2c6f
Compare
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.
MCP tool manifest
generator/mcp.py+generate_mcp.pyproject the enriched MEOS catalog onto a Model Context Protocol (MCP) tool manifest, so an LLM/agent can call the MEOS spatiotemporal value algebra directly.How
inputSchema(JSON Schema 2020-12): enums and opaque-type schemas are inlined, since MCP clients don't resolve external$refs — this is what makes it a distinct renderer from the OpenAPI projection over the same enriched model.annotationsmark tools read-only/idempotent;x-meos.{category,decode,encode}give a runtime everything it needs to dispatch a call with no extra metadata.dict→dict(no libclang, no MEOS runtime); output deterministically sorted by tool name so generated diffs are reviewable.The generator emits one MCP tool per stateless-exposable function, names unique and sorted, none malformed.
docs/mcp.mddocuments the projection rules and roadmap;tests/test_mcp.pyholds worked examples (python3 tests/test_mcp.py).