diff --git a/agent-rules/mcp_and_build_constraints.md b/agent-rules/mcp_and_build_constraints.md new file mode 100644 index 0000000..939b88f --- /dev/null +++ b/agent-rules/mcp_and_build_constraints.md @@ -0,0 +1,16 @@ +--- +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: \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 `read_clipboard` MCP tool (`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. `read_clipboard` handles native clipboard image extraction, auto-resizing, and compressed JPEG (`.jpg`) encoding to minimize LLM token usage.