
mcp-lint
io.github.robert19001-cmyk由 GitHub 账号 robert19001-cmyk 发布v1.0.4更新于 Nov 7, 2026
Lint MCP tool schemas for eight clients and score recovery.
概览
为八种 AI 客户端检查 MCP 工具 schema,评估智能体出错后的恢复能力,并可用策略文件拦截高风险工具操作。
- 可以做什么
- 从文件或运行中的 stdio、SSE、HTTP 服务器读取工具 schema 并检查,支持严重级别过滤、质量评分和自动修复安全项。
- 展示 Claude、Cursor、Gemini、VS Code Copilot、Windsurf、Cline、OpenAI Agents SDK 与 Continue.dev 的逐客户端兼容性矩阵。
- 解释单条规则、对比两个 schema 版本、为在线工具列表生成快照,并输出 JSON、Markdown、SARIF 或 HTML 审计报告。
- 检查本机已配置的 Cursor、Claude、VS Code 服务器,并检查在线服务器的资源与提示。
- 评估工具失败信息能否告诉智能体下一步该调用哪个工具,并按 YAML 策略判定操作是放行、改写、需人工批准还是拒绝。
- 适用场景
- 适合在开发或维护 MCP 服务器时使用,让 schema 在多个客户端上都能正常工作,或在 CI 中让新增的 schema 错误导致构建失败。也适合审计本机已配置的 MCP 服务器,以及检验错误信息是否便于智能体恢复。
- 运行要求
- 需要 Node.js 与 npm 或 npx;包名为 mcp-lint,MCP 服务器入口为 mcp-lint-server。未声明任何账号、API 密钥或环境变量。检查在线服务器需要目标服务器命令或 URL,远程传输需要 URL。
安装
在 SourceWeft 中
- 打开 控制台中的 mcp-lint,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-lint
[npm version] [npm downloads] [License: MIT] [Node.js ≥20] [MCP server ready] [robert19001-cmyk/mcp-lint MCP server]
Lint MCP server tool schemas, then check whether an agent can recover when a tool fails.
Proof page, with a live bench: mcp-lint-alpha.vercel.app
MCP servers expose tool schemas consumed by Claude, Cursor, Gemini, VS Code Copilot, Windsurf, Cline, OpenAI Agents SDK, and Continue.dev. Each client has different JSON Schema support and quirks — a schema that works in Claude may silently break in Cursor or OpenAI. mcp-lint catches these issues before your users do.
This repository is 1.0.4. Install it with npx [email protected]. npm 1.0.3 is the previous registry release. npm 1.0.1 and npm 1.0.2 were not published. Design notes: PRODUCT.md, ROADMAP.md, ARCHITECTURE.md, SECURITY.md, RELEASE.md. Those files describe the current code. They are not extra commands.
Installation
Quick Start
mcp-lint compat — Compatibility Matrix
See exactly which tools work with which clients:
mcp-lint explain — Rule Documentation
CLI Reference
mcp-lint check [input]
Exit codes:
mcp-lint report <file>
Writes the versioned audit report for one tools file. check --format json still prints the diagnostic array. report --format json prints MCPAuditReport.
Formats are terminal, json, markdown, sarif, and html. The HTML file has inline CSS and no script. Token totals are a local chars / 4 estimate. The compatibility section is filled from that same lint. A cell is measured or not_observed. An empty tool list leaves the section not run. Recovery, preflight, and live inspection stay marked as not run. When the run has no schema errors, the report says: "No schema errors in this run. Recovery, preflight, and live inspection were not measured."
--baseline exits 1 when the stable snapshot differs. The snapshot pins generatedAt and keeps tool.version. Pass either --baseline or --update-baseline, not both. Exit 1 when the report contains an error, or when the file cannot be read.
mcp-lint catalog
Lists resources and prompts from one live server, then lints that list. It does not read installed configs and it does not call a tool. An empty or repeated URI, an empty resource name, an empty or repeated prompt name, and an empty or repeated argument name are errors and exit 1. A repeated resource display name, and a missing description, are warnings and do not. explain prints the rule. The fix class is manual: the command does not rewrite the server.
--server is stdio, sse, or http. Remote transports need --url. --timeout, --max-items, and --max-bytes bound each list. A method the server does not implement is unsupported and exits 0. Any other list failure exits 1. A lint error also exits 1. Usage errors exit 2. --format is terminal or json. JSON adds a findings array to the list. The array is empty when the list is clean.
mcp-lint diff <before> <after>
Compare lint results between two versions of your schema — useful in CI to catch regressions.
Exit codes: 0 = no new errors introduced, 1 = new errors found, 2 = error
mcp-lint check --installed
Reads the MCP configs already on this machine and lints each local stdio server. Nothing is uploaded. Remote URLs are skipped unless you pass --remote.
Looked-up files:
--strict also exits 1 when a configured server fails to start. Without it, a start failure is printed and the exit code follows the schema errors. If two started servers expose the same tool name, both reports include tool-name/server-collision.
mcp-lint snapshot
Writes the live tools/list as a stable JSON file. Commit that file and compare it with diff when the server changes. diff exits 1 when the new file introduces an error the old file did not have.
mcp-lint fix [input]
Writes fixes marked safe. review and manual fixes are printed by --dry-run and left in the file. mcp-lint does not invent titles, descriptions, or hints.
mcp-lint init
Creates a default .mcplintrc.json in the current directory.
Rules
Universal (all clients)
Tool names
OpenAI and Azure use that pattern. A space, slash, or dot makes the tool disappear. See examples/names/unsafe.json.
Claude-specific
Cursor-specific
Gemini-specific
VS Code Copilot-specific
Windsurf-specific
Cline-specific
OpenAI Agents SDK-specific
Continue.dev-specific
Configuration
mcp-lint auto-discovers .mcplintrc.json starting from the current directory up to your home folder. Override with --config.
Presets
Use "extends" to start from a built-in preset:
Rule severities: "error" | "warning" | "info" | "off"
CI/CD — GitHub Actions
Using the official Action
Action inputs:
The action in this repository writes a ::error, ::warning, or ::notice annotation from check --format json. With an empty input it also looks one directory down, skipping node_modules and dot directories. sarif: true uploads SARIF when the installed CLI has report. Tag v1.0.4 installs mcp-lint@1 unless version is set. Tag v1.0.3, tag v1.0.2, and tag v1.0.1 do the same. Tag v1.0.0 still installs npm latest. The workflow needs security-events: write.
Manual workflow
Plugin API
Share and reuse rule sets via npm packages.
Using a plugin
Writing a plugin
A plugin is an npm package that exports a rules array of Rule objects:
Programmatic API
mcp-lint preflight — Runtime Decision Firewall
Lint catches bad schemas. Preflight catches bad actions.
At runtime, your agent is about to call a tool — delete a file, send a request, charge a card. Preflight sits between the agent and the action and answers:
- Is it allowed?
- How risky is it? (0.0–1.0 deterministic score)
- Is it reversible?
- Does it need human approval?
- Is there a safer alternative?
Action format
Policy file (YAML)
Sample policies in examples/policies/: default.yml, strict.yml, permissive-dev.yml.
SDK — embed in your MCP server or agent runtime
Exit codes
Use them directly in shell wrappers or CI gates.
mcp-lint recover — Can the agent get back up?
Schema lint does not say what happens when a tool fails. recover reads the error text and checks four things an agent limited to MCP tools needs:
- A credential or permission error names a tool on this server, such as
login. - A rate limit or timeout names the call to repeat. "Wait and retry" is not enough.
- The next step is not a terminal command, a config edit, or a web page.
- The failure is not silent, and a hang is cut off at 15 seconds.
rate_limit and timeout count as transient. Every other kind counts as permanent. Exit 1 when any sample has an error. Exit 0 when every scored failure is recoverable.
A live probe lists tools and does not call them. Calling tools requires both --sandbox and --invoke. Tools with no required arguments are still skipped, so an empty call cannot fire a tool that declares no inputs.
File shape:
kind is credential, permission, rate_limit, explicit, silent, timeout, or malformed.
MCP Server
mcp-lint also ships as a stdio MCP server for Claude Desktop, Claude Code, Cursor, VS Code, and registry scanners such as Glama.
Client config:
Available MCP tools:
All server tools are read-only from the host perspective: they return diagnostics, fixed JSON, or policy decisions and never execute the action being evaluated.
Docker
The repository includes glama.json and a production Dockerfile so MCP directories can build, start, and introspect the server.
Site
The proof page is in site/. Version 1.0.4. It runs the same recovery scorer, schema linter, and preflight function as the CLI. The check bench uses the same error index, title collapse, and next step as the terminal. catalog lints the resources and prompts it listed.
The public page is https://mcp-lint-alpha.vercel.app/. The same page runs locally:
Open http://127.0.0.1:4731. The built page is not part of the npm package.
License
MIT © Robert
来源:README.md,提交 a0535d5
工具
0版本历史
5- v1.0.4最新Nov 7, 2026
- v1.0.0Nov 1, 2026
- v0.8.0Oct 31, 2026
- v0.7.0Oct 29, 2026
- v0.5.3Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分