@specproof/mcp-server 0.0.0-stage → 0.2.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/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -4
- package/README.md +0 -3
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,cAAc,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7B,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a configured SpecProof MCP server exposing deterministic test-integrity,
|
|
4
|
+
* diff-scoped mutation, and spec-coverage verification tools.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createSpecProofMcpServer(): McpServer;
|
|
7
|
+
export declare function startMcpServer(): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,SAAS,CAqIpD;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAIpD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { formatMarkdownReport } from '@specproof/core';
|
|
4
|
+
import { verifyRepositoryAsync } from '@specproof/mutator';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a configured SpecProof MCP server exposing deterministic test-integrity,
|
|
8
|
+
* diff-scoped mutation, and spec-coverage verification tools.
|
|
9
|
+
*/
|
|
10
|
+
export function createSpecProofMcpServer() {
|
|
11
|
+
const server = new McpServer({
|
|
12
|
+
name: 'specproof',
|
|
13
|
+
version: '0.2.0',
|
|
14
|
+
});
|
|
15
|
+
server.registerTool('check_test_integrity', {
|
|
16
|
+
description: 'Scan changed files (or all repository files) for AI test anti-patterns: vacuous assertions, empty tests, skipped tests, mock abuse, and swallowed errors.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
repoRoot: z.string().describe('Absolute path to the repository root.'),
|
|
19
|
+
baseRef: z.string().optional().describe('Optional git base ref (e.g. main) for diff scoping.'),
|
|
20
|
+
allFiles: z.boolean().optional().describe('Scan all files instead of only the git diff.'),
|
|
21
|
+
},
|
|
22
|
+
}, async ({ repoRoot, baseRef, allFiles }) => {
|
|
23
|
+
const report = await verifyRepositoryAsync({
|
|
24
|
+
repoRoot,
|
|
25
|
+
baseRef,
|
|
26
|
+
allFiles,
|
|
27
|
+
mutate: false,
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: JSON.stringify({
|
|
34
|
+
passed: report.passed,
|
|
35
|
+
failureReasons: report.failureReasons,
|
|
36
|
+
integrity: report.integrity,
|
|
37
|
+
summaryMarkdown: formatMarkdownReport(report),
|
|
38
|
+
}, null, 2),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
server.registerTool('run_diff_mutation', {
|
|
44
|
+
description: 'Run fast diff-scoped micro-mutation testing in an isolated sandbox to prove tests actually catch broken logic on changed lines.',
|
|
45
|
+
inputSchema: {
|
|
46
|
+
repoRoot: z.string().describe('Absolute path to the repository root.'),
|
|
47
|
+
baseRef: z.string().optional().describe('Optional git base ref (e.g. main).'),
|
|
48
|
+
testCommand: z.string().optional().describe('Override test command (defaults to .specproof.json or npm test).'),
|
|
49
|
+
failUnderScore: z.number().min(0).max(100).optional().describe('Minimum diff mutation score (0-100).'),
|
|
50
|
+
allFiles: z.boolean().optional().describe('Mutate all supported source files up to maxMutantsPerRun.'),
|
|
51
|
+
},
|
|
52
|
+
}, async ({ repoRoot, baseRef, testCommand, failUnderScore, allFiles }) => {
|
|
53
|
+
const report = await verifyRepositoryAsync({
|
|
54
|
+
repoRoot,
|
|
55
|
+
baseRef,
|
|
56
|
+
testCommand,
|
|
57
|
+
failUnderMutationScore: failUnderScore,
|
|
58
|
+
allFiles,
|
|
59
|
+
mutate: true,
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
content: [
|
|
63
|
+
{
|
|
64
|
+
type: 'text',
|
|
65
|
+
text: JSON.stringify({
|
|
66
|
+
passed: report.passed,
|
|
67
|
+
failureReasons: report.failureReasons,
|
|
68
|
+
mutation: report.mutation,
|
|
69
|
+
summaryMarkdown: formatMarkdownReport(report),
|
|
70
|
+
}, null, 2),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
server.registerTool('verify_spec_coverage', {
|
|
76
|
+
description: 'Verify whether the current git diff and test changes cover acceptance criteria from SPEC.md or inline markdown requirements, optionally using BYOK LLM evaluation.',
|
|
77
|
+
inputSchema: {
|
|
78
|
+
repoRoot: z.string().describe('Absolute path to the repository root.'),
|
|
79
|
+
specPath: z.string().optional().describe('Relative path to a markdown spec file (e.g. SPEC.md).'),
|
|
80
|
+
specMarkdown: z.string().optional().describe('Inline markdown checklist of requirements.'),
|
|
81
|
+
baseRef: z.string().optional().describe('Optional git base ref.'),
|
|
82
|
+
useLlm: z.boolean().optional().describe('Use BYOK LLM (OpenAI/Anthropic/Gemini env key) for semantic verification.'),
|
|
83
|
+
provider: z.enum(['openai', 'anthropic', 'gemini']).optional().describe('Optional explicit BYOK LLM provider.'),
|
|
84
|
+
},
|
|
85
|
+
}, async ({ repoRoot, specPath, specMarkdown, baseRef, useLlm, provider }) => {
|
|
86
|
+
const report = await verifyRepositoryAsync({
|
|
87
|
+
repoRoot,
|
|
88
|
+
specPath,
|
|
89
|
+
specMarkdown,
|
|
90
|
+
baseRef,
|
|
91
|
+
useLlm,
|
|
92
|
+
llmProvider: provider,
|
|
93
|
+
mutate: false,
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
type: 'text',
|
|
99
|
+
text: JSON.stringify({
|
|
100
|
+
passed: report.passed,
|
|
101
|
+
specCoverage: report.specCoverage,
|
|
102
|
+
summaryMarkdown: formatMarkdownReport(report),
|
|
103
|
+
}, null, 2),
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
return server;
|
|
109
|
+
}
|
|
110
|
+
export async function startMcpServer() {
|
|
111
|
+
const server = createSpecProofMcpServer();
|
|
112
|
+
const transport = new StdioServerTransport();
|
|
113
|
+
await server.connect(transport);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":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C,eAAe,EAAE,oBAAoB,CAAC,MAAM,CAAC;qBAC9C,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,MAAM,GAAG,wBAAwB,EAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@specproof/mcp-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Model Context Protocol (MCP) verification server for Cursor, Claude Code, Antigravity, and coding agents.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://github.com/Claw2M/specproof#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Claw2M/specproof.git",
|
|
10
|
+
"directory": "packages/mcp-server"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Claw2M/specproof/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"bin": {
|
|
19
|
+
"specproof-mcp": "./dist/bin.js"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": ["dist"],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22.13.0"
|
|
33
|
+
},
|
|
34
|
+
"keywords": ["specproof", "mcp", "model-context-protocol", "cursor", "claude-code"],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
41
|
+
"@specproof/core": "0.2.0",
|
|
42
|
+
"@specproof/mutator": "0.2.0",
|
|
43
|
+
"zod": "^4.0.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/README.md
DELETED