Momus-MCP
Audits JavaScript test suites for false-green tests, including tautological assertions, mock-contract drift, and mock hygiene issues.
Detects tautological assertions, mock-contract drift, and mock hygiene issues in Jest test files.
Audits PHP test suites built with PHPUnit, Pest, or Mockery for false-green tests, including tautological assertions, mock-contract drift, and mock hygiene issues.
Audits TypeScript test suites for false-green tests, including tautological assertions, mock-contract drift, and mock hygiene issues.
Detects tautological assertions, mock-contract drift, and mock hygiene issues in Vitest test files.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Momus-MCPaudit my test suite for false-green tests and mock drift"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Momus-MCP
The ultimate critic among the deities — pointed at your test suite.
Momus (Μῶμος) is the ancient Greek spirit and personification of satire, mockery, blame, and harsh criticism — the one god whose entire job was to find fault, and who was finally thrown off Olympus for doing it too well. His name literally translates to "blame" or "censure".
Momus-MCP is a local-first, deterministic, read-only MCP server and CLI that audited test suites the way Momus audited the gods: ruthlessly, and with no tolerance for things that pass while proving nothing. It hunts false-green tests — suites that go green because of tautological assertions, mock-contract drift, and mock-hygiene problems, not because the code works. The name is doubly apt: Momus is the god of mockery, and mock objects are exactly what this tool scrutinizes.
Status: pre-release. Momus-MCP is not yet published to npm — the publish step in the release workflow is deliberately dormant (credential-blocked). The source is public; install from source (see Quick Start). Any
npx @momus/*command you find elsewhere will not resolve until the packages are published.
Why Momus-MCP?
Coding agents are great at writing tests. They are also great at writing tests that can never fail — asserting a mock's own configured return value, stubbing a method that no longer exists, or comparing a value with itself. The result is a suite that is green and useless.
Momus-MCP statically detects these. It never executes your code, never talks to the network, and never writes to your workspace. It just reads the source, builds a symbol graph of your production code, and checks every mock, spy, and assertion against it.
Relentless detection
Category | Rules | What it catches |
Tautological assertions |
| self-comparison, mock-echo (asserting a stub's own return), constant-tautology, mock-only assertions, zero-reach stubs, unconfigured-spy assertions |
Mock-contract drift |
| unresolvable targets, missing members, signature mismatches, return-type mismatches, constructor drift, missing exports, stale mocks (git-diff aware) |
Mock hygiene |
| over-mocking (saturation), mocking the module under test |
Deterministic by contract
Read-only — every tool is annotated
readOnlyHint: true, destructiveHint: false.Deterministic — byte-identical output for an identical workspace (golden-tested).
Token-budgeted — every finding renders in < 100 tokens (unit-tested).
Zero false positives on the reference healthy suite — anti-pattern fixtures ship with a healthy twin, and both are asserted in CI.
Zero runtime dependencies in
@momus/core— the engine is pure TypeScript.
Two languages, one engine
TypeScript / JavaScript — Vitest and Jest (
vi.mock,vi.fn,vi.spyOn,vi.mocked,jest.mock, object-literal and Proxy doubles, automock helpers).PHP — PHPUnit, Pest, and Mockery (
createMock,getMockForAbstractClass,mock(),Mockery::mock, closure-form mocks, docblock@param/@returntyping, Composer PSR-4 and classmap resolution).
Related MCP server: checkyourself
Quick Start
Requirements: Node.js ≥ 20.
git clone <this repository>
cd momus-mcp
npm ci
npx momus audit .Momus exits with:
Code | Meaning |
| no error-level findings |
| error-level findings present |
| usage or configuration error |
| unexpected internal error |
Once published, the same experience is a one-liner:
npx momus audit . # Markdown report; exit 1 on errors
npx momus audit . --json # machine-readable JSON envelopeUseful commands
npx momus audit . # full audit (tautology + drift + hygiene)
npx momus audit tests/order.test.ts # scope to specific paths
npx momus drift # mock-contract drift only
npx momus precommit # drift on uncommitted changes (git-diff scope)
npx momus hook --install --yes # install the pre-commit drift gate
npx momus annotate # JSONL findings for editor plugins
npx momus contract src/services/ledger.ts # synthesize a strict mock from a real class
npx momus rules # list rules and severities
npx momus init # scaffold a .momusrc config
npx momus doctor # inspect the local setup
npx momus serve # run the MCP server (stdio)
npx momus serve --transport http --port 3000 # Streamable HTTP transport
npx momus serve --watch # re-audit on file changes (chokidar)MCP server
Momus speaks stdio (default) or Streamable HTTP, and is read-only. Point it at a workspace with
MOMUS_ROOT.
Claude Desktop
{
"mcpServers": {
"momus": {
"command": "npx",
"args": ["-y", "@momus/mcp-server"],
"env": {
"MOMUS_ROOT": "/absolute/path/to/your/project"
}
}
}
}Cursor and other MCP clients
The same shape works in any MCP client:
{
"command": "npx",
"args": ["-y", "@momus/mcp-server"],
"env": {
"MOMUS_ROOT": "/absolute/path/to/your/project"
}
}Tools
Tool | What it does |
| Deep audit of a test file: every mock/spy/stub checked against its real production dependency |
| Find assertions that cannot fail |
| Find test doubles that no longer match production (supports |
| Generate a strict typed mock template from a real class/interface |
| The rule catalog with severities |
Use cases
Agent guardrails — drop Momus into a coding agent's loop and block it from committing a test that "passes" by echoing the mock it just configured.
Pre-commit drift gate —
momus hook --install(orprecommitin CI) fails the commit the moment a production rename leaves a test double behind.Mock-contract generation — point
synthesize_mock_contractat a class and get a typed,satisfies Partial<T>template instead of hand-writingas anystubs.PHP parity — the same rules for PHPUnit/Pest suites, including constructor drift and docblock-typed returns.
How it works
flowchart LR
Source[Test + Production Source] --> Parser[Language Parsers]
Parser --> IR[Normalized IR]
IR --> Index[SymbolIndex]
Index --> Rules[Rules Engine]
Rules --> Report[Markdown / JSON / JSONL]Discover source and test files (capped, gitignore-aware).
Parse each file into a language-neutral IR (TypeScript via the compiler API, PHP via
php-parser) — a persistentbetter-sqlite3cache keyed by content hash + workspace digest makes warm audits fast.Index production symbols into a graph of classes, interfaces, members, and signatures.
Run rules — every mock and assertion is checked against the real production contract; findings are suppression-aware and rendered under a token budget.
Report — Markdown, a JSON envelope, or JSONL for editor plugins, with honest exit codes.
Configuration
Momus reads .momusrc from the workspace root. npx momus init scaffolds one:
{
"languages": { "typescript": true, "php": false },
"testFilePatterns": ["**/*.{test,spec}.{ts,tsx,js,jsx,mjs}", "**/__tests__/**"],
"ignorePatterns": ["**/node_modules/**", "**/dist/**", "**/.git/**"],
"rules": {
"TAUT-002": { "severity": "error" }
},
"tokenBudget": { "maxIssuesPerReport": 50, "maxIssueLineTokens": 100 },
"cache": { "dir": ".momus/cache", "enabled": true }
}Intentional exceptions are marked in source:
// @momus-ignore:TAUT-002
expect(result).toEqual(configuredValue);See the specification for the complete suppression grammar (line, trailing, docblock,
file-banner) and the full configuration schema (schemas/momusrc.schema.json).
Documentation hub
Document | Contents |
Specification index and project status | |
Parsing strategy, IR, symbol index, mock catalog | |
Rule catalog and detection algorithms | |
MCP tool schemas and agent protocol | |
Issue grammar and Markdown/JSON schemas | |
Implementation status and sequenced plan | |
Current engineering handover |
Development
npm ci
npm run typecheck # 0 errors across all packages
npm test # vitest: unit + integration + golden suites
npm run test:coverage # v8 coverage with floors (80% stmts/lines, 75% branches, 90% funcs)
npm run lint # ESLint (flat config, typescript-eslint)
npm run format:check # Prettier
npm run audit-self # Momus audits its own repo — must stay CLEANThe repository is an npm workspace. Package sources run directly from TypeScript during this
pre-publish phase; npx momus resolves through the workspace bin after npm ci.
License
Released under the MIT License — free for any use, commercial included. It speaks any MCP client, not just Claude Code, and reads code you already have. Like its namesake, it will tell you exactly what is wrong — politely is not in the job description.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityCmaintenanceA deterministic, network-free MCP server for validating repository release hygiene and version alignment in local projects. It enables automated repository health checks and generates standardized release checklists based on project state.1
- AlicenseBqualityAmaintenanceLocal-first production-readiness MCP server for AI-built apps. It runs read-only checks, produces an evidence-based readiness score, and guides fixes before launch.95Apache 2.0
- Alicense-qualityBmaintenanceA local-first, auditable code review MCP server that freezes Git changes, creates immutable ReviewBundles, provides role-isolated contexts for correctness, security, architecture, and test reviewers, validates structured findings, and generates deterministic JSON/Markdown reports.8Apache 2.0
- Alicense-qualityAmaintenanceA secure, local-first MCP server for read-only inspection and troubleshooting of development environments, exposing narrow, typed, auditable capabilities for repository inspection, log summarization, Docker review, and security scanning without granting unrestricted machine access.MIT
Related MCP Connectors
MEOK MCP Test MCP — golden-file + schema-drift + tool-failure tests for any MCP server. Drop-in
Conformance checker for MCP servers. Free, no key, verdicts recomputable and re-measured daily.
Monitor MCP servers, API contracts and AI outputs for schema drift. Alerts on breaking changes.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AraneaDev/Momus-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server