Skip to content

MCP server: rvt-rs-mcp, a stateless stdio server over the decoded model (MCP 2026-07-28) #1324

Closed

Description

@DrunkOnJava

rvt-rs ships its own MCP server, rvt-rs-mcp: local, read-only on the model, no network, stdio only. It links the rvt crate in process (no CLI subprocesses) and targets MCP 2026-07-28, the stateless revision, from the start.

Design

  • Protocol. rmcp 3.8 (server, macros, transport-io, schemars). server/discover and the legacy initialize handshake are both served (rmcp's default supported versions run 2024-11-05 to 2026-07-28). The crate declares rust-version = "1.88", rmcp's MSRV; the workspace stays at 1.87.
  • State. No session. open_model(path) decodes once and returns an opaque model_id; every other tool takes model_id or path. The server keeps an LRU of decoded models keyed by canonical path, size and mtime. An unknown or evicted model_id is a tool error that tells the caller to call open_model again (MCP 2026-07-28, server/tools, "Stateful Tools"). Handle lifetime is stated in open_model's description.
  • One source of truth. Every answer comes from the same decoded model the IFC exporter writes, so a tool answer and the export cannot disagree.
  • Structured answers. Each tool declares an outputSchema and returns structuredContent, with the JSON also given as text.
  • Long calls. Exports are one call: progress notifications when the request carries a progress token, and notifications/cancelled mapped to WalkerControl cancellation (nothing partial is written). The output goes to a path the caller names; the result returns a summary plus a resource_link to the file. No multi round-trip requests: they are for input a server is missing, and an export has all its input. The Tasks extension (io.modelcontextprotocol/tasks) is the later step if one long call stops being enough. A server may return a task only to a client that declares the extension, so adding it later changes nothing for other clients.
  • Wire discipline. stdout carries only JSON-RPC. Logging goes through tracing to stderr. The server exits on stdin EOF.

Tools (first PR)

open_model, get_summary, list_elements (by category, level, class), get_element (property sets, trust markers, file-level provenance), list_rooms, list_levels, get_diagnostics (what was read, skipped and left out, with reasons), export_ifc, export_gltf.

Done when

  • An E2E test drives the built binary over real stdio on corpus/tier1 in both lifecycles (server/discover at 2026-07-28, initialize at 2025-11-25). It also checks the unsupported-version error (-32022) and exit on EOF.
  • A CI check shows the dependency tree carries no HTTP client or server.
  • docs/mcp.md exists, and the release archives include the binary.

Follow-ups: per-element provenance, per-element export decisions, and a Measure scorer for the server's answers (linked below).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:productpriority:P1type:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions