@agent-lint/mcp 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Agent Lint Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # @agent-lint/mcp
2
+
3
+ MCP server for AI agent context artifact analysis and quality scoring.
4
+
5
+ **Zero LLM dependencies.** Fully deterministic. Local-first. No database. No auth.
6
+
7
+ ## What It Does
8
+
9
+ Provides a [Model Context Protocol](https://modelcontextprotocol.io/) server that evaluates AI-agent context artifacts:
10
+
11
+ - `AGENTS.md` / `CLAUDE.md`
12
+ - Skills, Rules, Workflows, Plans
13
+
14
+ Reproducible quality scoring across **12 metrics**, evidence-backed assessment, guardrail checks, and repeatable improvement loops — all without calling any LLM.
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ npx -y @agent-lint/mcp
20
+ ```
21
+
22
+ ## MCP Client Configuration
23
+
24
+ ### Cursor
25
+
26
+ Add to `.cursor/mcp.json`:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "agent-lint": {
32
+ "command": "npx",
33
+ "args": ["-y", "@agent-lint/mcp"]
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ### Claude Desktop
40
+
41
+ Add to `claude_desktop_config.json`:
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "agent-lint": {
47
+ "command": "npx",
48
+ "args": ["-y", "@agent-lint/mcp"]
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ### VS Code
55
+
56
+ Add to your VS Code `settings.json`:
57
+
58
+ ```json
59
+ {
60
+ "mcp": {
61
+ "servers": {
62
+ "agent-lint": {
63
+ "command": "npx",
64
+ "args": ["-y", "@agent-lint/mcp"]
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### Windsurf
72
+
73
+ Add to your Windsurf MCP config:
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "agent-lint": {
79
+ "command": "npx",
80
+ "args": ["-y", "@agent-lint/mcp"]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## Available Tools
87
+
88
+ | Tool | Description |
89
+ | ------------------------------ | ------------------------------------------------------------------------------------ |
90
+ | `analyze_artifact` | Analyze a single artifact — returns scores across 12 metrics with findings and hints |
91
+ | `analyze_workspace_artifacts` | Scan a workspace directory for AI agent artifacts with framework detection |
92
+ | `analyze_context_bundle` | Analyze multiple artifacts together for cross-artifact consistency |
93
+ | `prepare_artifact_fix_context` | Prepare context for an artifact improvement loop |
94
+ | `submit_client_assessment` | Submit a client LLM assessment with evidence-backed scores |
95
+ | `quality_gate_artifact` | Check if an artifact meets a target quality score |
96
+ | `suggest_patch` | Generate patch suggestions to improve an artifact |
97
+ | `apply_patches` | Apply patches to local files with hash guard, allowlist, and backup protection |
98
+ | `validate_export` | Validate final artifact output for safety and correctness |
99
+
100
+ ## Quality Metrics (12)
101
+
102
+ `clarity` · `specificity` · `scope-control` · `completeness` · `actionability` · `verifiability` · `safety` · `injection-resistance` · `secret-hygiene` · `token-efficiency` · `platform-fit` · `maintainability`
103
+
104
+ ## Programmatic Usage
105
+
106
+ ```typescript
107
+ import { createAgentLintMcpServer } from "@agent-lint/mcp";
108
+
109
+ const server = createAgentLintMcpServer({
110
+ transportMode: "stdio",
111
+ });
112
+ ```
113
+
114
+ ## HTTP Transport
115
+
116
+ ```bash
117
+ npx @agent-lint/mcp --http --port 3001
118
+ ```
119
+
120
+ ## Design Principles
121
+
122
+ - **No LLM**: Fully deterministic. No API calls, no tokens, no cost.
123
+ - **No State**: Every call is stateless. No database, no cache.
124
+ - **No File Writes**: Read-only by default. `apply_patches` requires explicit flags + hash guard.
125
+ - **Minimum Dependencies**: Published package under 500 KB packed.
126
+
127
+ ## Related
128
+
129
+ - [`@agent-lint/cli`](https://www.npmjs.com/package/@agent-lint/cli) — CLI interface
130
+ - [Repository](https://gitlab.com/bsamilozturk/agentlint)
131
+
132
+ ## License
133
+
134
+ MIT
package/dist/bin.js ADDED
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ logMcp,
4
+ runHttpServer,
5
+ runStdioServer
6
+ } from "./chunk-FHXMDRDX.js";
7
+
8
+ // src/bin.ts
9
+ var nodeVersion = parseInt(process.versions.node.split(".")[0], 10);
10
+ if (nodeVersion < 18) {
11
+ process.stderr.write(
12
+ `agent-lint requires Node.js >= 18. Current: ${process.versions.node}
13
+ `
14
+ );
15
+ process.exit(1);
16
+ }
17
+ var args = process.argv.slice(2);
18
+ function hasFlag(name) {
19
+ return args.includes(`--${name}`);
20
+ }
21
+ function getFlagValue(name) {
22
+ const idx = args.indexOf(`--${name}`);
23
+ if (idx >= 0 && idx + 1 < args.length) {
24
+ return args[idx + 1];
25
+ }
26
+ return void 0;
27
+ }
28
+ if (hasFlag("help") || hasFlag("h")) {
29
+ process.stderr.write([
30
+ "Usage: agent-lint-mcp [options]",
31
+ "",
32
+ "Options:",
33
+ " --http Start HTTP transport (StreamableHTTP) instead of stdio",
34
+ " --port <n> HTTP port (default: 3001, or MCP_HTTP_PORT env var)",
35
+ " --host <addr> HTTP bind address (default: 127.0.0.1)",
36
+ " --help, -h Show this help message",
37
+ ""
38
+ ].join("\n"));
39
+ process.exit(0);
40
+ }
41
+ if (hasFlag("http")) {
42
+ const port = getFlagValue("port") ? parseInt(getFlagValue("port"), 10) : void 0;
43
+ const hostname = getFlagValue("host") ?? void 0;
44
+ runHttpServer({ port, hostname }).catch((error) => {
45
+ logMcp("error", "mcp.http.fatal", {
46
+ error: error instanceof Error ? error.message : "Unknown error"
47
+ });
48
+ process.exit(1);
49
+ });
50
+ } else {
51
+ runStdioServer().catch((error) => {
52
+ logMcp("error", "mcp.stdio.fatal", {
53
+ error: error instanceof Error ? error.message : "Unknown error"
54
+ });
55
+ process.exit(1);
56
+ });
57
+ }
58
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nconst nodeVersion = parseInt(process.versions.node.split(\".\")[0], 10);\nif (nodeVersion < 18) {\n process.stderr.write(\n `agent-lint requires Node.js >= 18. Current: ${process.versions.node}\\n`\n );\n process.exit(1);\n}\n\nimport { runStdioServer } from \"./stdio.js\";\nimport { runHttpServer } from \"./http.js\";\nimport { logMcp } from \"./logger.js\";\n\n// ---------------------------------------------------------------------------\n// CLI argument parsing (no new deps — simple process.argv)\n// ---------------------------------------------------------------------------\n\nconst args = process.argv.slice(2);\n\nfunction hasFlag(name: string): boolean {\n return args.includes(`--${name}`);\n}\n\nfunction getFlagValue(name: string): string | undefined {\n const idx = args.indexOf(`--${name}`);\n if (idx >= 0 && idx + 1 < args.length) {\n return args[idx + 1];\n }\n return undefined;\n}\n\nif (hasFlag(\"help\") || hasFlag(\"h\")) {\n process.stderr.write([\n \"Usage: agent-lint-mcp [options]\",\n \"\",\n \"Options:\",\n \" --http Start HTTP transport (StreamableHTTP) instead of stdio\",\n \" --port <n> HTTP port (default: 3001, or MCP_HTTP_PORT env var)\",\n \" --host <addr> HTTP bind address (default: 127.0.0.1)\",\n \" --help, -h Show this help message\",\n \"\",\n ].join(\"\\n\"));\n process.exit(0);\n}\n\n// ---------------------------------------------------------------------------\n// Transport selection\n// ---------------------------------------------------------------------------\n\nif (hasFlag(\"http\")) {\n const port = getFlagValue(\"port\") ? parseInt(getFlagValue(\"port\")!, 10) : undefined;\n const hostname = getFlagValue(\"host\") ?? undefined;\n\n runHttpServer({ port, hostname }).catch((error) => {\n logMcp(\"error\", \"mcp.http.fatal\", {\n error: error instanceof Error ? error.message : \"Unknown error\",\n });\n process.exit(1);\n });\n} else {\n runStdioServer().catch((error) => {\n logMcp(\"error\", \"mcp.stdio.fatal\", {\n error: error instanceof Error ? error.message : \"Unknown error\",\n });\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;;AACA,IAAM,cAAc,SAAS,QAAQ,SAAS,KAAK,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE;AACpE,IAAI,cAAc,IAAI;AACpB,UAAQ,OAAO;AAAA,IACb,+CAA+C,QAAQ,SAAS,IAAI;AAAA;AAAA,EACtE;AACA,UAAQ,KAAK,CAAC;AAChB;AAUA,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,SAAS,QAAQ,MAAuB;AACtC,SAAO,KAAK,SAAS,KAAK,IAAI,EAAE;AAClC;AAEA,SAAS,aAAa,MAAkC;AACtD,QAAM,MAAM,KAAK,QAAQ,KAAK,IAAI,EAAE;AACpC,MAAI,OAAO,KAAK,MAAM,IAAI,KAAK,QAAQ;AACrC,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AACA,SAAO;AACT;AAEA,IAAI,QAAQ,MAAM,KAAK,QAAQ,GAAG,GAAG;AACnC,UAAQ,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