AST Lint MCP Server
raw JSON → 0.1.0 verified Fri May 01 auth: no javascript
AST Lint MCP Server (v0.1.0) is a Model Context Protocol server that exposes AST Lint's static code analysis capabilities to MCP clients like Claude Code. It provides 34 code quality rules covering security, maintainability, performance, accessibility, and Vue-specific issues. Runs locally with no remote server, supports persistent process (~50ms response), category/severity filtering, batch and git diff incremental analysis, and automatic AI integration. Differentiator: seamless integration with Claude Code via MCP, enabling natural language-driven code review. Requires Node.js >= 18.
Common errors
error Command 'ast-lint-mcp' not found ↓
cause Package not installed globally or npx not available.
fix
Run with npx: npx -y ast-lint-mcp, or install globally: npm install -g ast-lint-mcp
error Cannot find module 'ast-lint-mcp' ↓
cause Incorrect import path or missing dependency.
fix
Install locally: npm install ast-lint-mcp, then import from 'ast-lint-mcp'
error Error: AstLint config not found ↓
cause No .astlintrc.json present in project hierarchy.
fix
Create a .astlintrc.json file in the project root with a valid configuration (see README).
Warnings
breaking Requires Node.js >= 18. Older versions not supported. ↓
fix Upgrade Node.js to v18 or later.
deprecated Configuration via .astlintrc is preferred; older formats (.astlintrc, astlint.config.json) may be deprecated ↓
fix Use .astlintrc.json with version 0.6.0 schema.
gotcha The default export is not documented; most users run the package via CLI/MCP, not as a library. ↓
fix Use npx or global install as instructed; avoid importing directly.
gotcha Git diff analysis may miss unstaged changes if files are not staged. ↓
fix Stage changes first (git add) before running diff analysis.
gotcha Configuration file search starts from current directory upwards; no cwd option available. ↓
fix Run npx from project root or set cwd in MCP config.
Install
npm install ast-lint-mcp yarn add ast-lint-mcp pnpm add ast-lint-mcp Imports
- default wrong
const astLintMcp = require('ast-lint-mcp')correctimport astLintMcp from 'ast-lint-mcp' - createServer wrong
import { createMCPServer } from 'ast-lint-mcp'correctimport { createServer } from 'ast-lint-mcp' - runLint
import { runLint } from 'ast-lint-mcp'
Quickstart
// MCP client configuration (e.g., in ~/.claude.json)
// The server is started via npx; no programmatic import needed.
{
"mcpServers": {
"ast-lint": {
"type": "stdio",
"command": "npx",
"args": ["-y", "ast-lint-mcp"]
}
}
}
// In Claude Code, ask naturally:
// "Check for security issues in src/"
// "Analyze git diff for code quality problems"