euclidMCPPaper CLAUDE.md

Project instructions for developing Euclid-MCP, a Python service that exposes tools through the Model Context Protocol.

In plain words
What is it for?
They guide Python style, strict type checking, data models, milestone order, engine separation, and input sanitisation.
Why use it?
They keep the implementation consistent with the project specification and prevent unsafe or nondeterministic behaviour.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/snegi26/euclidmcppaper/claude-md
Clone the repo
git clone --depth 1 https://github.com/snegi26/euclidMCPPaper
Per session 1,315 This file is loaded in full into every session.
When invoked 1,315 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01315 $0.01315
Opus 5 $0.00658 $0.00658
Sonnet 5 $0.00263 $0.00263
Haiku 4.5 $0.00131 $0.00131

Measured yesterday against content hash 9af1e2cbf425, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

euclidMCPPaper CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Never `shell=True`. Pass argv lists to `subprocess.run`. Clean up temp files in
CLAUDE.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md — Euclid-MCP project conventions

Binding guidelines for any agent working in this repo. Read alongside SPEC.md.

Golden rules

  1. Spec is the source of truth. Implement what SPEC.md + specs/*.md describe. If reality forces a deviation, note it in the PR and update the spec in the same change — never let code and spec drift.
  2. Milestone discipline. Build M0→M6 in order. A milestone is not "done" until ruff, mypy --strict, and that milestone's tests are green. Don't scaffold ahead.
  3. The IR boundary is sacred. Nothing above lowering/ may mention Prolog. ir/, tools/, and the MCP surface stay engine-agnostic so a second backend can be added later.
  4. Determinism over cleverness. Normalize ordering, avoid nondeterministic dict iteration in outputs, seed nothing random. Same input ⇒ same bytes.

Language & style (Python)

  • Python ≥ 3.11, src layout (src/euclid_mcp/).
  • Type hints everywhere; mypy runs in --strict. No Any unless justified with a comment.
  • Pydantic v2 for every tool I/O model and the IR AST. Use model_config = ConfigDict(extra="forbid", str_strip_whitespace=True). Use field_validator (not validator), model_dump() (not dict()).
  • Ruff for lint + format (line length 100). Rule sets: E,F,I,UP,B,SIM,RUF.
  • Module-level constants in UPPER_CASE (MAX_INPUT_BYTES = 500_000, DEFAULT_TIMEOUT_S = 30, DEFAULT_MAX_SOLUTIONS = 5, DEFAULT_MAX_DEPTH = 30).
  • Group imports: stdlib / third-party / local. Prefer specific exceptions over bare Exception.
  • DRY: shared parse→lower→run pipeline lives in one place; the four tools call it, they do not each re-implement it.
  • Docstrings on every public function; for tools, the docstring is the MCP description — make it precise and include the return schema.

MCP conventions (from MCP best practices)

  • Server name: euclid_mcp ({service}_mcp, lowercase, no versions/dates).
  • Tool names: exactly reason, diagnose, what_if, check_kb (snake_case, paper-defined — do not rename or prefix).
  • Every @mcp.tool sets name and annotations. All four tools are read-only:
    annotations={
        "title": "...",
        "readOnlyHint": True,
        "destructiveHint": False,
        "idempotentHint": True,
        "openWorldHint": False,
    }
    
  • Tool inputs are a single Pydantic model argument with Field(...) descriptions and constraints. Let Pydantic validate; don't hand-roll validation.
  • Errors are feedback, not exceptions across the boundary. Backend/parse errors are returned as readable text in the result payload so the LLM can self-correct — never leak a stack trace or crash the tool call. Messages must be actionable ("Undefined predicate mortal/1; add a fact or rule with head mortal(...)").
  • Prefer structured returns (Pydantic models) so FastMCP emits an output schema; also include a rendered human-readable field where the paper shows one (conclusion, proof-tree text).

Read the full file on GitHub · 103 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 103 lines · 1,315 tokens per session scan A 9af1e2cbf425

Subscribe to this mod's changes

euclidMCPPaper CLAUDE.md is an instructions file published in the GitHub repository snegi26/euclidMCPPaper (0 stars, last pushed 1mo ago), licensed MIT. It adds 1,315 tokens to every session, about $0.0066 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens