{
  "id": "wire.mcp",
  "kind": "tooling",
  "summary": "MCP server contract for local and cloud-synced Wire agents.",
  "useWhen": [
    "Claude Code, Codex, Cursor, or another MCP client needs to author wires",
    "an agent needs cloud sync with a user's authenticated account",
    "an agent needs SVG, PNG, preview, JSON, or Mermaid exports"
  ],
  "contracts": [
    "wire-mcp-tools",
    "wire-cloud-sync",
    "wire-render-assets"
  ],
  "preferredPath": [
    "Install with npx -y @aigentive/wire-mcp@latest.",
    "For cloud sync, set WIRE_CLOUD_URL and WIRE_CLOUD_API_KEY.",
    "Call v1_get_agent_guide or v1_get_docs_shape before diagram work.",
    "Use apply_actions for multi-step edits.",
    "Run validate before render_preview or asset export."
  ],
  "avoid": [
    "Do not assume localhost previews work for customers.",
    "Do not use local filesystem storage when WIRE_CLOUD_API_KEY is intended.",
    "Do not skip validate after save_diagram or apply_actions."
  ],
  "tools": [
    {
      "name": "v1_get_docs_shape",
      "purpose": "Return structured docs chunks by topic or task.",
      "requiredSequence": [
        "call before uncertain tasks"
      ]
    },
    {
      "name": "v1_get_agent_guide",
      "purpose": "Return the compact Markdown operating guide."
    },
    {
      "name": "create_diagram",
      "purpose": "Create a new diagram, optionally from a template."
    },
    {
      "name": "load_diagram",
      "purpose": "Load a stored diagram by id."
    },
    {
      "name": "save_diagram",
      "purpose": "Overwrite a diagram after schema parsing."
    },
    {
      "name": "patch_diagram",
      "purpose": "Patch top-level diagram fields such as title, description, layout, and metadata."
    },
    {
      "name": "list_diagrams",
      "purpose": "List local or cloud-synced diagrams."
    },
    {
      "name": "get_diagram_json",
      "purpose": "Read canonical Wire JSON."
    },
    {
      "name": "add_node",
      "purpose": "Append a node and optionally wire it with from or branch."
    },
    {
      "name": "update_node",
      "purpose": "Patch fields on an existing node."
    },
    {
      "name": "remove_node",
      "purpose": "Remove a node and prune references."
    },
    {
      "name": "move_node",
      "purpose": "Persist manual or editor-driven node position."
    },
    {
      "name": "resize_node",
      "purpose": "Persist manual or editor-driven node size."
    },
    {
      "name": "connect",
      "purpose": "Connect two nodes through target from refs or explicit edges."
    },
    {
      "name": "disconnect",
      "purpose": "Remove connections between two nodes."
    },
    {
      "name": "update_edge",
      "purpose": "Patch explicit edge labels, handles, style, routing, or data."
    },
    {
      "name": "remove_edge",
      "purpose": "Remove an explicit edge by id."
    },
    {
      "name": "add_note",
      "purpose": "Add an annotation note, optionally attached to a node."
    },
    {
      "name": "set_layout",
      "purpose": "Change layout direction or engine."
    },
    {
      "name": "add_group",
      "purpose": "Add a group node and optionally parent existing children."
    },
    {
      "name": "ungroup",
      "purpose": "Clear group membership while leaving the group node."
    },
    {
      "name": "patch_metadata",
      "purpose": "Patch diagram.metadata keys without replacing unrelated metadata."
    },
    {
      "name": "apply_actions",
      "purpose": "Apply a coherent batch of WireAction mutations."
    },
    {
      "name": "validate",
      "purpose": "Return validation result with stable codes and repair hints."
    },
    {
      "name": "render_preview",
      "purpose": "Return cloud share URLs or inline preview URLs."
    },
    {
      "name": "render_svg",
      "purpose": "Return SVG markup."
    },
    {
      "name": "render_png",
      "purpose": "Return PNG image data when rasterization is available."
    },
    {
      "name": "summarize_diagram",
      "purpose": "Return a plain-text summary of counts, triggers, ends, and branches."
    },
    {
      "name": "export_mermaid",
      "purpose": "Return Mermaid syntax as an export, not source of truth."
    }
  ],
  "routes": [
    {
      "path": "/llm/mcp.shape.json",
      "mediaType": "application/json",
      "purpose": "MCP tool and connection guide."
    },
    {
      "path": "/llm/recipes/connect-local-mcp.json",
      "mediaType": "application/json",
      "purpose": "Cloud API key setup recipe."
    }
  ],
  "related": [
    "wire.agent",
    "wire.cloud",
    "wire.validation"
  ]
}
