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.
npx agentmods add rules/prisma/orm/mongodb-memory-server-setupgit clone --depth 1 https://github.com/prisma/ormWhat 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 | $0.00028 | $0.00542 |
| Opus 5 | $0.00014 | $0.00271 |
| Sonnet 5 | $0.00006 | $0.00108 |
| Haiku 4.5 | $0.00003 | $0.00054 |
Grade A, and why
mongodb-memory-server-setup 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 2d 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.
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.
Copies of this mod
1 near-identical copy found in the catalogue:
- mongodb-memory-server-setup — 94% identical, 4 lines differ
How it starts
The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
mongodb-memory-server setup
When adding mongodb-memory-server (MMS) to a package or writing tests that use it, follow these rules to prevent CI failures.
Version: use the pnpm catalog
MMS is pinned to an exact version in pnpm-workspace.yaml's catalog: section. All consumers must reference it via "mongodb-memory-server": "catalog:" in package.json.
Never use a ^ range or inline version — version drift between packages can cause one package's download to corrupt the shared binary cache used by another.
Vitest config: mandatory timeouts
Every package that depends on MMS must configure its vitest.config.ts with:
import { timeouts } from '@repo/test-utils';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
testTimeout: timeouts.spinUpMongoMemoryServer,
hookTimeout: timeouts.spinUpMongoMemoryServer,
fileParallelism: false,
},
});
Why this matters
MMS downloads, extracts, and caches the mongod binary on first use. On CI this happens in the beforeAll hook. If the hook times out mid-download/extraction:
- The partially-written binary is left in the shared MMS cache (
~/.cache/mongodb-binaries/). - Every subsequent test package that starts MMS executes the corrupted binary.
- The corrupted binary crashes with
SIGSEGV, causing cascading failures across the entire CI run.
The spinUpMongoMemoryServer timeout (60s × TEST_TIMEOUT_MULTIPLIER) is sized to survive a cold-cache download on CI. The default vitest timeout (10s) is not.
fileParallelism: false
MMS instances within the same package must not start concurrently — parallel replica set startups compete for resources and can cause flaky timeouts.
Checklist for adding MMS to a new package
- Add
"mongodb-memory-server": "catalog:"todevDependencies - Add
"@repo/test-utils": "workspace:*"todevDependencies - Configure
vitest.config.tsas shown above - Use
timeouts.spinUpMongoMemoryServerfor anydescribe()/beforeAll()/afterAll()timeout overrides in test files - Run
pnpm installto update the lockfile
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.
- 2d ago First seen · 54 lines · 28 tokens per session scan A 8b24e48e26d7
mongodb-memory-server-setup is a cursor rule published in the GitHub repository prisma/orm (47,579 stars, last pushed yesterday), licensed Apache-2.0. It adds 28 tokens to every session and 542 once invoked, about $0.0001 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-08-30.
Other cursor rules, from other repositories
config-validation-and-normalization
Patterns for config validation and normalization using Arktype.
contract-space-package-layout
On-disk layout for packages that expose a contract space (extensions, internal monorepo packages, aggregate-root apps).
cli-package-exports
CLI package export patterns and import conventions.
resolving-cyclic-dependencies
How to resolve cyclic dependencies when moving types or refactoring packages.
no-family-vocabulary-in-framework
The framework domain (packages/1-framework) carries no family- or target-specific vocabulary — types, fields, hooks, or strategy values. Enforced by lint:framework-vocabulary.
review-scope-overrides
Honor explicitly provided base branches in review artifacts.