@yawlabs/ctxlint 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pre-commit-hooks.yaml +1 -1
- package/MCP_CONFIG_LINT_SPEC.md +7 -4
- package/README.md +1 -1
- package/dist/index.js +2376 -1357
- package/mcp-config-lint-rules.json +13 -0
- package/package.json +13 -13
package/.pre-commit-hooks.yaml
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Version-pinned so a checkout at `rev: vX.Y.Z` runs exactly that release
|
|
5
5
|
# of ctxlint — matches the pinning done by `ctxlint init`. release.sh keeps
|
|
6
6
|
# this in sync with package.json on each bump.
|
|
7
|
-
entry: npx @yawlabs/ctxlint@0.
|
|
7
|
+
entry: npx @yawlabs/ctxlint@0.17.0 --strict
|
|
8
8
|
language: node
|
|
9
9
|
always_run: true
|
|
10
10
|
pass_filenames: false
|
package/MCP_CONFIG_LINT_SPEC.md
CHANGED
|
@@ -16,7 +16,7 @@ This specification defines a standard set of lint rules for validating MCP serve
|
|
|
16
16
|
|
|
17
17
|
The specification includes:
|
|
18
18
|
- A complete reference of MCP config file locations, formats, and client-specific behaviors
|
|
19
|
-
-
|
|
19
|
+
- 29 lint rules organized into 8 categories with defined severities
|
|
20
20
|
- A machine-readable rule catalog ([`mcp-config-lint-rules.json`](./mcp-config-lint-rules.json))
|
|
21
21
|
- Auto-fix definitions for rules that support automated correction
|
|
22
22
|
|
|
@@ -199,7 +199,7 @@ Without this wrapper, the subprocess fails to spawn. This is the most common Win
|
|
|
199
199
|
|
|
200
200
|
## 2. Lint Rules
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
29 rules organized into 8 categories. Each rule has a unique ID, severity level, trigger condition, and message template.
|
|
203
203
|
|
|
204
204
|
Severity levels:
|
|
205
205
|
- **error** — the config is broken or has a security issue. Should fail CI.
|
|
@@ -226,19 +226,22 @@ Validates that the config file is well-formed JSON with the correct structure fo
|
|
|
226
226
|
|
|
227
227
|
### 2.2 mcp-security — hardcoded secrets
|
|
228
228
|
|
|
229
|
-
Detects secrets committed to version control in MCP config files. The three secret rules (`hardcoded-bearer`, `hardcoded-api-key`, `secret-in-url`) only flag issues in git-tracked files — an untracked config leaks nothing to teammates. `mcp-security/http-no-tls` is a transport concern, independent of version control, and fires regardless of git tracking.
|
|
229
|
+
Detects secrets committed to version control in MCP config files. The three secret rules (`hardcoded-bearer`, `hardcoded-api-key`, `secret-in-url`) only flag issues in git-tracked files — an untracked config leaks nothing to teammates. `mcp-security/http-no-tls` is a transport concern, independent of version control, and fires regardless of git tracking. When the tracked status cannot be determined at all (git unavailable or failing, as opposed to a determined "untracked"), the linter says so via `mcp-security/secret-scan-skipped` instead of silently passing a possibly-tracked file.
|
|
230
230
|
|
|
231
231
|
| Rule ID | Severity | Trigger | Message |
|
|
232
232
|
|---|---|---|---|
|
|
233
233
|
| `mcp-security/hardcoded-bearer` | error | `Authorization` header contains a literal Bearer token (not an env var reference) in a git-tracked file | `Server "{name}" has a hardcoded Bearer token in a git-tracked file` |
|
|
234
234
|
| `mcp-security/hardcoded-api-key` | error | Header or env value matches known API key patterns (or the high-entropy heuristic below) in a git-tracked file | `Server "{name}" has a hardcoded API key in a git-tracked file` |
|
|
235
235
|
| `mcp-security/secret-in-url` | error | URL contains query params that look like secrets (`?key=`, `?token=`, `?api_key=`) in a git-tracked file | `Server "{name}" has a secret in the URL query string` |
|
|
236
|
+
| `mcp-security/secret-scan-skipped` | info | Git-tracked status could not be determined (git unavailable/failing — not merely untracked), so the three git-gated secret rules were skipped | `Could not determine git-tracked status of {file}; hardcoded-secret rules were skipped` |
|
|
236
237
|
| `mcp-security/http-no-tls` | warning | URL uses `http://` for a non-loopback target (loopback = `localhost`, `[::1]`, `127.0.0.0/8`) | `Server "{name}" uses HTTP without TLS` |
|
|
237
238
|
|
|
238
239
|
**Known API key patterns:**
|
|
239
240
|
```
|
|
240
241
|
sk-ant-[A-Za-z0-9_-]{20,} # Anthropic
|
|
241
|
-
sk-
|
|
242
|
+
sk-proj-[A-Za-z0-9_-]{20,} # OpenAI project-scoped
|
|
243
|
+
sk-[a-zA-Z0-9]{20,} # OpenAI classic / generic (alphanumeric-only:
|
|
244
|
+
# [-_] would swallow kebab-case identifiers)
|
|
242
245
|
ghp_[a-zA-Z0-9]{36} # GitHub personal access token
|
|
243
246
|
ghu_[a-zA-Z0-9]{36} # GitHub user token
|
|
244
247
|
github_pat_[a-zA-Z0-9_]{80,} # GitHub fine-grained PAT
|
package/README.md
CHANGED
|
@@ -514,7 +514,7 @@ ctxlint is the reference implementation of four open specifications for linting
|
|
|
514
514
|
| Spec | What it covers |
|
|
515
515
|
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
516
516
|
| **[AI Context File Linting Spec](./CONTEXT_LINT_SPEC.md)** | 39 rules for validating context files (CLAUDE.md, .cursorrules, AGENTS.md, etc.) across 16 clients. Covers file formats, frontmatter schemas, path/command validation, staleness, token budgets, redundancy, and contradictions. |
|
|
517
|
-
| **[MCP Config Linting Spec](./MCP_CONFIG_LINT_SPEC.md)** |
|
|
517
|
+
| **[MCP Config Linting Spec](./MCP_CONFIG_LINT_SPEC.md)** | 29 rules for validating MCP server configs (.mcp.json, .cursor/mcp.json, .vscode/mcp.json, etc.) across 8 clients. Covers schema validation, hardcoded secrets, env var syntax, deprecated transports, and cross-file consistency. |
|
|
518
518
|
| **[Agent Session Linting Spec](./AGENT_SESSION_LINT_SPEC.md)** | 8 rules for auditing agent session data (history, memory) across 8 agents. Covers cross-project secret consistency, config drift, stale memory, and loop detection. |
|
|
519
519
|
| **[Agent Skill Linting Spec](./AGENT_SKILL_LINT_SPEC.md)** | 5 rules for auditing Claude Code skill (`SKILL.md`) and agent (`.md`) definitions under `~/.claude`. Covers frontmatter presence, broken refs, trigger-phrase collisions, orphaned skills, and dead tool restrictions. (v1, experimental) |
|
|
520
520
|
|