Files
mcp-memory/agent-rules/mcp_and_build_constraints.md
T

17 lines
1.4 KiB
Markdown

---
name: MCP Protocol & Build Constraints
description: Strict constraints for Model Context Protocol stdio transport and project build tooling
---
# 1. MCP Stdio Protocol (Strict NDJSON)
- **Rule (CRITICAL):** The Model Context Protocol (MCP) `stdio` transport is strictly based on **pure NDJSON** (Newline Delimited JSON).
- **Rule:** NEVER inject Language Server Protocol (LSP) style HTTP headers (e.g., `Content-Length: <size>\r\n\r\n`) into MCP `stdio` streams. Payloads must be raw JSON objects delimited by a single newline character (`\n`).
# 2. Build Tooling Constraints (mcp-memory)
- **Rule:** NEVER use `cargo zigbuild` for cross-compilation in the `mcp-memory` project.
- **Rule:** ALWAYS use the project's native `justfile` targets (e.g., `just build-wsl`, `just deploy-stub-wsl`, `just deploy-all`) to manage building and deploying binaries across Windows and WSL boundaries.
# 3. Clipboard & Vision Tooling (Strict MCP Enforcement)
- **Rule (CRITICAL):** You MUST ALWAYS execute the `clipboard` MCP tool with action="read" (`mcp-memory`) when reading or inspecting text or images from the OS clipboard.
- **Rule:** NEVER run ad-hoc PowerShell (`System.Windows.Forms.Clipboard`), bash, or shell scripts to extract clipboard images or saved files. `clipboard` (read) handles native clipboard image extraction, auto-resizing, and compressed JPEG (`.jpg`) encoding to minimize LLM token usage.