mdc

Cursor rule "mdc" from graphprotocol/graph-tooling, covering cursor mdc file guidelines, file structure, 1. frontmatter, 2. metadata annotations and 3. content structure.

Cursor rule for Cursor

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 rules/graphprotocol/graph-tooling/mdc
Clone the repo
git clone --depth 1 https://github.com/graphprotocol/graph-tooling

Made for: Cursor.

Per session 1,857 This file is loaded in full into every session.
When invoked 1,857 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.01857 $0.01857
Opus 5 $0.00928 $0.00928
Sonnet 5 $0.00371 $0.00371
Haiku 4.5 $0.00186 $0.00186

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

Security

Grade A, and why

mdc scanned grade A with 0 findings 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 today.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/mdc.mdc · 355 lines

How it starts

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


description: Guidelines and best practices for creating .mdc (Markdown Configuration) files in Cursor, including structure, metadata annotations, and formatting rules globs: ["**/*.mdc"]

Cursor MDC File Guidelines

@context { "type": "documentation", "purpose": "cursor_rules", "format_version": "1.0.0", "supported_content_types": [ "guidelines", "api_docs", "examples", "implementations" ] }

@structure { "required_sections": [ "frontmatter", "title", "context", "content_sections" ], "optional_sections": [ "version", "last_updated", "examples", "implementations", "related_files" ], "recommended_sections": [ "practical_examples", "common_patterns", "type_definitions" ] }

File Structure

1. Frontmatter

@frontmatter_rules [ { "id": "position", "rule": "Must be at the very top of the file", "severity": "error" }, { "id": "description", "rule": "Single sentence, clear purpose", "severity": "error" }, { "id": "globs", "rule": "Array of relevant file patterns", "severity": "error" }, { "id": "related_docs", "rule": "Optional array of related documentation files - MUST only reference existing files", "severity": "error" }, { "id": "file_validation", "rule": "All referenced files must exist in the workspace", "severity": "error" } ]

Example frontmatter:

---
description: Guidelines for implementing feature X
globs: ["**/*.{ts,tsx}"]
related_docs: ["docs/architecture/feature-x.md"]
---

2. Metadata Annotations

@annotations { "syntax": "@annotation_name JSON_content", "placement": "Before relevant sections", "format": "Valid JSON with proper indentation", "types": { "context": "Project and document context", "rules": "List of rules or requirements", "format": "Format specifications", "options": "Available options", "examples": "Implementation examples", "implementations": "Full implementation details", "related": "Related documentation or code" } }

Read the full file on GitHub · 355 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. today First seen · 355 lines · 1,857 tokens per session scan A 0301fbf8a4c9

Subscribe to this mod's changes

mdc is a cursor rule published in the GitHub repository graphprotocol/graph-tooling (423 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,857 tokens to every session, about $0.0093 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.