# ctxlint

> ctxlint is an open-source MCP server for developer tools. Lint CLAUDE.md, AGENTS.md and .mcp.json against your actual codebase. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://yaw.sh/mcp-servers/ctxlint/
- **Repository:** https://github.com/yawlabs/ctxlint
- **MCP Registry name:** io.github.YawLabs/ctxlint
- **Categories:** developer tools, security
- **Listing updated:** 2026-11-14

## About

Context files drift: a renamed file or changed test runner leaves instructions that make an agent fail. ctxlint cross-references those files against the repo and also checks MCP configs and session data. It runs as a CLI, CI step, pre-commit hook or MCP server started with the serve subcommand.

Checks include broken paths with replacement suggestions drawn from git renames, commands missing from package.json or a Makefile, stale files, token cost per file, redundancy, and contradictions such as Jest in one file and Vitest in another. It flags hardcoded keys and Bearer tokens in git-tracked configs without echoing the secret, and compares sibling repos for missing CI secrets or workflows.

MIT, from Yaw Labs, a single bundle with no runtime dependencies.

## Features

- **Broken-path detection:** Suggests fixes from git history.
- **Command checks:** Compares commands with scripts and targets.
- **Secret scan:** Flags keys in tracked configs.
- **Token budget:** Shows context cost per file.
- **Contradiction finder:** Spots conflicting instructions.
- **Sibling-repo drift:** Compares secrets and workflows.

## Good for

- Audit context files before a PR
- Catch a leaked key in .mcp.json
- Trim context bloat
- Run in CI

## Install

### Claude Code (Terminal)

```sh
claude mcp add ctxlint -- npx -y @yawlabs/ctxlint
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "ctxlint": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ctxlint"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "ctxlint": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ctxlint"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "ctxlint": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ctxlint"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "ctxlint": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ctxlint"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "ctxlint": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ctxlint"
      ]
    }
  }
}
```

## FAQ

### Which files?

CLAUDE.md, .cursorrules, AGENTS.md and .mcp.json.

### How to run?

CLI, hook, CI or the serve subcommand.

### Licence?

MIT.

### Is ctxlint free?

Yes. ctxlint is open source, so you can use and self-host it for free.

### How do I add ctxlint to Claude Code?

Run this command in your terminal: claude mcp add ctxlint -- npx -y @yawlabs/ctxlint

### What are the best alternatives to ctxlint?

The closest alternatives to ctxlint are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/ctxlint
