awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.
Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdcnpx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/notion-apiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/notion-api)<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/notion-api"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/notion-api.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02781 | $0.02781 |
| Opus 5 | $0.01391 | $0.01391 |
| Sonnet 5 | $0.00556 | $0.00556 |
| Haiku 4.5 | $0.00278 | $0.00278 |
Grade B, and why
notion-api scanned grade B 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 3d ago.
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.
Sends data to an external URLmediumData exfiltration
A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.
return fetch('https://api.notion.com/v1/pages', { method: 'POST', How it starts
The opening of the file, as written. The whole thing — 366 lines — stays where its author put it; the contents beside it link to each section on GitHub.
notion-api Best Practices
This guide establishes the definitive best practices for interacting with the Notion API. Adhering to these rules ensures our integrations are secure, performant, type-safe, and easily maintainable. We prioritize official SDKs and structured data handling.
1. Code Organization and Structure
Organize your Notion API interactions into dedicated modules. Separate concerns like authentication, data fetching, and data transformation.
✅ GOOD: Modular Structure
// src/notion/client.ts
import { Client } from '@notionhq/client';
export const notionClient = new Client({
auth: process.env.NOTION_API_TOKEN,
});
// src/notion/pages.ts
import { notionClient } from './client';
import { CreatePageParameters, GetPageResponse } from '@notionhq/client/build/src/api-endpoints';
export async function createNotionPage(params: CreatePageParameters): Promise<GetPageResponse> {
return notionClient.pages.create(params);
}
// src/notion/databases.ts
import { notionClient } from './client';
import { QueryDatabaseParameters, QueryDatabaseResponse } from '@notionhq/client/build/src/api-endpoints';
export async function queryNotionDatabase(databaseId: string, params?: QueryDatabaseParameters): Promise<QueryDatabaseResponse> {
return notionClient.databases.query({ database_id: databaseId, ...params });
}
❌ BAD: Monolithic or Scattered Logic
// src/index.ts (or any random file)
import { Client } from '@notionhq/client';
async function main() {
const notion = new Client({ auth: 'secret_token_hardcoded' }); // Hardcoded token is a major NO
const response = await notion.databases.query({ database_id: 'some_id' });
// ... page creation, block updates, all in one place
}
2. Authentication and Token Management
Always use granular integration tokens, store them in environment variables, and implement rotation. Never hardcode tokens.
✅ GOOD: Secure Token Handling
// .env
NOTION_API_TOKEN="secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
// src/notion/client.ts
import { Client } from '@notionhq/client';
if (!process.env.NOTION_API_TOKEN) {
throw new Error('NOTION_API_TOKEN is not set in environment variables.');
}
export const notionClient = new Client({
auth: process.env.NOTION_API_TOKEN,
});
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.
- 3d ago First seen · 366 lines · 2,781 tokens per session scan B 86dddc3a4cf3
notion-api is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 2,781 tokens to every session, about $0.0139 per session on Opus 5. A static security scan graded it B with 1 finding (sends data to an external url). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
python
Python best practices and patterns for modern software development with Flask and SQLite.
api-property-optionality-hygiene
Fix ApiProperty/ApiPropertyOptional optionality mismatches in DTO files; use for scheduled batch fixes or DTO edits.
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
shared-libraries
Shared libraries - condition framework, inventory containers, file-backed DB, itinerary, references.
env-validation-gate
Env validation gate — every app with ≥1 required env var validates its contract at boot via Zod; raw process.env is banned outside the env module. Full pattern in .claude/skills/t2000-env-gate/.
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.