Ctxlint logo

Ctxlint

Lints AI context files and MCP configs against codebases to find drift, secrets, contradictions, and broken references.

Install Ctxlint

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ctxlint": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ctxlint@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

ctxlint is an MCP server and CLI for checking AI agent context files, MCP configurations, and session data against a project’s actual codebase. It detects broken paths, mismatched commands, stale or contradictory instructions, token waste, exposed secrets, dead hooks, and configuration drift across related projects. Use it in an IDE or agent, CI, a pre-commit hook, or watch mode; the CLI can emit text, JSON, or SARIF and automatically repair some renamed paths.

Use cases

  • Check agent instructions after renaming files or changing build tools
  • Scan MCP and context configuration for embedded secrets
  • Enforce context-file consistency in CI or pre-commit hooks
  • Audit Claude Code hooks and memory after project changes
  • Export lint findings as SARIF for GitHub Code Scanning

Key features

  • Context, MCP configuration, and session-data linting
  • Broken-path detection with Git-based auto-fix
  • Command, contradiction, frontmatter, and token checks
  • Secret, dead-hook, and stale-memory auditing
  • Cross-project workflow, secret, and configuration checks
  • Text, JSON, SARIF, watch mode, and MCP output

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

9/9 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · @yawlabs/ctxlint@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars12Stargazers on the source repository.
npm downloads127kPackage downloads in the last 30 days.
Last commit12d agoMost recent push to the default branch.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Ctxlint works

What ctxlint does

ctxlint compares the instructions and configuration surrounding an AI coding project with the files, scripts, workflows, and settings that actually exist. It covers common context formats and files such as CLAUDE.md, AGENTS.md, Cursor rules, Copilot instructions, Windsurf rules, .mcp.json, and Claude Code settings.

Its checks include references to missing files, commands that do not match package.json, Makefile, Gradle, or Maven configuration, and instructions that conflict between context files. It also measures context usage, identifies content likely to be redundant, and highlights context that has become stale after code changes.

Security-focused checks find inline credentials matching several provider token and private-key patterns. CI checks compare workflows and referenced secrets with project documentation. Cross-project checks can identify missing workflows or secrets, and configuration differences among sibling repositories. Memory entries pointing to deleted paths and hooks targeting missing scripts are also covered.

How it works

The linter reads project context files and compares their claims with repository contents, build configuration, Git history, CI workflows, and selected settings. Git rename information and fuzzy matching help it suggest replacement paths when a referenced file moved. Secret findings redact the value and expose only a short prefix.

Run it as a command-line lint step, pre-commit check, CI job, or file watcher. The --watch option reruns checks when context files change, while --fix can rewrite broken paths using rename information. Output is available as human-readable text, JSON, or SARIF for GitHub Code Scanning.

As an MCP server, ctxlint exposes seven tools for editor and agent workflows. Tool annotations support clients that use them when deciding whether an action can be approved automatically.

Setup and configuration

Run the package without a global installation:

Terminal
npx -y @yawlabs/ctxlint@latest

For a team project, install it as a development dependency with npm or pnpm and add a script such as ctxlint --strict to package.json. A global npm installation is available when the command should be accessible across projects.

The MCP installation uses the package command and its serve argument. The project can also be added to a local Yaw MCP configuration for use in Yaw Terminal sessions. The --hooks-global option extends dead-hook scanning from the project’s Claude settings to the user-level ~/.claude/settings.json.

Tools and capabilities

  • Check context files against real project paths and build commands.
  • Detect contradictory instructions, stale references, redundant content, and token consumption.
  • Validate frontmatter in Cursor, Copilot, and Windsurf rule files.
  • Inspect CI workflows, documented secrets, sibling-project consistency, and missing workflows.
  • Find inline secrets without echoing their complete values.
  • Audit Claude Code hooks, permissions, and memory references.
  • Suggest or apply path repairs based on Git renames.
  • Serve results through MCP or emit text, JSON, and SARIF from the CLI.

Limitations and notes

Automatic repair is focused on broken paths that can be resolved through Git history; other findings remain lint results or suggestions. Secret detection reports only a redacted prefix rather than the full value. The available checks depend on the repository artifacts being inspected, such as build files, workflow files, sibling projects, and Claude settings.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Ctxlint

ctxlint is an MCP server that connects AI agent context files and MCP configurations to the project codebase for validation. Its main tools lint paths, commands, contradictions, secrets, workflows, hooks, and memory references, while also reporting token waste and supporting path fixes based on Git history.

Install it with `npx -y @yawlabs/ctxlint@latest` or add `@yawlabs/ctxlint` as a project development dependency with npm or pnpm. The MCP command uses the package’s `serve` argument; ctxlint can also be installed globally with npm.

Yes, ctxlint can run as a CI step. Add a command such as `ctxlint --strict` to the project’s package scripts, and select text, JSON, or SARIF output depending on how the pipeline consumes lint results.

Yes, ctxlint checks Cursor rule files, including their YAML frontmatter, and the project lists Cursor among the supported AI coding tools. It can also expose its linting capabilities through MCP for compatible editor or agent workflows.

ctxlint uses Git rename history and fuzzy matching to suggest replacement paths, and its `--fix` option can rewrite broken path references automatically. Findings that cannot be resolved from rename information remain available as lint results.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCtxlint AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ctxlint?style=directory)](https://allmcps.com/mcp/ctxlint)
HTML Embed
<a href="https://allmcps.com/mcp/ctxlint"><img src="https://allmcps.com/api/badge/ctxlint?style=directory" alt="Ctxlint on AllMCPs" /></a>