feat: generate an MCP tool manifest from the enriched catalog#6
Open
estebanzimanyi wants to merge 1 commit into
Open
feat: generate an MCP tool manifest from the enriched catalog#6estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
ccd16f0 to
95c492f
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).
95c492f to
bdbde06
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.
What
Adds
generator/mcp.py+generate_mcp.py: projects the enriched MEOScatalog onto a Model Context Protocol tool manifest, so an LLM/agent can
call the MEOS spatiotemporal value algebra directly.
How
inputSchema(JSON Schema 2020-12): enums andopaque-type schemas are inlined, since MCP clients don't resolve
external
$refs (this is why it's a separate generator from the OpenAPIone — same model, different rendering).
description names the type and its encodings (text/WKT, MF-JSON, HexWKB)
so the model formats them correctly.
annotationsmark tools read-only/idempotent;x-meos.{category,decode,encode}give a runtime everything to dispatch acall with no extra metadata.
dict→dict(no libclang, no MEOS runtime); deterministic(tools sorted by name).
Validation
Run against the live MobilityDB
mastercatalog: 2672 functions →1790 tools (1743 with
outputSchema, 47void), names unique & sorted,0 malformed.
tests/test_mcp.py: 7 stdlibunittestcases, all green.Contract and roadmap in
docs/mcp.md.Scope / dependency
Logically stacks on the catalog-enrichment work (consumes the
network/wire/typeEncodingsfields); sibling to the OpenAPIgenerator. Delivers the manifest, not an MCP server — a generated
stdio/HTTP server (decode → call → encode) is the natural next unit.