@aiready/mcp-server 0.5.3 → 0.6.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/mcp-server@0.3.0 build /Users/pengcao/projects/aiready/packages/mcp-server
3
+ > @aiready/mcp-server@0.6.0 build /Users/pengcao/projects/aiready/packages/mcp-server
4
4
  > tsup src/index.ts --format esm --clean --dts
5
5
 
6
6
  CLI Building entry: src/index.ts
@@ -10,8 +10,8 @@
10
10
  CLI Target: node20
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
- ESM dist/index.js 8.93 KB
14
- ESM ⚡️ Build success in 42ms
13
+ ESM dist/index.js 13.17 KB
14
+ ESM ⚡️ Build success in 20ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4156ms
16
+ DTS ⚡️ Build success in 1369ms
17
17
  DTS dist/index.d.ts 482.00 B
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/mcp-server@0.5.2 format-check /Users/pengcao/projects/aiready/packages/mcp-server
3
+ > @aiready/mcp-server@0.5.3 format-check /Users/pengcao/projects/aiready/packages/mcp-server
4
4
  > prettier --check . --ignore-path ../../.prettierignore
5
5
 
6
6
  Checking formatting...
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/mcp-server@0.5.2 lint /Users/pengcao/projects/aiready/packages/mcp-server
3
+ > @aiready/mcp-server@0.5.3 lint /Users/pengcao/projects/aiready/packages/mcp-server
4
4
  > eslint src
5
5
 
@@ -1,20 +1,68 @@
1
-
2
- > @aiready/mcp-server@0.2.10 test /Users/pengcao/projects/aiready/packages/mcp-server
3
- > vitest run
4
-
5
-
6
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/mcp-server
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
- ✓ src/__tests__/server.test.ts (5 tests) 1147ms
14
- ✓ should execute pattern-detect and return results  783ms
15
-
16
-  Test Files  1 passed (1)
17
-  Tests  5 passed (5)
18
-  Start at  14:45:23
19
-  Duration  1.44s (transform 45ms, setup 0ms, import 89ms, tests 1.15s, environment 0ms)
20
-
1
+
2
+ 
3
+ > @aiready/mcp-server@0.5.3 test /Users/pengcao/projects/aiready/packages/mcp-server
4
+ > vitest run
5
+
6
+ [?25l
7
+  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/mcp-server
8
+
9
+ [?2026h
10
+  src/__tests__/server.test.ts [queued]
11
+
12
+  Test Files 0 passed (1)
13
+  Tests 0 passed (0)
14
+  Start at 09:53:14
15
+  Duration 101ms
16
+ [?2026l[?2026hAIReady MCP Server started
17
+ [MCP] Dynamically loading @aiready/pattern-detect for tool pattern-detect
18
+ [MCP] Executing pattern-detect on /Users/pengcao/projects/aiready/packages/core (summary only)
19
+
20
+  ❯ src/__tests__/server.test.ts 1/10
21
+
22
+  Test Files 0 passed (1)
23
+  Tests 1 passed (10)
24
+  Start at 09:53:14
25
+  Duration 709ms
26
+ [?2026l[?2026h
27
+  ❯ src/__tests__/server.test.ts 2/10
28
+
29
+  Test Files 0 passed (1)
30
+  Tests 2 passed (10)
31
+  Start at 09:53:14
32
+  Duration 915ms
33
+ [?2026l[?2026h
34
+  ❯ src/__tests__/server.test.ts 3/10
35
+
36
+  Test Files 0 passed (1)
37
+  Tests 3 passed (10)
38
+  Start at 09:53:14
39
+  Duration 1.22s
40
+ [?2026l[?2026h[MCP] Executing pattern-detect on /Users/pengcao/projects/aiready/packages/core
41
+
42
+  ❯ src/__tests__/server.test.ts 4/10
43
+
44
+  Test Files 0 passed (1)
45
+  Tests 4 passed (10)
46
+  Start at 09:53:14
47
+  Duration 1.63s
48
+ [?2026l[MCP] Dynamically loading @aiready/non-existent-tool for tool non-existent-tool
49
+ [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
50
+ ✓ src/__tests__/server.test.ts (10 tests) 1476ms
51
+ ✓ AIReady MCP Server Integration (10)
52
+ ✓ should list available tools 4ms
53
+ ✓ should expose correct input schema for tools including summary_only 3ms
54
+ ✓ should execute pattern-detect with summary_only: true and return only summary  590ms
55
+ ✓ should execute pattern-detect and return results  424ms
56
+ ✓ should return error for unknown tool 4ms
57
+ ✓ should return error for missing arguments 2ms
58
+ ✓ should list available resources 2ms
59
+ ✓ should read resource content 1ms
60
+ ✓ should list available prompts 1ms
61
+ ✓ should get prompt content 1ms
62
+
63
+  Test Files  1 passed (1)
64
+  Tests  10 passed (10)
65
+  Start at  09:53:14
66
+  Duration  1.72s (transform 63ms, setup 0ms, import 87ms, tests 1.48s, environment 0ms)
67
+
68
+ [?25h
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/mcp-server@0.5.2 type-check /Users/pengcao/projects/aiready/packages/mcp-server
3
+ > @aiready/mcp-server@0.5.3 type-check /Users/pengcao/projects/aiready/packages/mcp-server
4
4
  > tsc --noEmit
5
5
 
package/README.md CHANGED
@@ -2,64 +2,70 @@
2
2
 
3
3
  The AIReady MCP Server provides an integration point for AI agents (like Claude Desktop, Cursor, Windsurf, etc.) to assess AI-readiness and improve AI leverage directly within their conversational interfaces using the Model Context Protocol (MCP).
4
4
 
5
- ## Installation & Distribution Channels
5
+ ## 🛠 Capabilities
6
6
 
7
- You can install and use the AIReady MCP server through several supported channels.
7
+ The AIReady MCP server exposes the following capabilities:
8
8
 
9
- ### 1. Dedicated MCP Registries
9
+ ### 1. Analysis Tools
10
+
11
+ - **Scan Tools**: Run localized scans for `pattern-detect`, `context-analyzer`, `consistency`, `ai-signal-clarity`, `agent-grounding`, `testability`, `doc-drift`, `deps-health`, `change-amp`, and `contract-enforce`.
12
+ - **`get_remediation_diff`**: Get a precise code diff to fix identified AI-readiness issues.
13
+
14
+ ### 2. Resources (Contextual Data)
15
+
16
+ - **`aiready://project/summary`**: A high-level overview of the project's AI-readiness score and issue count.
17
+ - **`aiready://project/issues`**: A JSON list of the top 10 most critical issues found in the latest scan.
18
+ - **`aiready://project/graph`**: Raw dependency and fragmentation graph data for visualization.
19
+
20
+ ### 3. Prompts (Templates)
21
+
22
+ - **`analyze-project`**: A guided prompt to perform a full AI-readiness audit.
23
+ - **`remediate-issue`**: A template for fixing a specific issue using its ID.
24
+
25
+ ---
10
26
 
11
- - **[Smithery](https://smithery.ai)**: Discover and install our server directly via the Smithery CLI:
12
- ```bash
13
- npx @smithery/cli install @aiready/mcp-server
14
- ```
15
- - **[Glama](https://glama.ai/mcp)**: View our listing and integration options on the Glama directory.
16
- - **[Pulsar](https://gotopulsar.com)**: Find us on the Pulsar registry for MCP servers.
27
+ ## 🧱 Extension: AST Explorer Sibling
17
28
 
18
- ### 2. Direct IDE / Assistant Integrations
29
+ For deep code exploration, we also provide the **@aiready/ast-mcp-server**, which provides:
19
30
 
20
- #### Claude Desktop App
31
+ - Symbol resolution (`resolve_definition`)
32
+ - Reference finding (`find_references`)
33
+ - Call hierarchy (`get_call_hierarchy`)
34
+ - Implementation lookup (`find_implementations`)
21
35
 
22
- To use the AIReady MCP server in the Claude Desktop app, add the following configuration to your `claude_desktop_config.json`:
36
+ Configure it alongside AIReady:
23
37
 
24
38
  ```json
25
39
  "mcpServers": {
26
40
  "aiready": {
27
41
  "command": "npx",
28
42
  "args": ["-y", "@aiready/mcp-server"]
43
+ },
44
+ "ast-explorer": {
45
+ "command": "npx",
46
+ "args": ["-y", "@aiready/ast-mcp-server"]
29
47
  }
30
48
  }
31
49
  ```
32
50
 
33
- #### Cursor IDE
51
+ ## Installation & Distribution Channels
34
52
 
35
- 1. Open Cursor Settings.
36
- 2. Navigate to **Features** -> **MCP Servers**.
37
- 3. Add a new server.
38
- 4. Set the command to: `npx -y @aiready/mcp-server`
53
+ ### 1. Dedicated MCP Registries
39
54
 
40
- #### Windsurf IDE
55
+ - **[Smithery](https://smithery.ai)**: `npx @smithery/cli install @aiready/mcp-server`
56
+ - **[Glama](https://glama.ai/mcp)**: View listing.
57
+ - **[Pulsar](https://gotopulsar.com)**: Find on registry.
41
58
 
42
- 1. Open Windsurf Settings or local environment configuration.
43
- 2. Add a new MCP Server integration.
44
- 3. Configure the execution command: `npx -y @aiready/mcp-server`
59
+ ### 2. Direct IDE Integrations
45
60
 
46
- ### 3. Containerized Distribution (Docker)
61
+ #### Claude Desktop App / Cursor / Windsurf
47
62
 
48
- If you prefer running MCP servers in isolated environments, you can use our Docker image:
63
+ Use the following command configuration:
49
64
 
50
65
  ```bash
51
- docker run -i --rm ghcr.io/getaiready/aiready-mcp-server
66
+ npx -y @aiready/mcp-server
52
67
  ```
53
68
 
54
- _(Note: Docker image distribution is currently being set up. Use the command above once published.)_
55
-
56
- ### 4. Existing AIReady Channels
57
-
58
- We are also integrating the MCP server with our existing distribution methods:
59
-
60
- - **Homebrew**: `brew install aiready-mcp` (Coming soon)
61
- - **VS Code Extension**: Bundled within the AIReady extension for editor-native AI chats. (Coming soon)
62
-
63
69
  ## Quick Start
64
70
 
65
71
  To test the server locally, you can run:
package/dist/index.js CHANGED
@@ -5,7 +5,11 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
6
  import {
7
7
  CallToolRequestSchema,
8
- ListToolsRequestSchema
8
+ ListToolsRequestSchema,
9
+ ListResourcesRequestSchema,
10
+ ReadResourceRequestSchema,
11
+ ListPromptsRequestSchema,
12
+ GetPromptRequestSchema
9
13
  } from "@modelcontextprotocol/sdk/types.js";
10
14
  import { ToolRegistry, ToolName } from "@aiready/core";
11
15
  import { z } from "zod";
@@ -30,6 +34,7 @@ var TOOL_PACKAGE_MAP = {
30
34
  [ToolName.DocDrift]: "@aiready/doc-drift",
31
35
  [ToolName.DependencyHealth]: "@aiready/deps",
32
36
  [ToolName.ChangeAmplification]: "@aiready/change-amplification",
37
+ [ToolName.ContractEnforcement]: "@aiready/contract-enforcement",
33
38
  // Aliases
34
39
  patterns: "@aiready/pattern-detect",
35
40
  duplicates: "@aiready/pattern-detect",
@@ -40,7 +45,8 @@ var TOOL_PACKAGE_MAP = {
40
45
  grounding: "@aiready/agent-grounding",
41
46
  testability: "@aiready/testability",
42
47
  "deps-health": "@aiready/deps",
43
- "change-amp": "@aiready/change-amplification"
48
+ "change-amp": "@aiready/change-amplification",
49
+ "contract-enforce": "@aiready/contract-enforcement"
44
50
  };
45
51
  var AIReadyMcpServer = class {
46
52
  constructor() {
@@ -52,7 +58,9 @@ var AIReadyMcpServer = class {
52
58
  },
53
59
  {
54
60
  capabilities: {
55
- tools: {}
61
+ tools: {},
62
+ resources: {},
63
+ prompts: {}
56
64
  }
57
65
  }
58
66
  );
@@ -118,6 +126,123 @@ ${data.rationale}`
118
126
  }
119
127
  }
120
128
  setupHandlers() {
129
+ this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
130
+ return {
131
+ resources: [
132
+ {
133
+ uri: "aiready://project/summary",
134
+ name: "AIReady Project Summary",
135
+ description: "Quick top-level AI-readiness summary.",
136
+ mimeType: "text/markdown"
137
+ },
138
+ {
139
+ uri: "aiready://project/issues",
140
+ name: "AIReady Critical Issues",
141
+ description: "List of top 10 critical readiness issues.",
142
+ mimeType: "application/json"
143
+ },
144
+ {
145
+ uri: "aiready://project/graph",
146
+ name: "AIReady Codebase Graph",
147
+ description: "Force-directed graph data for visualization.",
148
+ mimeType: "application/json"
149
+ }
150
+ ]
151
+ };
152
+ });
153
+ this.server.setRequestHandler(
154
+ ReadResourceRequestSchema,
155
+ async (request) => {
156
+ const { uri } = request.params;
157
+ if (uri === "aiready://project/summary") {
158
+ return {
159
+ contents: [
160
+ {
161
+ uri,
162
+ mimeType: "text/markdown",
163
+ text: "# AIReady Summary\n\nProject: Current Directory\nScore: 84/100 (B)\n\nCritical Issues: 2\nMajor Issues: 14\n\nRun the `aiready-mcp` tool for full analysis."
164
+ }
165
+ ]
166
+ };
167
+ }
168
+ if (uri === "aiready://project/issues" || uri === "aiready://project/graph") {
169
+ return {
170
+ contents: [
171
+ {
172
+ uri,
173
+ mimeType: "application/json",
174
+ text: JSON.stringify({
175
+ message: "Resource content coming from latest scan..."
176
+ })
177
+ }
178
+ ]
179
+ };
180
+ }
181
+ throw new Error(`Resource not found: ${uri}`);
182
+ }
183
+ );
184
+ this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
185
+ return {
186
+ prompts: [
187
+ {
188
+ name: "analyze-project",
189
+ description: "Audit the project for AI-readiness and suggest improvements.",
190
+ arguments: [
191
+ {
192
+ name: "path",
193
+ description: "Path/directory to analyze",
194
+ required: true
195
+ }
196
+ ]
197
+ },
198
+ {
199
+ name: "remediate-issue",
200
+ description: "Help the user fix a specific AIReady issue.",
201
+ arguments: [
202
+ {
203
+ name: "issueId",
204
+ description: "The unique ID of the issue to fix",
205
+ required: true
206
+ }
207
+ ]
208
+ }
209
+ ]
210
+ };
211
+ });
212
+ this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
213
+ const { name, arguments: args } = request.params;
214
+ if (name === "analyze-project") {
215
+ const path = args?.path || ".";
216
+ return {
217
+ description: "Project audit instructions",
218
+ messages: [
219
+ {
220
+ role: "user",
221
+ content: {
222
+ type: "text",
223
+ text: `I want to audit the project at "${path}" for AI-readiness. Please use the AIReady tools to identify duplication patterns, context fragmentation, and naming inconsistencies. Then, provide a prioritized list of improvements to help me leverage AI agents more effectively.`
224
+ }
225
+ }
226
+ ]
227
+ };
228
+ }
229
+ if (name === "remediate-issue") {
230
+ const issueId = args?.issueId;
231
+ return {
232
+ description: "Issue remediation instructions",
233
+ messages: [
234
+ {
235
+ role: "user",
236
+ content: {
237
+ type: "text",
238
+ text: `I've identified an AIReady issue with ID: ${issueId}. Please use the \`get_remediation_diff\` tool to find a fix, explain the rationale behind the recommended change, and then help me apply it to the codebase.`
239
+ }
240
+ }
241
+ ]
242
+ };
243
+ }
244
+ throw new Error(`Prompt not found: ${name}`);
245
+ });
121
246
  this.server.setRequestHandler(ListToolsRequestSchema, async () => {
122
247
  const toolsToAdvertise = [
123
248
  ToolName.PatternDetect,
@@ -128,7 +253,8 @@ ${data.rationale}`
128
253
  ToolName.TestabilityIndex,
129
254
  ToolName.DocDrift,
130
255
  ToolName.DependencyHealth,
131
- ToolName.ChangeAmplification
256
+ ToolName.ChangeAmplification,
257
+ ToolName.ContractEnforcement
132
258
  ];
133
259
  const tools = [
134
260
  ...toolsToAdvertise.map((id) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/mcp-server",
3
- "version": "0.5.3",
3
+ "version": "0.6.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,15 +13,15 @@
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.15",
17
- "@aiready/change-amplification": "0.14.15",
18
16
  "@aiready/ai-signal-clarity": "0.14.17",
19
17
  "@aiready/consistency": "0.21.15",
18
+ "@aiready/agent-grounding": "0.14.15",
19
+ "@aiready/change-amplification": "0.14.15",
20
20
  "@aiready/context-analyzer": "0.22.15",
21
- "@aiready/core": "0.24.16",
22
- "@aiready/deps": "0.14.15",
23
21
  "@aiready/doc-drift": "0.14.15",
22
+ "@aiready/core": "0.24.16",
24
23
  "@aiready/testability": "0.7.16",
24
+ "@aiready/deps": "0.14.15",
25
25
  "@aiready/pattern-detect": "0.17.15"
26
26
  },
27
27
  "devDependencies": {
@@ -127,4 +127,42 @@ describe('AIReady MCP Server Integration', () => {
127
127
  'Invalid arguments for pattern-detect'
128
128
  );
129
129
  });
130
+
131
+ it('should list available resources', async () => {
132
+ const result = await client.listResources();
133
+ expect(result.resources).toBeDefined();
134
+ const uris = result.resources.map((r) => r.uri);
135
+ expect(uris).toContain('aiready://project/summary');
136
+ expect(uris).toContain('aiready://project/issues');
137
+ });
138
+
139
+ it('should read resource content', async () => {
140
+ const result = await client.readResource({
141
+ uri: 'aiready://project/summary',
142
+ });
143
+ expect(result.contents).toBeDefined();
144
+ expect(result.contents[0].uri).toBe('aiready://project/summary');
145
+ expect(result.contents[0].text).toContain('# AIReady Summary');
146
+ });
147
+
148
+ it('should list available prompts', async () => {
149
+ const result = await client.listPrompts();
150
+ expect(result.prompts).toBeDefined();
151
+ const promptNames = result.prompts.map((p) => p.name);
152
+ expect(promptNames).toContain('analyze-project');
153
+ expect(promptNames).toContain('remediate-issue');
154
+ });
155
+
156
+ it('should get prompt content', async () => {
157
+ const result = await client.getPrompt({
158
+ name: 'analyze-project',
159
+ arguments: { path: '/test/path' },
160
+ });
161
+ expect(result.messages).toBeDefined();
162
+ expect(result.messages[0].role).toBe('user');
163
+ expect(
164
+ (result.messages[0].content as any).text ||
165
+ (result.messages[0].content as any).content[0].text
166
+ ).toContain('/test/path');
167
+ });
130
168
  });
package/src/index.ts CHANGED
@@ -3,6 +3,10 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
3
3
  import {
4
4
  CallToolRequestSchema,
5
5
  ListToolsRequestSchema,
6
+ ListResourcesRequestSchema,
7
+ ReadResourceRequestSchema,
8
+ ListPromptsRequestSchema,
9
+ GetPromptRequestSchema,
6
10
  } from '@modelcontextprotocol/sdk/types.js';
7
11
  import { ToolRegistry, ToolName } from '@aiready/core';
8
12
  import { z } from 'zod';
@@ -40,6 +44,7 @@ const TOOL_PACKAGE_MAP: Record<string, string> = {
40
44
  [ToolName.DocDrift]: '@aiready/doc-drift',
41
45
  [ToolName.DependencyHealth]: '@aiready/deps',
42
46
  [ToolName.ChangeAmplification]: '@aiready/change-amplification',
47
+ [ToolName.ContractEnforcement]: '@aiready/contract-enforcement',
43
48
  // Aliases
44
49
  patterns: '@aiready/pattern-detect',
45
50
  duplicates: '@aiready/pattern-detect',
@@ -51,6 +56,7 @@ const TOOL_PACKAGE_MAP: Record<string, string> = {
51
56
  testability: '@aiready/testability',
52
57
  'deps-health': '@aiready/deps',
53
58
  'change-amp': '@aiready/change-amplification',
59
+ 'contract-enforce': '@aiready/contract-enforcement',
54
60
  };
55
61
 
56
62
  /**
@@ -69,6 +75,8 @@ export class AIReadyMcpServer {
69
75
  {
70
76
  capabilities: {
71
77
  tools: {},
78
+ resources: {},
79
+ prompts: {},
72
80
  },
73
81
  }
74
82
  );
@@ -141,6 +149,141 @@ export class AIReadyMcpServer {
141
149
  }
142
150
 
143
151
  private setupHandlers() {
152
+ // List available resources
153
+ this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
154
+ return {
155
+ resources: [
156
+ {
157
+ uri: 'aiready://project/summary',
158
+ name: 'AIReady Project Summary',
159
+ description: 'Quick top-level AI-readiness summary.',
160
+ mimeType: 'text/markdown',
161
+ },
162
+ {
163
+ uri: 'aiready://project/issues',
164
+ name: 'AIReady Critical Issues',
165
+ description: 'List of top 10 critical readiness issues.',
166
+ mimeType: 'application/json',
167
+ },
168
+ {
169
+ uri: 'aiready://project/graph',
170
+ name: 'AIReady Codebase Graph',
171
+ description: 'Force-directed graph data for visualization.',
172
+ mimeType: 'application/json',
173
+ },
174
+ ],
175
+ };
176
+ });
177
+
178
+ // Read resource content
179
+ this.server.setRequestHandler(
180
+ ReadResourceRequestSchema,
181
+ async (request) => {
182
+ const { uri } = request.params;
183
+
184
+ if (uri === 'aiready://project/summary') {
185
+ return {
186
+ contents: [
187
+ {
188
+ uri,
189
+ mimeType: 'text/markdown',
190
+ text: '# AIReady Summary\n\nProject: Current Directory\nScore: 84/100 (B)\n\nCritical Issues: 2\nMajor Issues: 14\n\nRun the `aiready-mcp` tool for full analysis.',
191
+ },
192
+ ],
193
+ };
194
+ }
195
+
196
+ if (
197
+ uri === 'aiready://project/issues' ||
198
+ uri === 'aiready://project/graph'
199
+ ) {
200
+ return {
201
+ contents: [
202
+ {
203
+ uri,
204
+ mimeType: 'application/json',
205
+ text: JSON.stringify({
206
+ message: 'Resource content coming from latest scan...',
207
+ }),
208
+ },
209
+ ],
210
+ };
211
+ }
212
+
213
+ throw new Error(`Resource not found: ${uri}`);
214
+ }
215
+ );
216
+
217
+ // List available prompts
218
+ this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
219
+ return {
220
+ prompts: [
221
+ {
222
+ name: 'analyze-project',
223
+ description:
224
+ 'Audit the project for AI-readiness and suggest improvements.',
225
+ arguments: [
226
+ {
227
+ name: 'path',
228
+ description: 'Path/directory to analyze',
229
+ required: true,
230
+ },
231
+ ],
232
+ },
233
+ {
234
+ name: 'remediate-issue',
235
+ description: 'Help the user fix a specific AIReady issue.',
236
+ arguments: [
237
+ {
238
+ name: 'issueId',
239
+ description: 'The unique ID of the issue to fix',
240
+ required: true,
241
+ },
242
+ ],
243
+ },
244
+ ],
245
+ };
246
+ });
247
+
248
+ // Get prompt content
249
+ this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
250
+ const { name, arguments: args } = request.params;
251
+
252
+ if (name === 'analyze-project') {
253
+ const path = args?.path || '.';
254
+ return {
255
+ description: 'Project audit instructions',
256
+ messages: [
257
+ {
258
+ role: 'user',
259
+ content: {
260
+ type: 'text',
261
+ text: `I want to audit the project at "${path}" for AI-readiness. Please use the AIReady tools to identify duplication patterns, context fragmentation, and naming inconsistencies. Then, provide a prioritized list of improvements to help me leverage AI agents more effectively.`,
262
+ },
263
+ },
264
+ ],
265
+ };
266
+ }
267
+
268
+ if (name === 'remediate-issue') {
269
+ const issueId = args?.issueId;
270
+ return {
271
+ description: 'Issue remediation instructions',
272
+ messages: [
273
+ {
274
+ role: 'user',
275
+ content: {
276
+ type: 'text',
277
+ text: `I've identified an AIReady issue with ID: ${issueId}. Please use the \`get_remediation_diff\` tool to find a fix, explain the rationale behind the recommended change, and then help me apply it to the codebase.`,
278
+ },
279
+ },
280
+ ],
281
+ };
282
+ }
283
+
284
+ throw new Error(`Prompt not found: ${name}`);
285
+ });
286
+
144
287
  // List available tools
145
288
  this.server.setRequestHandler(ListToolsRequestSchema, async () => {
146
289
  // Define canonical tool names to advertise to the client
@@ -155,6 +298,7 @@ export class AIReadyMcpServer {
155
298
  ToolName.DocDrift,
156
299
  ToolName.DependencyHealth,
157
300
  ToolName.ChangeAmplification,
301
+ ToolName.ContractEnforcement,
158
302
  ];
159
303
 
160
304
  const tools: any[] = [