Skip to content

feat: generate an MCP tool manifest from the enriched catalog#6

Merged
estebanzimanyi merged 1 commit into
masterfrom
feat/mcp-generator
Jul 7, 2026
Merged

feat: generate an MCP tool manifest from the enriched catalog#6
estebanzimanyi merged 1 commit into
masterfrom
feat/mcp-generator

Conversation

@estebanzimanyi

@estebanzimanyi estebanzimanyi commented May 18, 2026

Copy link
Copy Markdown
Member

MCP tool manifest

generator/mcp.py + generate_mcp.py project the enriched MEOS catalog onto a Model Context Protocol (MCP) tool manifest, so an LLM/agent can call the MEOS spatiotemporal value algebra directly.

python run.py                 # enriched catalog -> output/meos-idl.json
python generate_mcp.py        #              -> output/meos-mcp.json

How

  • One MCP tool per stateless-exposable function.
  • Self-contained 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.
  • Spatiotemporal values pass as serialized strings; each parameter description names the type and its encodings (text/WKT, MF-JSON, HexWKB) so the model formats them correctly.
  • annotations mark tools read-only/idempotent; x-meos.{category,decode,encode} give a runtime everything it needs to dispatch a call with no extra metadata.
  • Pure dictdict (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.md documents the projection rules and roadmap; tests/test_mcp.py holds worked examples (python3 tests/test_mcp.py).

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).
@estebanzimanyi estebanzimanyi merged commit 35b9e38 into master Jul 7, 2026
1 check passed
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