Skip to content

MCP tools are thin CLI argv wrappers returning wire text inside JSON #14

Description

@chouswei

Summary

memnet-mcp does not expose a structured graph API. Each tool builds CLI argv, runs run_memnet, and returns a JSON string whose stdout is still raw wire lines. Agents and domain MCPs re-parse that text.

Evidence

  • src/memnet_mcp/server.py: tools call _run([...]) then resp.to_json().
  • src/memnet_mcp/client.py: run_memnet(argv) bridges to memnet serve TCP or inline CLI.
  • Documented pattern: application-notes/llm-build-on-memnet.md ("Wrap CLI in typed tools; return JSON envelope").
  • novel-mcp then parses warm with ad-hoc splitters (see related parser issues).

Impact

Latency and token cost: serialize to TCP to wire text to JSON string to agent parse. No typed fields for LLM tool schemas. Errors live in errors[] and stderr wire, easy to mishandle.

Suggested direction

Optional structured MCP responses (records as objects / TOON) while keeping wire for CLI and snapshots; or in-process store handles for same-process domain MCPs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions