@depfixer/mcp-server 1.0.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/README.md ADDED
@@ -0,0 +1,187 @@
1
+ # @depfixer/mcp-server
2
+
3
+ MCP (Model Context Protocol) server that exposes DepFixer dependency analysis tools to AI coding assistants. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible client.
4
+
5
+ ## What it does
6
+
7
+ This MCP server gives your AI assistant the ability to:
8
+
9
+ - **Analyze** a `package.json` for dependency conflicts, version mismatches, and health issues
10
+ - **Check compatibility** of a specific package version against a framework version
11
+ - **Plan migrations** from one framework version to another with before/after health scores
12
+
13
+ ## Quick Start
14
+
15
+ ### Claude Code
16
+
17
+ Add to your project's `.claude/settings.json` (or global `~/.claude/settings.json`):
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "depfixer": {
23
+ "command": "npx",
24
+ "args": ["@depfixer/mcp-server"],
25
+ "env": {
26
+ "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ### Cursor
34
+
35
+ Add to `.cursor/mcp.json` in your project root:
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "depfixer": {
41
+ "command": "npx",
42
+ "args": ["@depfixer/mcp-server"],
43
+ "env": {
44
+ "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ ### Windsurf
52
+
53
+ Add to your Windsurf MCP configuration:
54
+
55
+ ```json
56
+ {
57
+ "mcpServers": {
58
+ "depfixer": {
59
+ "command": "npx",
60
+ "args": ["@depfixer/mcp-server"],
61
+ "env": {
62
+ "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ ## Tools
70
+
71
+ ### depfixer_analyze
72
+
73
+ Analyze a `package.json` for dependency conflicts, version mismatches, and health issues.
74
+
75
+ | Parameter | Type | Required | Description |
76
+ |-----------|------|----------|-------------|
77
+ | `packageJson` | string | Yes | The contents of the package.json file as a JSON string |
78
+
79
+ **Without API key (audit mode)**: Returns issues found but hides recommended fix versions.
80
+ **With API key (full mode)**: Returns full analysis with fix recommendations and install commands.
81
+
82
+ ### depfixer_check_compatibility
83
+
84
+ Check if a specific npm package version is compatible with a framework version. No API key required.
85
+
86
+ | Parameter | Type | Required | Description |
87
+ |-----------|------|----------|-------------|
88
+ | `packageName` | string | Yes | The npm package name (e.g., `@angular/material`) |
89
+ | `packageVersion` | string | Yes | The package version to check (e.g., `17.0.0`) |
90
+ | `framework` | string | Yes | The framework name (e.g., `angular`, `react`) |
91
+ | `frameworkVersion` | string | Yes | The framework version (e.g., `16.2.0`) |
92
+
93
+ ### depfixer_migrate
94
+
95
+ Plan a framework migration by analyzing current dependencies and projecting changes needed. Requires API key.
96
+
97
+ | Parameter | Type | Required | Description |
98
+ |-----------|------|----------|-------------|
99
+ | `packageJson` | string | Yes | The contents of the package.json file as a JSON string |
100
+ | `targetFramework` | string | Yes | The target framework name (e.g., `angular`, `react`) |
101
+ | `targetVersion` | string | Yes | The target framework major version (e.g., `18`) |
102
+
103
+ ## Configuration
104
+
105
+ ### Environment Variables
106
+
107
+ | Variable | Required | Default | Description |
108
+ |----------|----------|---------|-------------|
109
+ | `DEPFIXER_API_KEY` | No | - | API key for full analysis and migration features |
110
+ | `DEPFIXER_API_URL` | No | `https://api.depfixer.com/api/v1` | Custom API endpoint URL |
111
+
112
+ ### API Key
113
+
114
+ - **Without API key**: The `depfixer_analyze` tool runs in audit mode (finds issues but does not show recommended versions). The `depfixer_check_compatibility` tool works without a key. The `depfixer_migrate` tool requires a key.
115
+ - **With API key**: All tools are fully available with fix recommendations, migration plans, and install commands.
116
+
117
+ Get your API key at: [https://app.depfixer.com/dashboard/api-keys](https://app.depfixer.com/dashboard/api-keys)
118
+
119
+ ## Local Development
120
+
121
+ ### Prerequisites
122
+
123
+ - Node.js >= 18
124
+ - npm
125
+
126
+ ### Setup
127
+
128
+ ```bash
129
+ cd packages/mcp-server
130
+ npm install
131
+ npm run build
132
+ ```
133
+
134
+ ### Run locally
135
+
136
+ ```bash
137
+ npm start
138
+ ```
139
+
140
+ ### Watch mode (auto-rebuild on changes)
141
+
142
+ ```bash
143
+ npm run dev
144
+ ```
145
+
146
+ ### Test with MCP Inspector
147
+
148
+ ```bash
149
+ npm run inspect
150
+ ```
151
+
152
+ This opens the MCP Inspector UI where you can interactively test all tools.
153
+
154
+ ### Local config for Claude Code
155
+
156
+ To test the local build instead of the published npm package:
157
+
158
+ ```json
159
+ {
160
+ "mcpServers": {
161
+ "depfixer": {
162
+ "command": "node",
163
+ "args": ["D:/Mouheb/Project/dep-fixer-claude/packages/mcp-server/dist/index.js"],
164
+ "env": {
165
+ "DEPFIXER_API_URL": "http://localhost:3000/api/v1",
166
+ "DEPFIXER_API_KEY": "your-dev-key"
167
+ }
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ## Architecture
174
+
175
+ ```
176
+ src/
177
+ index.ts # Entry point — stdio transport setup
178
+ server.ts # MCP server creation and tool registration
179
+ api-client.ts # HTTP client for DepFixer API
180
+ types.ts # TypeScript interfaces
181
+ tools/
182
+ analyze.ts # depfixer_analyze tool
183
+ compatibility.ts # depfixer_check_compatibility tool
184
+ migrate.ts # depfixer_migrate tool
185
+ ```
186
+
187
+ All logging uses `console.error()` since stdout is reserved for JSON-RPC communication with the MCP client.
@@ -0,0 +1,31 @@
1
+ import { ApiClientConfig, AnalyzeResult, CompatibilityResult, MigrateResult } from './types.js';
2
+ export declare class DepFixerApiClient {
3
+ private client;
4
+ private apiKey?;
5
+ constructor(config: ApiClientConfig);
6
+ /**
7
+ * Audit analysis (FREE, no auth required)
8
+ * Returns issues without recommended versions
9
+ */
10
+ analyzeAudit(packageJson: any): Promise<AnalyzeResult>;
11
+ /**
12
+ * CI analysis (requires API key)
13
+ * Returns full analysis with recommendations
14
+ */
15
+ analyzeCi(packageJson: any, framework?: string): Promise<AnalyzeResult>;
16
+ /**
17
+ * Migration analysis (requires API key)
18
+ * Returns migration plan with before/after scores
19
+ */
20
+ analyzeMigrate(packageJson: any, targetVersion: string, framework?: string): Promise<MigrateResult>;
21
+ /**
22
+ * Compatibility check (FREE, no auth required)
23
+ */
24
+ checkCompatibility(packageName: string, packageVersion: string, framework: string, frameworkVersion: string): Promise<CompatibilityResult>;
25
+ /**
26
+ * Framework detection (FREE, no auth required)
27
+ */
28
+ detectFramework(packageJson: any): Promise<any>;
29
+ private request;
30
+ }
31
+ //# sourceMappingURL=api-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhG,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,MAAM,EAAE,eAAe;IAYnC;;;OAGG;IACG,YAAY,CAAC,WAAW,EAAE,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC;IAK5D;;;OAGG;IACG,SAAS,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ7E;;;OAGG;IACG,cAAc,CAAC,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAQzG;;OAEG;IACG,kBAAkB,CACtB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,mBAAmB,CAAC;IAW/B;;OAEG;IACG,eAAe,CAAC,WAAW,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YAKvC,OAAO;CA4BtB"}
@@ -0,0 +1,94 @@
1
+ import axios, { AxiosError } from 'axios';
2
+ export class DepFixerApiClient {
3
+ client;
4
+ apiKey;
5
+ constructor(config) {
6
+ this.apiKey = config.apiKey;
7
+ this.client = axios.create({
8
+ baseURL: config.baseUrl,
9
+ timeout: 60000, // 60s timeout for analysis
10
+ headers: {
11
+ 'Content-Type': 'application/json',
12
+ 'User-Agent': 'depfixer-mcp/1.0',
13
+ },
14
+ });
15
+ }
16
+ /**
17
+ * Audit analysis (FREE, no auth required)
18
+ * Returns issues without recommended versions
19
+ */
20
+ async analyzeAudit(packageJson) {
21
+ const response = await this.request('/cli/analyze/audit', { packageJson });
22
+ return response.data;
23
+ }
24
+ /**
25
+ * CI analysis (requires API key)
26
+ * Returns full analysis with recommendations
27
+ */
28
+ async analyzeCi(packageJson, framework) {
29
+ if (!this.apiKey) {
30
+ throw new Error('API key required for full analysis. Set DEPFIXER_API_KEY environment variable.');
31
+ }
32
+ const response = await this.request('/cli/analyze/ci', { packageJson, framework }, true);
33
+ return response.data;
34
+ }
35
+ /**
36
+ * Migration analysis (requires API key)
37
+ * Returns migration plan with before/after scores
38
+ */
39
+ async analyzeMigrate(packageJson, targetVersion, framework) {
40
+ if (!this.apiKey) {
41
+ throw new Error('API key required for migration analysis. Set DEPFIXER_API_KEY environment variable.');
42
+ }
43
+ const response = await this.request('/cli/analyze/migrate', { packageJson, targetVersion, framework }, true);
44
+ return response.data;
45
+ }
46
+ /**
47
+ * Compatibility check (FREE, no auth required)
48
+ */
49
+ async checkCompatibility(packageName, packageVersion, framework, frameworkVersion) {
50
+ const response = await this.request('/compatibility/check-exact', {
51
+ packageName,
52
+ packageVersion,
53
+ framework,
54
+ frameworkVersion,
55
+ });
56
+ // This endpoint returns {success, compatible, reason} at top level (no nested data)
57
+ return response;
58
+ }
59
+ /**
60
+ * Framework detection (FREE, no auth required)
61
+ */
62
+ async detectFramework(packageJson) {
63
+ const response = await this.request('/cli/detect-framework', { packageJson });
64
+ return response.data;
65
+ }
66
+ async request(endpoint, data, requiresAuth = false) {
67
+ try {
68
+ const headers = {};
69
+ if (requiresAuth && this.apiKey) {
70
+ headers['Authorization'] = `Bearer ${this.apiKey}`;
71
+ }
72
+ const response = await this.client.post(endpoint, data, { headers });
73
+ return response.data;
74
+ }
75
+ catch (error) {
76
+ if (error instanceof AxiosError) {
77
+ const status = error.response?.status;
78
+ const message = error.response?.data?.message || error.message;
79
+ if (status === 401) {
80
+ throw new Error(`Authentication failed: ${message}. Check your DEPFIXER_API_KEY.`);
81
+ }
82
+ if (status === 429) {
83
+ throw new Error(`Rate limit exceeded: ${message}. Try again later.`);
84
+ }
85
+ if (status === 403) {
86
+ throw new Error(`Access denied: ${message}`);
87
+ }
88
+ throw new Error(`API error (${status}): ${message}`);
89
+ }
90
+ throw error;
91
+ }
92
+ }
93
+ }
94
+ //# sourceMappingURL=api-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAgB;IACtB,MAAM,CAAU;IAExB,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE,KAAK,EAAE,2BAA2B;YAC3C,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,YAAY,EAAE,kBAAkB;aACjC;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY,CAAC,WAAgB;QACjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAA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 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createServer } from './server.js';
4
+ async function main() {
5
+ const server = createServer();
6
+ const transport = new StdioServerTransport();
7
+ await server.connect(transport);
8
+ console.error('[depfixer-mcp] Server started on stdio');
9
+ }
10
+ main().catch((error) => {
11
+ console.error('[depfixer-mcp] Fatal error:', error);
12
+ process.exit(1);
13
+ });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function createServer(): McpServer;
3
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAqBpE,wBAAgB,YAAY,IAAI,SAAS,CAyDxC"}
package/dist/server.js ADDED
@@ -0,0 +1,43 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { DepFixerApiClient } from './api-client.js';
3
+ import { analyzeToolName, analyzeToolDescription, analyzeToolSchema, handleAnalyze, } from './tools/analyze.js';
4
+ import { compatibilityToolName, compatibilityToolDescription, compatibilityToolSchema, handleCompatibility, } from './tools/compatibility.js';
5
+ import { migrateToolName, migrateToolDescription, migrateToolSchema, handleMigrate, } from './tools/migrate.js';
6
+ export function createServer() {
7
+ const apiUrl = process.env.DEPFIXER_API_URL || 'https://api.depfixer.com/api/v1';
8
+ const apiKey = process.env.DEPFIXER_API_KEY;
9
+ const hasApiKey = !!apiKey;
10
+ const client = new DepFixerApiClient({
11
+ baseUrl: apiUrl,
12
+ apiKey,
13
+ });
14
+ const server = new McpServer({
15
+ name: 'depfixer',
16
+ version: '1.0.0',
17
+ });
18
+ // Register analyze tool
19
+ server.tool(analyzeToolName, analyzeToolDescription, analyzeToolSchema, async (args) => {
20
+ const result = await handleAnalyze(client, hasApiKey, args);
21
+ return { content: [{ type: 'text', text: result }] };
22
+ });
23
+ // Register compatibility tool
24
+ server.tool(compatibilityToolName, compatibilityToolDescription, compatibilityToolSchema, async (args) => {
25
+ const result = await handleCompatibility(client, args);
26
+ return { content: [{ type: 'text', text: result }] };
27
+ });
28
+ // Register migrate tool
29
+ server.tool(migrateToolName, migrateToolDescription, migrateToolSchema, async (args) => {
30
+ const result = await handleMigrate(client, hasApiKey, args);
31
+ return { content: [{ type: 'text', text: result }] };
32
+ });
33
+ // Log mode to stderr (stdout reserved for JSON-RPC)
34
+ if (hasApiKey) {
35
+ console.error('[depfixer-mcp] Running with API key — full analysis + migration available');
36
+ }
37
+ else {
38
+ console.error('[depfixer-mcp] Running without API key — audit mode only (no fix recommendations)');
39
+ console.error('[depfixer-mcp] Set DEPFIXER_API_KEY for full features: https://app.depfixer.com/dashboard/api-keys');
40
+ }
41
+ return server;
42
+ }
43
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,iCAAiC,CAAC;IACjF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC5C,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAE3B,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC;QACnC,OAAO,EAAE,MAAM;QACf,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,wBAAwB;IACxB,MAAM,CAAC,IAAI,CACT,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,8BAA8B;IAC9B,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,wBAAwB;IACxB,MAAM,CAAC,IAAI,CACT,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,oDAAoD;IACpD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,2EAA2E,CAAC,CAAC;IAC7F,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,mFAAmF,CAAC,CAAC;QACnG,OAAO,CAAC,KAAK,CAAC,oGAAoG,CAAC,CAAC;IACtH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { DepFixerApiClient } from '../api-client.js';
3
+ export declare const analyzeToolName = "depfixer_analyze";
4
+ export declare const analyzeToolDescription = "Analyze a package.json for dependency conflicts, version mismatches, and health issues.\n\nWith API key: Returns full analysis with fix recommendations and recommended versions.\nWithout API key: Returns issues found but hides recommended versions (audit mode).\n\nInput: The raw content of a package.json file as a JSON string.\nOutput: Health score (0-100), issue summary by severity, and detailed conflict list.";
5
+ export declare const analyzeToolSchema: {
6
+ packageJson: z.ZodString;
7
+ };
8
+ export declare function handleAnalyze(client: DepFixerApiClient, hasApiKey: boolean, args: {
9
+ packageJson: string;
10
+ }): Promise<string>;
11
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/tools/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAElD,eAAO,MAAM,sBAAsB,maAMkD,CAAC;AAEtF,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAEF,wBAAsB,aAAa,CACjC,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5B,OAAO,CAAC,MAAM,CAAC,CAyEjB"}
@@ -0,0 +1,90 @@
1
+ import { z } from 'zod';
2
+ export const analyzeToolName = 'depfixer_analyze';
3
+ export const analyzeToolDescription = `Analyze a package.json for dependency conflicts, version mismatches, and health issues.
4
+
5
+ With API key: Returns full analysis with fix recommendations and recommended versions.
6
+ Without API key: Returns issues found but hides recommended versions (audit mode).
7
+
8
+ Input: The raw content of a package.json file as a JSON string.
9
+ Output: Health score (0-100), issue summary by severity, and detailed conflict list.`;
10
+ export const analyzeToolSchema = {
11
+ packageJson: z.string().describe('The contents of the package.json file as a JSON string'),
12
+ };
13
+ export async function handleAnalyze(client, hasApiKey, args) {
14
+ let parsed;
15
+ try {
16
+ parsed = JSON.parse(args.packageJson);
17
+ }
18
+ catch {
19
+ return 'Error: Invalid JSON. Please provide valid package.json content.';
20
+ }
21
+ try {
22
+ let result;
23
+ let mode;
24
+ if (hasApiKey) {
25
+ result = await client.analyzeCi(parsed);
26
+ mode = 'full';
27
+ }
28
+ else {
29
+ result = await client.analyzeAudit(parsed);
30
+ mode = 'audit';
31
+ }
32
+ const { summary, healthScore, totalPackages, conflicts, framework } = result;
33
+ const totalIssues = summary.critical + summary.high + summary.medium + summary.low;
34
+ let output = `## Dependency Analysis (${mode} mode)\n\n`;
35
+ output += `**Health Score**: ${healthScore}/100\n`;
36
+ output += `**Total Packages**: ${totalPackages}\n`;
37
+ if (framework) {
38
+ output += `**Framework**: ${framework.name} ${framework.version || ''}\n`;
39
+ }
40
+ output += `**Issues Found**: ${totalIssues}\n\n`;
41
+ if (totalIssues > 0) {
42
+ output += `### Issues by Severity\n`;
43
+ if (summary.critical > 0)
44
+ output += `- Critical: ${summary.critical}\n`;
45
+ if (summary.high > 0)
46
+ output += `- High: ${summary.high}\n`;
47
+ if (summary.medium > 0)
48
+ output += `- Medium: ${summary.medium}\n`;
49
+ if (summary.low > 0)
50
+ output += `- Low: ${summary.low}\n`;
51
+ output += `\n`;
52
+ }
53
+ if (conflicts && conflicts.length > 0) {
54
+ output += `### Conflicts\n\n`;
55
+ for (const conflict of conflicts) {
56
+ output += `**${conflict.package}**\n`;
57
+ if (conflict.issue || conflict.description) {
58
+ output += ` Issue: ${conflict.issue || conflict.description}\n`;
59
+ }
60
+ if (conflict.currentVersion)
61
+ output += ` Current: ${conflict.currentVersion}\n`;
62
+ if (conflict.recommendedVersion)
63
+ output += ` Recommended: ${conflict.recommendedVersion}\n`;
64
+ if (conflict.severity)
65
+ output += ` Severity: ${conflict.severity}\n`;
66
+ output += `\n`;
67
+ }
68
+ }
69
+ // Fix commands
70
+ if (mode === 'full') {
71
+ const fixable = conflicts?.filter((c) => c.recommendedVersion) || [];
72
+ if (fixable.length > 0) {
73
+ output += `### Fix Commands\n\n`;
74
+ output += `\`\`\`bash\nnpm install`;
75
+ for (const c of fixable) {
76
+ output += ` ${c.package}@${c.recommendedVersion}`;
77
+ }
78
+ output += `\n\`\`\`\n`;
79
+ }
80
+ }
81
+ else {
82
+ output += `\n> **Note**: Running in audit mode (no API key). Set DEPFIXER_API_KEY for full analysis with fix recommendations.\n`;
83
+ }
84
+ return output;
85
+ }
86
+ catch (error) {
87
+ return `Error analyzing package.json: ${error instanceof Error ? error.message : String(error)}`;
88
+ }
89
+ }
90
+ //# sourceMappingURL=analyze.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/tools/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;qFAM+C,CAAC;AAEtF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;CAC3F,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAyB,EACzB,SAAkB,EAClB,IAA6B;IAE7B,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,iEAAiE,CAAC;IAC3E,CAAC;IAED,IAAI,CAAC;QACH,IAAI,MAAM,CAAC;QACX,IAAI,IAAY,CAAC;QAEjB,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACxC,IAAI,GAAG,MAAM,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAC3C,IAAI,GAAG,O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AC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACnG,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { DepFixerApiClient } from '../api-client.js';
3
+ export declare const compatibilityToolName = "depfixer_check_compatibility";
4
+ export declare const compatibilityToolDescription = "Check if a specific npm package version is compatible with a framework version.\n\nNo API key required. Use this to verify if a package works with your framework before installing.\n\nExample: Check if @angular/material@17.0.0 is compatible with Angular 16.";
5
+ export declare const compatibilityToolSchema: {
6
+ packageName: z.ZodString;
7
+ packageVersion: z.ZodString;
8
+ framework: z.ZodString;
9
+ frameworkVersion: z.ZodString;
10
+ };
11
+ export declare function handleCompatibility(client: DepFixerApiClient, args: {
12
+ packageName: string;
13
+ packageVersion: string;
14
+ framework: string;
15
+ frameworkVersion: string;
16
+ }): Promise<string>;
17
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../../src/tools/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,eAAO,MAAM,4BAA4B,sQAIiC,CAAC;AAE3E,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACA,OAAO,CAAC,MAAM,CAAC,CA6BjB"}
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ export const compatibilityToolName = 'depfixer_check_compatibility';
3
+ export const compatibilityToolDescription = `Check if a specific npm package version is compatible with a framework version.
4
+
5
+ No API key required. Use this to verify if a package works with your framework before installing.
6
+
7
+ Example: Check if @angular/material@17.0.0 is compatible with Angular 16.`;
8
+ export const compatibilityToolSchema = {
9
+ packageName: z.string().describe('The npm package name (e.g., "@angular/material")'),
10
+ packageVersion: z.string().describe('The package version to check (e.g., "17.0.0")'),
11
+ framework: z.string().describe('The framework name (e.g., "angular", "react")'),
12
+ frameworkVersion: z.string().describe('The framework version (e.g., "16.2.0")'),
13
+ };
14
+ export async function handleCompatibility(client, args) {
15
+ try {
16
+ const result = await client.checkCompatibility(args.packageName, args.packageVersion, args.framework, args.frameworkVersion);
17
+ let output = `## Compatibility Check\n\n`;
18
+ output += `**Package**: ${args.packageName}@${args.packageVersion}\n`;
19
+ output += `**Framework**: ${args.framework} ${args.frameworkVersion}\n\n`;
20
+ if (result.compatible) {
21
+ output += `**Result**: Compatible\n`;
22
+ }
23
+ else {
24
+ output += `**Result**: Not Compatible\n`;
25
+ if (result.reason) {
26
+ output += `**Reason**: ${result.reason}\n`;
27
+ }
28
+ if (result.recommendedVersion) {
29
+ output += `**Recommended Version**: ${args.packageName}@${result.recommendedVersion}\n`;
30
+ }
31
+ }
32
+ return output;
33
+ }
34
+ catch (error) {
35
+ return `Error checking compatibility: ${error instanceof Error ? error.message : String(error)}`;
36
+ }
37
+ }
38
+ //# sourceMappingURL=compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../src/tools/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,qBAAqB,GAAG,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;0EAI8B,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IACpF,cA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AM,CAAC,KAAK,CAAC,EAAE,CAAC;IACnG,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { DepFixerApiClient } from '../api-client.js';
3
+ export declare const migrateToolName = "depfixer_migrate";
4
+ export declare const migrateToolDescription = "Plan a framework migration by analyzing current dependencies and projecting changes needed for the target version.\n\nRequires API key (DEPFIXER_API_KEY). Returns health score before/after, packages to update, breaking changes, and fix commands.\n\nExample: Migrate an Angular 16 project to Angular 18.";
5
+ export declare const migrateToolSchema: {
6
+ packageJson: z.ZodString;
7
+ targetFramework: z.ZodString;
8
+ targetVersion: z.ZodString;
9
+ };
10
+ export declare function handleMigrate(client: DepFixerApiClient, hasApiKey: boolean, args: {
11
+ packageJson: string;
12
+ targetFramework: string;
13
+ targetVersion: string;
14
+ }): Promise<string>;
15
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/tools/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAElD,eAAO,MAAM,sBAAsB,mTAImB,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC;AAEF,wBAAsB,aAAa,CACjC,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC,MAAM,CAAC,CA+DjB"}
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod';
2
+ export const migrateToolName = 'depfixer_migrate';
3
+ export const migrateToolDescription = `Plan a framework migration by analyzing current dependencies and projecting changes needed for the target version.
4
+
5
+ Requires API key (DEPFIXER_API_KEY). Returns health score before/after, packages to update, breaking changes, and fix commands.
6
+
7
+ Example: Migrate an Angular 16 project to Angular 18.`;
8
+ export const migrateToolSchema = {
9
+ packageJson: z.string().describe('The contents of the package.json file as a JSON string'),
10
+ targetFramework: z.string().describe('The target framework name (e.g., "angular", "react")'),
11
+ targetVersion: z.string().describe('The target framework major version (e.g., "18", "19.0.0")'),
12
+ };
13
+ export async function handleMigrate(client, hasApiKey, args) {
14
+ if (!hasApiKey) {
15
+ return `## Migration Analysis\n\n**Error**: API key required for migration analysis.\n\nSet the \`DEPFIXER_API_KEY\` environment variable in your MCP server configuration.\n\nGet your API key at: https://app.depfixer.com/dashboard/api-keys`;
16
+ }
17
+ let parsed;
18
+ try {
19
+ parsed = JSON.parse(args.packageJson);
20
+ }
21
+ catch {
22
+ return 'Error: Invalid JSON. Please provide valid package.json content.';
23
+ }
24
+ try {
25
+ const result = await client.analyzeMigrate(parsed, args.targetVersion, args.targetFramework);
26
+ let output = `## Migration Analysis\n\n`;
27
+ if (result.framework) {
28
+ output += `**Framework**: ${result.framework.name} → ${args.targetVersion}\n`;
29
+ }
30
+ output += `**Target**: ${args.targetFramework} ${args.targetVersion}\n\n`;
31
+ if (result.healthScore) {
32
+ output += `### Health Score\n`;
33
+ output += `- **Before**: ${result.healthScore.before}/100\n`;
34
+ output += `- **After**: ${result.healthScore.after}/100\n`;
35
+ const improvement = result.healthScore.after - result.healthScore.before;
36
+ if (improvement > 0) {
37
+ output += `- **Improvement**: +${improvement} points\n`;
38
+ }
39
+ output += `\n`;
40
+ }
41
+ if (result.packagesToUpdate && result.packagesToUpdate.length > 0) {
42
+ output += `### Packages to Update (${result.packagesToUpdate.length})\n\n`;
43
+ for (const pkg of result.packagesToUpdate) {
44
+ output += `- **${pkg.package}**: ${pkg.currentVersion} → ${pkg.targetVersion}`;
45
+ if (pkg.reason)
46
+ output += ` (${pkg.reason})`;
47
+ output += `\n`;
48
+ }
49
+ output += `\n`;
50
+ }
51
+ if (result.breakingChanges && result.breakingChanges.length > 0) {
52
+ output += `### Breaking Changes\n\n`;
53
+ for (const change of result.breakingChanges) {
54
+ output += `- ${change}\n`;
55
+ }
56
+ output += `\n`;
57
+ }
58
+ if (result.commands && result.commands.length > 0) {
59
+ output += `### Commands\n\n`;
60
+ output += `\`\`\`bash\n`;
61
+ for (const cmd of result.commands) {
62
+ output += `${cmd}\n`;
63
+ }
64
+ output += `\`\`\`\n`;
65
+ }
66
+ return output;
67
+ }
68
+ catch (error) {
69
+ return `Error analyzing migration: ${error instanceof Error ? error.message : String(error)}`;
70
+ }
71
+ }
72
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/tools/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;sDAIgB,CAAC;AAEvD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IAC1F,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IAC5F,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;CAChG,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAyB,EACzB,SAAkB,EAClB,IAIC;IAED,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,yOAAyO,CAAC;IACnP,CAAC;IAED,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,iEAAi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CAAC,MAAM;oBAAE,MAAM,IAAI,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;gBAC7C,MAAM,IAAI,IAAI,CAAC;YACjB,CAAC;YACD,MAAM,IAAI,IAAI,CAAC;QACjB,CAAC;QAED,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,0BAA0B,CAAC;YACrC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;gBAC5C,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;YAC5B,CAAC;YACD,MAAM,IAAI,IAAI,CAAC;QACjB,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,kBAAkB,CAAC;YAC7B,MAAM,IAAI,cAAc,CAAC;YACzB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAClC,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC;YACvB,CAAC;YACD,MAAM,IAAI,UAAU,CAAC;QACvB,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,8BAA8B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAChG,CAAC;AACH,CAAC"}
@@ -0,0 +1,57 @@
1
+ export interface AnalyzeResult {
2
+ mode: string;
3
+ healthScore: number;
4
+ totalPackages: number;
5
+ summary: {
6
+ critical: number;
7
+ high: number;
8
+ medium: number;
9
+ low: number;
10
+ };
11
+ conflicts: ConflictItem[];
12
+ framework?: {
13
+ name: string;
14
+ version: string;
15
+ };
16
+ analysisId?: string;
17
+ }
18
+ export interface ConflictItem {
19
+ package: string;
20
+ currentVersion?: string;
21
+ recommendedVersion?: string;
22
+ issue?: string;
23
+ description?: string;
24
+ severity?: string;
25
+ type?: string;
26
+ }
27
+ export interface CompatibilityResult {
28
+ compatible: boolean;
29
+ reason?: string;
30
+ recommendedVersion?: string;
31
+ details?: any;
32
+ }
33
+ export interface MigrateResult {
34
+ framework?: {
35
+ name: string;
36
+ version: string;
37
+ };
38
+ targetVersion: string;
39
+ healthScore: {
40
+ before: number;
41
+ after: number;
42
+ };
43
+ packagesToUpdate: PackageUpdate[];
44
+ breakingChanges?: string[];
45
+ commands?: string[];
46
+ }
47
+ export interface PackageUpdate {
48
+ package: string;
49
+ currentVersion: string;
50
+ targetVersion: string;
51
+ reason?: string;
52
+ }
53
+ export interface ApiClientConfig {
54
+ baseUrl: string;
55
+ apiKey?: string;
56
+ }
57
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@depfixer/mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for DepFixer dependency analysis - integrates with Claude Code, Cursor, Windsurf",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "depfixer-mcp": "dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "start": "node dist/index.js",
14
+ "inspect": "npx @modelcontextprotocol/inspector node dist/index.js"
15
+ },
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "dependencies": {
20
+ "@modelcontextprotocol/sdk": "^1.27.0",
21
+ "axios": "^1.7.0",
22
+ "zod": "^3.23.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.4.0",
26
+ "@types/node": "^20.0.0"
27
+ },
28
+ "keywords": [
29
+ "mcp",
30
+ "depfixer",
31
+ "dependency-analysis",
32
+ "claude-code",
33
+ "cursor",
34
+ "windsurf"
35
+ ],
36
+ "license": "MIT"
37
+ }