@aiready/mcp-server 0.2.10 → 0.4.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/.turbo/turbo-build.log +17 -16
- package/.turbo/turbo-format-check.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +20 -22
- package/.turbo/turbo-type-check.log +1 -1
- package/README.md +1 -1
- package/dist/index.js +24 -6
- package/package.json +11 -11
- package/src/__tests__/server.test.ts +21 -1
- package/src/index.ts +27 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
DTS
|
|
16
|
-
DTS
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @aiready/mcp-server@0.3.0 build /Users/pengcao/projects/aiready/packages/mcp-server
|
|
4
|
+
> tsup src/index.ts --format esm --clean --dts
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.1
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/pengcao/projects/aiready/packages/mcp-server/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: node20
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m8.93 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 42ms
|
|
15
|
+
DTS Build start
|
|
16
|
+
DTS ⚡️ Build success in 4156ms
|
|
17
|
+
DTS dist/index.d.ts 482.00 B
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/mcp-server@0.
|
|
3
|
+
> @aiready/mcp-server@0.3.0 format-check /Users/pengcao/projects/aiready/packages/mcp-server
|
|
4
4
|
> prettier --check . --ignore-path ../../.prettierignore
|
|
5
5
|
|
|
6
6
|
Checking formatting...
|
package/.turbo/turbo-lint.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[MCP]
|
|
11
|
-
[MCP]
|
|
12
|
-
[MCP]
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[2m
|
|
18
|
-
[2m
|
|
19
|
-
[2m
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[?25h
|
|
1
|
+
|
|
2
|
+
> @aiready/mcp-server@0.2.10 test /Users/pengcao/projects/aiready/packages/mcp-server
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/mcp-server[39m
|
|
7
|
+
|
|
8
|
+
AIReady MCP Server started
|
|
9
|
+
[MCP] Dynamically loading @aiready/pattern-detect for tool pattern-detect
|
|
10
|
+
[MCP] Executing pattern-detect on /Users/pengcao/projects/aiready/packages/core
|
|
11
|
+
[MCP] Dynamically loading @aiready/non-existent-tool for tool non-existent-tool
|
|
12
|
+
[MCP] Failed to load tool package @aiready/non-existent-tool: Cannot find package '@aiready/non-existent-tool' imported from /Users/pengcao/projects/aiready/packages/mcp-server/dist/index.js
|
|
13
|
+
[32m✓[39m src/__tests__/server.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 1147[2mms[22m[39m
|
|
14
|
+
[33m[2m✓[22m[39m should execute pattern-detect and return results [33m 783[2mms[22m[39m
|
|
15
|
+
|
|
16
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
17
|
+
[2m Tests [22m [1m[32m5 passed[39m[22m[90m (5)[39m
|
|
18
|
+
[2m Start at [22m 14:45:23
|
|
19
|
+
[2m Duration [22m 1.44s[2m (transform 45ms, setup 0ms, import 89ms, tests 1.15s, environment 0ms)[22m
|
|
20
|
+
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ To use the AIReady MCP server in the Claude Desktop app, add the following confi
|
|
|
48
48
|
If you prefer running MCP servers in isolated environments, you can use our Docker image:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
docker run -i --rm ghcr.io/
|
|
51
|
+
docker run -i --rm ghcr.io/getaiready/aiready-mcp-server
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
_(Note: Docker image distribution is currently being set up. Use the command above once published.)_
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
import { ToolRegistry, ToolName } from "@aiready/core";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
var AnalysisArgsSchema = z.object({
|
|
13
|
-
path: z.string().describe("Path to the directory to analyze")
|
|
13
|
+
path: z.string().describe("Path to the directory to analyze"),
|
|
14
|
+
summary_only: z.boolean().optional().describe(
|
|
15
|
+
"If true, returns only the summary and skips the detailed issue list. Best for large projects to save context."
|
|
16
|
+
)
|
|
14
17
|
});
|
|
15
18
|
var RemediationArgsSchema = z.object({
|
|
16
19
|
issue_id: z.string().describe("The unique ID of the issue to fix"),
|
|
@@ -137,6 +140,10 @@ ${data.rationale}`
|
|
|
137
140
|
path: {
|
|
138
141
|
type: "string",
|
|
139
142
|
description: "Path to the directory to analyze"
|
|
143
|
+
},
|
|
144
|
+
summary_only: {
|
|
145
|
+
type: "boolean",
|
|
146
|
+
description: "If true, returns only the summary and skips the detailed issue list. Best for large projects to save context."
|
|
140
147
|
}
|
|
141
148
|
},
|
|
142
149
|
required: ["path"]
|
|
@@ -173,15 +180,19 @@ ${data.rationale}`
|
|
|
173
180
|
if (name === "get_remediation_diff") {
|
|
174
181
|
const parsedArgs2 = RemediationArgsSchema.safeParse(args);
|
|
175
182
|
if (!parsedArgs2.success) {
|
|
176
|
-
throw new Error(
|
|
183
|
+
throw new Error(
|
|
184
|
+
`Invalid arguments for ${name}: ${parsedArgs2.error.message}`
|
|
185
|
+
);
|
|
177
186
|
}
|
|
178
187
|
return await this.handleRemediation(parsedArgs2.data);
|
|
179
188
|
}
|
|
180
189
|
const parsedArgs = AnalysisArgsSchema.safeParse(args);
|
|
181
190
|
if (!parsedArgs.success) {
|
|
182
|
-
throw new Error(
|
|
191
|
+
throw new Error(
|
|
192
|
+
`Invalid arguments for ${name}: ${parsedArgs.error.message}`
|
|
193
|
+
);
|
|
183
194
|
}
|
|
184
|
-
const { path: rootDir } = parsedArgs.data;
|
|
195
|
+
const { path: rootDir, summary_only } = parsedArgs.data;
|
|
185
196
|
let provider = ToolRegistry.find(name);
|
|
186
197
|
if (!provider) {
|
|
187
198
|
const packageName = TOOL_PACKAGE_MAP[name] ?? (name.startsWith("@aiready/") ? name : `@aiready/${name}`);
|
|
@@ -206,15 +217,22 @@ ${data.rationale}`
|
|
|
206
217
|
if (!provider) {
|
|
207
218
|
throw new Error(`Tool ${name} not found after attempting to load`);
|
|
208
219
|
}
|
|
209
|
-
console.error(
|
|
220
|
+
console.error(
|
|
221
|
+
`[MCP] Executing ${name} on ${rootDir}${summary_only ? " (summary only)" : ""}`
|
|
222
|
+
);
|
|
210
223
|
const results = await provider.analyze({
|
|
211
224
|
rootDir
|
|
212
225
|
});
|
|
226
|
+
const responseData = summary_only ? {
|
|
227
|
+
summary: results.summary,
|
|
228
|
+
metadata: results.metadata,
|
|
229
|
+
notice: "Detailed issues were omitted (summary_only: true). Run without summary_only for full details."
|
|
230
|
+
} : results;
|
|
213
231
|
return {
|
|
214
232
|
content: [
|
|
215
233
|
{
|
|
216
234
|
type: "text",
|
|
217
|
-
text: JSON.stringify(
|
|
235
|
+
text: JSON.stringify(responseData, null, 2)
|
|
218
236
|
}
|
|
219
237
|
]
|
|
220
238
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The AIReady Model Context Protocol (MCP) Server for Agentic Readiness. Optimize codebases for AI agents like Cursor, Windsurf, and Claude directly via MCP.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
14
14
|
"chalk": "^5.3.0",
|
|
15
15
|
"zod": "^4.3.6",
|
|
16
|
-
"@aiready/agent-grounding": "0.14.
|
|
17
|
-
"@aiready/ai-signal-clarity": "0.14.
|
|
18
|
-
"@aiready/
|
|
19
|
-
"@aiready/context-analyzer": "0.22.
|
|
20
|
-
"@aiready/
|
|
21
|
-
"@aiready/
|
|
22
|
-
"@aiready/
|
|
23
|
-
"@aiready/doc-drift": "0.14.
|
|
24
|
-
"@aiready/
|
|
25
|
-
"@aiready/
|
|
16
|
+
"@aiready/agent-grounding": "0.14.15",
|
|
17
|
+
"@aiready/ai-signal-clarity": "0.14.17",
|
|
18
|
+
"@aiready/change-amplification": "0.14.15",
|
|
19
|
+
"@aiready/context-analyzer": "0.22.15",
|
|
20
|
+
"@aiready/consistency": "0.21.15",
|
|
21
|
+
"@aiready/core": "0.24.16",
|
|
22
|
+
"@aiready/deps": "0.14.15",
|
|
23
|
+
"@aiready/doc-drift": "0.14.15",
|
|
24
|
+
"@aiready/testability": "0.7.16",
|
|
25
|
+
"@aiready/pattern-detect": "0.17.15"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^24.0.0",
|
|
@@ -47,7 +47,7 @@ describe('AIReady MCP Server Integration', () => {
|
|
|
47
47
|
expect(toolNames).toContain('naming-consistency');
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
it('should expose correct input schema for tools', async () => {
|
|
50
|
+
it('should expose correct input schema for tools including summary_only', async () => {
|
|
51
51
|
const result = await client.listTools();
|
|
52
52
|
|
|
53
53
|
const patternDetect = result.tools.find((t) => t.name === 'pattern-detect');
|
|
@@ -55,11 +55,31 @@ describe('AIReady MCP Server Integration', () => {
|
|
|
55
55
|
type: 'object',
|
|
56
56
|
properties: {
|
|
57
57
|
path: { type: 'string' },
|
|
58
|
+
summary_only: { type: 'boolean' },
|
|
58
59
|
},
|
|
59
60
|
required: ['path'],
|
|
60
61
|
});
|
|
61
62
|
});
|
|
62
63
|
|
|
64
|
+
it('should execute pattern-detect with summary_only: true and return only summary', async () => {
|
|
65
|
+
const result = await client.callTool({
|
|
66
|
+
name: 'pattern-detect',
|
|
67
|
+
arguments: {
|
|
68
|
+
path: path.resolve(__dirname, '../../../core'),
|
|
69
|
+
summary_only: true,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
const typedResult = result as ToolCallResponse;
|
|
73
|
+
|
|
74
|
+
expect(typedResult.content).toBeDefined();
|
|
75
|
+
const data = JSON.parse((typedResult.content[0] as any).text);
|
|
76
|
+
|
|
77
|
+
expect(data).toHaveProperty('summary');
|
|
78
|
+
expect(data).toHaveProperty('metadata');
|
|
79
|
+
expect(data).toHaveProperty('notice');
|
|
80
|
+
expect(data).not.toHaveProperty('results');
|
|
81
|
+
}, 20000);
|
|
82
|
+
|
|
63
83
|
it('should execute pattern-detect and return results', async () => {
|
|
64
84
|
const result = await client.callTool({
|
|
65
85
|
name: 'pattern-detect',
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,12 @@ import { z } from 'zod';
|
|
|
12
12
|
*/
|
|
13
13
|
const AnalysisArgsSchema = z.object({
|
|
14
14
|
path: z.string().describe('Path to the directory to analyze'),
|
|
15
|
+
summary_only: z
|
|
16
|
+
.boolean()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(
|
|
19
|
+
'If true, returns only the summary and skips the detailed issue list. Best for large projects to save context.'
|
|
20
|
+
),
|
|
15
21
|
});
|
|
16
22
|
|
|
17
23
|
const RemediationArgsSchema = z.object({
|
|
@@ -162,6 +168,11 @@ export class AIReadyMcpServer {
|
|
|
162
168
|
type: 'string',
|
|
163
169
|
description: 'Path to the directory to analyze',
|
|
164
170
|
},
|
|
171
|
+
summary_only: {
|
|
172
|
+
type: 'boolean',
|
|
173
|
+
description:
|
|
174
|
+
'If true, returns only the summary and skips the detailed issue list. Best for large projects to save context.',
|
|
175
|
+
},
|
|
165
176
|
},
|
|
166
177
|
required: ['path'],
|
|
167
178
|
},
|
|
@@ -215,7 +226,7 @@ export class AIReadyMcpServer {
|
|
|
215
226
|
`Invalid arguments for ${name}: ${parsedArgs.error.message}`
|
|
216
227
|
);
|
|
217
228
|
}
|
|
218
|
-
const { path: rootDir } = parsedArgs.data;
|
|
229
|
+
const { path: rootDir, summary_only } = parsedArgs.data;
|
|
219
230
|
|
|
220
231
|
let provider = ToolRegistry.find(name);
|
|
221
232
|
|
|
@@ -251,18 +262,31 @@ export class AIReadyMcpServer {
|
|
|
251
262
|
throw new Error(`Tool ${name} not found after attempting to load`);
|
|
252
263
|
}
|
|
253
264
|
|
|
254
|
-
console.error(
|
|
265
|
+
console.error(
|
|
266
|
+
`[MCP] Executing ${name} on ${rootDir}${
|
|
267
|
+
summary_only ? ' (summary only)' : ''
|
|
268
|
+
}`
|
|
269
|
+
);
|
|
255
270
|
|
|
256
271
|
const results = await provider.analyze({
|
|
257
272
|
rootDir,
|
|
258
273
|
});
|
|
259
274
|
|
|
260
275
|
// Format results for the agent
|
|
276
|
+
const responseData = summary_only
|
|
277
|
+
? {
|
|
278
|
+
summary: results.summary,
|
|
279
|
+
metadata: results.metadata,
|
|
280
|
+
notice:
|
|
281
|
+
'Detailed issues were omitted (summary_only: true). Run without summary_only for full details.',
|
|
282
|
+
}
|
|
283
|
+
: results;
|
|
284
|
+
|
|
261
285
|
return {
|
|
262
286
|
content: [
|
|
263
287
|
{
|
|
264
288
|
type: 'text',
|
|
265
|
-
text: JSON.stringify(
|
|
289
|
+
text: JSON.stringify(responseData, null, 2),
|
|
266
290
|
},
|
|
267
291
|
],
|
|
268
292
|
};
|