mcp-docs-service 0.2.0 → 0.2.3
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/CHANGELOG.md +52 -0
- package/LICENSE +1 -1
- package/README.md +30 -57
- package/dist/cli/bin.d.ts +5 -3
- package/dist/cli/bin.js +41 -37
- package/dist/cli/bin.js.map +1 -1
- package/dist/handlers/docs.d.ts +26 -0
- package/dist/handlers/docs.js +513 -0
- package/dist/handlers/docs.js.map +1 -0
- package/dist/handlers/file.d.ts +32 -0
- package/dist/handlers/file.js +222 -0
- package/dist/handlers/file.js.map +1 -0
- package/dist/handlers/index.d.ts +1 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/index.d.ts +2 -24
- package/dist/index.js +473 -49
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/tools.d.ts +164 -0
- package/dist/schemas/tools.js +53 -0
- package/dist/schemas/tools.js.map +1 -0
- package/dist/types/docs.d.ts +74 -0
- package/dist/types/docs.js +2 -0
- package/dist/types/docs.js.map +1 -0
- package/dist/types/file.d.ts +21 -0
- package/dist/types/file.js +2 -0
- package/dist/types/file.js.map +1 -0
- package/dist/types/index.d.ts +34 -43
- package/dist/types/index.js +3 -5
- package/dist/types/index.js.map +1 -1
- package/dist/types/tools.d.ts +11 -0
- package/dist/types/tools.js +2 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/utils/file.d.ts +24 -0
- package/dist/utils/file.js +94 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/index.d.ts +1 -60
- package/dist/utils/index.js +2 -151
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/path.d.ts +16 -0
- package/dist/utils/path.js +70 -0
- package/dist/utils/path.js.map +1 -0
- package/package.json +20 -8
- package/dist/cli/index.d.ts +0 -16
- package/dist/cli/index.js +0 -108
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/jsonrpc.d.ts +0 -29
- package/dist/cli/jsonrpc.js +0 -121
- package/dist/cli/jsonrpc.js.map +0 -1
- package/dist/core/docAnalyzer.d.ts +0 -25
- package/dist/core/docAnalyzer.js +0 -118
- package/dist/core/docAnalyzer.js.map +0 -1
- package/dist/core/docManager.d.ts +0 -48
- package/dist/core/docManager.js +0 -257
- package/dist/core/docManager.js.map +0 -1
- package/dist/core/docProcessor.d.ts +0 -20
- package/dist/core/docProcessor.js +0 -127
- package/dist/core/docProcessor.js.map +0 -1
- package/dist/core/mcpDocsServer.d.ts +0 -61
- package/dist/core/mcpDocsServer.js +0 -395
- package/dist/core/mcpDocsServer.js.map +0 -1
package/dist/utils/index.js
CHANGED
@@ -1,152 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
* Utility functions for the MCP Documentation Service
|
4
|
-
*/
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.generateExcerpt = exports.calculateRelevance = exports.escapeRegex = exports.joinPaths = exports.getDirectoryName = exports.getFileName = exports.getFileExtension = exports.normalizePath = exports.isValidPath = void 0;
|
7
|
-
/**
|
8
|
-
* Check if a path is valid
|
9
|
-
* @param path - Path to check
|
10
|
-
* @returns True if the path is valid, false otherwise
|
11
|
-
*/
|
12
|
-
function isValidPath(path) {
|
13
|
-
// Ensure path doesn't contain invalid characters or sequences
|
14
|
-
return !path.includes("..") && !path.includes("//") && !path.startsWith("/");
|
15
|
-
}
|
16
|
-
exports.isValidPath = isValidPath;
|
17
|
-
/**
|
18
|
-
* Normalize a path
|
19
|
-
* @param path - Path to normalize
|
20
|
-
* @returns Normalized path
|
21
|
-
*/
|
22
|
-
function normalizePath(path) {
|
23
|
-
// Replace backslashes with forward slashes
|
24
|
-
path = path.replace(/\\/g, "/");
|
25
|
-
// Remove leading and trailing slashes
|
26
|
-
path = path.replace(/^\/+|\/+$/g, "");
|
27
|
-
// Replace multiple slashes with a single slash
|
28
|
-
path = path.replace(/\/+/g, "/");
|
29
|
-
return path;
|
30
|
-
}
|
31
|
-
exports.normalizePath = normalizePath;
|
32
|
-
/**
|
33
|
-
* Get file extension
|
34
|
-
* @param path - Path to get extension from
|
35
|
-
* @returns File extension
|
36
|
-
*/
|
37
|
-
function getFileExtension(path) {
|
38
|
-
const match = path.match(/\.([^.]+)$/);
|
39
|
-
return match ? `.${match[1].toLowerCase()}` : "";
|
40
|
-
}
|
41
|
-
exports.getFileExtension = getFileExtension;
|
42
|
-
/**
|
43
|
-
* Get file name
|
44
|
-
* @param path - Path to get name from
|
45
|
-
* @returns File name
|
46
|
-
*/
|
47
|
-
function getFileName(path) {
|
48
|
-
const match = path.match(/([^/]+)$/);
|
49
|
-
return match ? match[1] : "";
|
50
|
-
}
|
51
|
-
exports.getFileName = getFileName;
|
52
|
-
/**
|
53
|
-
* Get directory name
|
54
|
-
* @param path - Path to get directory name from
|
55
|
-
* @returns Directory name
|
56
|
-
*/
|
57
|
-
function getDirectoryName(path) {
|
58
|
-
const match = path.match(/([^/]+)\/[^/]+$/);
|
59
|
-
return match ? match[1] : "";
|
60
|
-
}
|
61
|
-
exports.getDirectoryName = getDirectoryName;
|
62
|
-
/**
|
63
|
-
* Join paths
|
64
|
-
* @param paths - Paths to join
|
65
|
-
* @returns Joined path
|
66
|
-
*/
|
67
|
-
function joinPaths(...paths) {
|
68
|
-
return normalizePath(paths.join("/"));
|
69
|
-
}
|
70
|
-
exports.joinPaths = joinPaths;
|
71
|
-
/**
|
72
|
-
* Escape regex special characters
|
73
|
-
* @param str - String to escape
|
74
|
-
* @returns Escaped string
|
75
|
-
*/
|
76
|
-
function escapeRegex(str) {
|
77
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
78
|
-
}
|
79
|
-
exports.escapeRegex = escapeRegex;
|
80
|
-
/**
|
81
|
-
* Calculate relevance score
|
82
|
-
* @param text - Text to search in
|
83
|
-
* @param query - Query to search for
|
84
|
-
* @returns Relevance score (0-1)
|
85
|
-
*/
|
86
|
-
function calculateRelevance(text, query) {
|
87
|
-
if (!query || !text)
|
88
|
-
return 0;
|
89
|
-
// Convert to lowercase for case-insensitive matching
|
90
|
-
const lowerText = text.toLowerCase();
|
91
|
-
const lowerQuery = query.toLowerCase();
|
92
|
-
// Check if the query is in the text
|
93
|
-
if (!lowerText.includes(lowerQuery))
|
94
|
-
return 0;
|
95
|
-
// Calculate relevance based on frequency and position
|
96
|
-
const frequency = (lowerText.match(new RegExp(escapeRegex(lowerQuery), "g")) || []).length;
|
97
|
-
const position = lowerText.indexOf(lowerQuery);
|
98
|
-
const textLength = text.length;
|
99
|
-
// Higher relevance for:
|
100
|
-
// - More occurrences of the query
|
101
|
-
// - Earlier position of the query
|
102
|
-
// - Shorter text (query is more significant in shorter text)
|
103
|
-
const frequencyFactor = Math.min(frequency / 5, 1); // Cap at 1
|
104
|
-
const positionFactor = 1 - position / textLength;
|
105
|
-
const lengthFactor = 1 - Math.min(textLength / 1000, 0.9); // Cap at 0.9
|
106
|
-
return frequencyFactor * 0.4 + positionFactor * 0.4 + lengthFactor * 0.2;
|
107
|
-
}
|
108
|
-
exports.calculateRelevance = calculateRelevance;
|
109
|
-
/**
|
110
|
-
* Generate excerpt
|
111
|
-
* @param text - Text to generate excerpt from
|
112
|
-
* @param query - Query to highlight
|
113
|
-
* @param length - Excerpt length
|
114
|
-
* @returns Excerpt
|
115
|
-
*/
|
116
|
-
function generateExcerpt(text, query, length = 150) {
|
117
|
-
if (!text)
|
118
|
-
return "";
|
119
|
-
if (!query)
|
120
|
-
return text.substring(0, length);
|
121
|
-
// Find the position of the query
|
122
|
-
const lowerText = text.toLowerCase();
|
123
|
-
const lowerQuery = query.toLowerCase();
|
124
|
-
const position = lowerText.indexOf(lowerQuery);
|
125
|
-
if (position === -1) {
|
126
|
-
// Query not found, return the beginning of the text
|
127
|
-
return text.substring(0, length) + (text.length > length ? "..." : "");
|
128
|
-
}
|
129
|
-
// Calculate start and end positions for the excerpt
|
130
|
-
const halfLength = Math.floor(length / 2);
|
131
|
-
let start = Math.max(0, position - halfLength);
|
132
|
-
let end = Math.min(text.length, position + query.length + halfLength);
|
133
|
-
// Adjust if the excerpt is shorter than the desired length
|
134
|
-
if (end - start < length) {
|
135
|
-
if (start === 0) {
|
136
|
-
end = Math.min(text.length, length);
|
137
|
-
}
|
138
|
-
else if (end === text.length) {
|
139
|
-
start = Math.max(0, text.length - length);
|
140
|
-
}
|
141
|
-
}
|
142
|
-
// Generate the excerpt
|
143
|
-
let excerpt = text.substring(start, end);
|
144
|
-
// Add ellipsis if needed
|
145
|
-
if (start > 0)
|
146
|
-
excerpt = "..." + excerpt;
|
147
|
-
if (end < text.length)
|
148
|
-
excerpt = excerpt + "...";
|
149
|
-
return excerpt;
|
150
|
-
}
|
151
|
-
exports.generateExcerpt = generateExcerpt;
|
1
|
+
// Re-export all utility functions
|
2
|
+
export * from "./path.js";
|
152
3
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,cAAc,WAAW,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* Normalizes a path consistently
|
3
|
+
*/
|
4
|
+
export declare function normalizePath(p: string): string;
|
5
|
+
/**
|
6
|
+
* Expands the home directory in a path (e.g., ~/docs -> /home/user/docs)
|
7
|
+
*/
|
8
|
+
export declare function expandHome(p: string): string;
|
9
|
+
/**
|
10
|
+
* Validates that a path is within allowed directories
|
11
|
+
* @param p The path to validate
|
12
|
+
* @param allowedDirectories Array of allowed directory paths
|
13
|
+
* @returns The normalized path if valid
|
14
|
+
* @throws Error if path is not within allowed directories
|
15
|
+
*/
|
16
|
+
export declare function validatePath(p: string, allowedDirectories: string[]): Promise<string>;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import path from "path";
|
2
|
+
import os from "os";
|
3
|
+
import fs from "fs/promises";
|
4
|
+
/**
|
5
|
+
* Normalizes a path consistently
|
6
|
+
*/
|
7
|
+
export function normalizePath(p) {
|
8
|
+
return path.normalize(p);
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Expands the home directory in a path (e.g., ~/docs -> /home/user/docs)
|
12
|
+
*/
|
13
|
+
export function expandHome(p) {
|
14
|
+
if (!p)
|
15
|
+
return p;
|
16
|
+
if (p === "~" || p.startsWith("~/")) {
|
17
|
+
return p.replace(/^~/, os.homedir());
|
18
|
+
}
|
19
|
+
return p;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Validates that a path is within allowed directories
|
23
|
+
* @param p The path to validate
|
24
|
+
* @param allowedDirectories Array of allowed directory paths
|
25
|
+
* @returns The normalized path if valid
|
26
|
+
* @throws Error if path is not within allowed directories
|
27
|
+
*/
|
28
|
+
export async function validatePath(p, allowedDirectories) {
|
29
|
+
// Handle empty path by using the first allowed directory
|
30
|
+
if (!p) {
|
31
|
+
return allowedDirectories[0];
|
32
|
+
}
|
33
|
+
// Resolve the path
|
34
|
+
const normalizedPath = normalizePath(path.resolve(expandHome(p)));
|
35
|
+
// Check if the path is exactly an allowed directory
|
36
|
+
if (allowedDirectories.some((dir) => dir === normalizedPath)) {
|
37
|
+
return normalizedPath;
|
38
|
+
}
|
39
|
+
// Check if the path is within any of the allowed directories
|
40
|
+
const isAllowed = allowedDirectories.some((dir) => {
|
41
|
+
const relativePath = path.relative(dir, normalizedPath);
|
42
|
+
return (relativePath !== "" &&
|
43
|
+
!relativePath.startsWith("..") &&
|
44
|
+
!path.isAbsolute(relativePath));
|
45
|
+
});
|
46
|
+
if (!isAllowed) {
|
47
|
+
// Try to resolve the path relative to the allowed directories
|
48
|
+
for (const dir of allowedDirectories) {
|
49
|
+
const resolvedPath = path.resolve(dir, p);
|
50
|
+
try {
|
51
|
+
// Check if the path exists
|
52
|
+
await fs.access(resolvedPath);
|
53
|
+
// If it exists, check if it's within an allowed directory
|
54
|
+
const relativePath = path.relative(dir, resolvedPath);
|
55
|
+
if (relativePath !== "" &&
|
56
|
+
!relativePath.startsWith("..") &&
|
57
|
+
!path.isAbsolute(relativePath)) {
|
58
|
+
return resolvedPath;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
catch (error) {
|
62
|
+
// Path doesn't exist, continue to the next directory
|
63
|
+
}
|
64
|
+
}
|
65
|
+
// If we get here, the path is not allowed
|
66
|
+
throw new Error(`Access denied: ${p} is not within allowed directories. Allowed directories: ${allowedDirectories.join(", ")}`);
|
67
|
+
}
|
68
|
+
return normalizedPath;
|
69
|
+
}
|
70
|
+
//# sourceMappingURL=path.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/utils/path.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,CAAS;IACrC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,CAAS,EACT,kBAA4B;IAE5B,yDAAyD;IACzD,IAAI,CAAC,CAAC,EAA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C;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,qDAAqD;YACvD,CAAC;QACH,CAAC;QAED,0CAA0C;QAC1C,MAAM,IAAI,KAAK,CACb,kBAAkB,CAAC,4DAA4D,kBAAkB,CAAC,IAAI,CACpG,IAAI,CACL,EAAE,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "mcp-docs-service",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.3",
|
4
4
|
"description": "MCP Documentation Management Service - A Model Context Protocol implementation for documentation management",
|
5
|
+
"type": "module",
|
5
6
|
"main": "dist/index.js",
|
6
7
|
"types": "dist/index.d.ts",
|
7
8
|
"bin": {
|
@@ -9,9 +10,11 @@
|
|
9
10
|
},
|
10
11
|
"scripts": {
|
11
12
|
"build": "tsc",
|
12
|
-
"
|
13
|
+
"prepare": "npm run build",
|
14
|
+
"watch": "tsc --watch",
|
13
15
|
"test": "echo \"No tests yet\" && exit 0",
|
14
|
-
"start": "node dist/cli/bin.js"
|
16
|
+
"start": "node dist/cli/bin.js",
|
17
|
+
"prepare-publish": "node scripts/prepare-publish.js"
|
15
18
|
},
|
16
19
|
"keywords": [
|
17
20
|
"mcp",
|
@@ -19,23 +22,32 @@
|
|
19
22
|
"cursor",
|
20
23
|
"claude",
|
21
24
|
"markdown",
|
22
|
-
"model-context-protocol"
|
25
|
+
"model-context-protocol",
|
26
|
+
"knowledge-base",
|
27
|
+
"documentation-management",
|
28
|
+
"llm-context"
|
23
29
|
],
|
24
30
|
"author": "Aleks Petrov",
|
25
31
|
"license": "MIT",
|
26
32
|
"dependencies": {
|
27
|
-
"@modelcontextprotocol/sdk": "^
|
28
|
-
"
|
29
|
-
"
|
33
|
+
"@modelcontextprotocol/sdk": "^0.5.0",
|
34
|
+
"diff": "^7.0.0",
|
35
|
+
"glob": "^11.0.1",
|
36
|
+
"js-yaml": "^4.1.0",
|
37
|
+
"minimatch": "^10.0.1",
|
38
|
+
"zod-to-json-schema": "^3.23.5"
|
30
39
|
},
|
31
40
|
"devDependencies": {
|
41
|
+
"@types/diff": "^7.0.1",
|
32
42
|
"@types/js-yaml": "^4.0.5",
|
33
43
|
"@types/node": "^18.0.0",
|
34
|
-
"
|
44
|
+
"shx": "^0.3.4",
|
45
|
+
"typescript": "^5.3.3"
|
35
46
|
},
|
36
47
|
"files": [
|
37
48
|
"dist",
|
38
49
|
"README.md",
|
50
|
+
"CHANGELOG.md",
|
39
51
|
"LICENSE"
|
40
52
|
],
|
41
53
|
"engines": {
|
package/dist/cli/index.d.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* CLI interface for the MCP Documentation Management Service
|
3
|
-
*
|
4
|
-
* This script is meant to be run from the command line to start the MCP server.
|
5
|
-
* It reads queries from stdin, processes them, and writes results to stdout.
|
6
|
-
*
|
7
|
-
* Usage:
|
8
|
-
* npx mcp-docs-service [options]
|
9
|
-
*/
|
10
|
-
/**
|
11
|
-
* Main function to process stdin commands
|
12
|
-
*/
|
13
|
-
export declare function main(options?: {
|
14
|
-
docsDir: string;
|
15
|
-
createIfNotExists: boolean;
|
16
|
-
}): Promise<void>;
|
package/dist/cli/index.js
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* CLI interface for the MCP Documentation Management Service
|
4
|
-
*
|
5
|
-
* This script is meant to be run from the command line to start the MCP server.
|
6
|
-
* It reads queries from stdin, processes them, and writes results to stdout.
|
7
|
-
*
|
8
|
-
* Usage:
|
9
|
-
* npx mcp-docs-service [options]
|
10
|
-
*/
|
11
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
12
|
-
if (k2 === undefined) k2 = k;
|
13
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
14
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
15
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
16
|
-
}
|
17
|
-
Object.defineProperty(o, k2, desc);
|
18
|
-
}) : (function(o, m, k, k2) {
|
19
|
-
if (k2 === undefined) k2 = k;
|
20
|
-
o[k2] = m[k];
|
21
|
-
}));
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
24
|
-
}) : function(o, v) {
|
25
|
-
o["default"] = v;
|
26
|
-
});
|
27
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
28
|
-
if (mod && mod.__esModule) return mod;
|
29
|
-
var result = {};
|
30
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
31
|
-
__setModuleDefault(result, mod);
|
32
|
-
return result;
|
33
|
-
};
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
35
|
-
exports.main = void 0;
|
36
|
-
const index_js_1 = require("../index.js");
|
37
|
-
const readline = __importStar(require("readline"));
|
38
|
-
const jsonrpc_js_1 = require("./jsonrpc.js");
|
39
|
-
/**
|
40
|
-
* Main function to process stdin commands
|
41
|
-
*/
|
42
|
-
async function main(options = {
|
43
|
-
docsDir: "./docs",
|
44
|
-
createIfNotExists: false,
|
45
|
-
}) {
|
46
|
-
console.error("MCP Documentation Management Service started.");
|
47
|
-
console.error(`Using docs directory: ${options.docsDir}`);
|
48
|
-
if (options.createIfNotExists) {
|
49
|
-
console.error("Will create directory if it doesn't exist");
|
50
|
-
}
|
51
|
-
console.error("Reading from stdin, writing results to stdout...");
|
52
|
-
// Create a custom query function that uses the specified docs directory
|
53
|
-
const query = (sql) => (0, index_js_1.query)(sql, {
|
54
|
-
docsDir: options.docsDir,
|
55
|
-
createIfNotExists: options.createIfNotExists,
|
56
|
-
});
|
57
|
-
// Create readline interface
|
58
|
-
const rl = readline.createInterface({
|
59
|
-
input: process.stdin,
|
60
|
-
output: process.stdout,
|
61
|
-
terminal: false,
|
62
|
-
});
|
63
|
-
// Handle process termination
|
64
|
-
process.on("SIGINT", () => {
|
65
|
-
console.error("\nMCP Documentation Management Service terminated.");
|
66
|
-
process.exit(0);
|
67
|
-
});
|
68
|
-
// Process lines from stdin
|
69
|
-
rl.on("line", async (line) => {
|
70
|
-
if (line.trim()) {
|
71
|
-
try {
|
72
|
-
// Check if the input is a JSON-RPC 2.0 request
|
73
|
-
if (line.trim().startsWith("{") && line.includes('"jsonrpc"')) {
|
74
|
-
// Process as JSON-RPC 2.0 request
|
75
|
-
const response = await (0, jsonrpc_js_1.processJsonRpcRequest)(line.trim(), {
|
76
|
-
docsDir: options.docsDir,
|
77
|
-
createIfNotExists: options.createIfNotExists,
|
78
|
-
});
|
79
|
-
console.log(JSON.stringify(response));
|
80
|
-
}
|
81
|
-
else {
|
82
|
-
// Process as SQL-like query (legacy mode)
|
83
|
-
const result = await query(line.trim());
|
84
|
-
console.log(JSON.stringify(result));
|
85
|
-
}
|
86
|
-
}
|
87
|
-
catch (error) {
|
88
|
-
// Log errors to stderr and write error result to stdout
|
89
|
-
console.error(`Error processing command: ${error instanceof Error ? error.message : String(error)}`);
|
90
|
-
console.log(JSON.stringify({
|
91
|
-
success: false,
|
92
|
-
error: error instanceof Error ? error.message : String(error),
|
93
|
-
}));
|
94
|
-
}
|
95
|
-
}
|
96
|
-
});
|
97
|
-
// Handle end of input
|
98
|
-
rl.on("close", () => {
|
99
|
-
console.error("Input stream closed. Waiting for output to flush...");
|
100
|
-
// Add a delay before exiting to ensure all output is flushed
|
101
|
-
setTimeout(() => {
|
102
|
-
console.error("Exiting...");
|
103
|
-
process.exit(0);
|
104
|
-
}, 1000);
|
105
|
-
});
|
106
|
-
}
|
107
|
-
exports.main = main;
|
108
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources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Y,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AA/ED,oBA+EC"}
|
package/dist/cli/jsonrpc.d.ts
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* JSON-RPC 2.0 handler for MCP Documentation Service
|
3
|
-
*
|
4
|
-
* This module adds JSON-RPC 2.0 support to the MCP Documentation Service,
|
5
|
-
* allowing it to be used with Cursor and other MCP clients.
|
6
|
-
*/
|
7
|
-
interface JsonRpcSuccessResponse {
|
8
|
-
jsonrpc: string;
|
9
|
-
result: any;
|
10
|
-
id: number | string | null;
|
11
|
-
}
|
12
|
-
interface JsonRpcErrorResponse {
|
13
|
-
jsonrpc: string;
|
14
|
-
error: {
|
15
|
-
code: number;
|
16
|
-
message: string;
|
17
|
-
data?: any;
|
18
|
-
};
|
19
|
-
id: number | string | null;
|
20
|
-
}
|
21
|
-
type JsonRpcResponse = JsonRpcSuccessResponse | JsonRpcErrorResponse;
|
22
|
-
/**
|
23
|
-
* Process a JSON-RPC 2.0 request and return a response
|
24
|
-
*/
|
25
|
-
export declare function processJsonRpcRequest(requestStr: string, options: {
|
26
|
-
docsDir: string;
|
27
|
-
createIfNotExists: boolean;
|
28
|
-
}): Promise<JsonRpcResponse>;
|
29
|
-
export {};
|
package/dist/cli/jsonrpc.js
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* JSON-RPC 2.0 handler for MCP Documentation Service
|
4
|
-
*
|
5
|
-
* This module adds JSON-RPC 2.0 support to the MCP Documentation Service,
|
6
|
-
* allowing it to be used with Cursor and other MCP clients.
|
7
|
-
*/
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
-
exports.processJsonRpcRequest = void 0;
|
10
|
-
const index_js_1 = require("../index.js");
|
11
|
-
/**
|
12
|
-
* Process a JSON-RPC 2.0 request and return a response
|
13
|
-
*/
|
14
|
-
async function processJsonRpcRequest(requestStr, options) {
|
15
|
-
try {
|
16
|
-
// Parse the JSON-RPC request
|
17
|
-
const request = JSON.parse(requestStr);
|
18
|
-
// Validate the request
|
19
|
-
if (request.jsonrpc !== "2.0") {
|
20
|
-
return createErrorResponse(request.id, -32600, "Invalid Request: Not a valid JSON-RPC 2.0 request");
|
21
|
-
}
|
22
|
-
// Handle special MCP methods
|
23
|
-
if (request.method === "list_allowed_directories") {
|
24
|
-
return createSuccessResponse(request.id, [options.docsDir]);
|
25
|
-
}
|
26
|
-
// Translate JSON-RPC method and params to SQL-like query
|
27
|
-
const sqlQuery = translateToSqlQuery(request.method, request.params);
|
28
|
-
if (!sqlQuery) {
|
29
|
-
return createErrorResponse(request.id, -32601, `Method not found: ${request.method}`);
|
30
|
-
}
|
31
|
-
// Execute the query
|
32
|
-
const result = await (0, index_js_1.query)(sqlQuery, options);
|
33
|
-
// Translate the result to JSON-RPC response
|
34
|
-
if (result.success) {
|
35
|
-
return createSuccessResponse(request.id, result.data);
|
36
|
-
}
|
37
|
-
else {
|
38
|
-
return createErrorResponse(request.id, -32000, result.error || "Unknown error");
|
39
|
-
}
|
40
|
-
}
|
41
|
-
catch (error) {
|
42
|
-
console.error("Error processing JSON-RPC request:", error);
|
43
|
-
return createErrorResponse(null, -32700, error instanceof Error ? error.message : String(error));
|
44
|
-
}
|
45
|
-
}
|
46
|
-
exports.processJsonRpcRequest = processJsonRpcRequest;
|
47
|
-
/**
|
48
|
-
* Translate a JSON-RPC method and params to a SQL-like query
|
49
|
-
*/
|
50
|
-
function translateToSqlQuery(method, params) {
|
51
|
-
switch (method) {
|
52
|
-
case "list_files":
|
53
|
-
return "list_files()";
|
54
|
-
case "list_directories":
|
55
|
-
return "list_directories()";
|
56
|
-
case "get_document":
|
57
|
-
if (!params || !params.path) {
|
58
|
-
throw new Error("Invalid params: path is required");
|
59
|
-
}
|
60
|
-
return `get_document(path="${params.path}")`;
|
61
|
-
case "search_documents":
|
62
|
-
if (!params || !params.query) {
|
63
|
-
throw new Error("Invalid params: query is required");
|
64
|
-
}
|
65
|
-
return `search_documents(query="${params.query}")`;
|
66
|
-
case "create_document":
|
67
|
-
if (!params || !params.path || !params.content) {
|
68
|
-
throw new Error("Invalid params: path and content are required");
|
69
|
-
}
|
70
|
-
return `create_document(path="${params.path}", content="${escapeString(params.content)}")`;
|
71
|
-
case "update_document":
|
72
|
-
if (!params || !params.path || !params.content) {
|
73
|
-
throw new Error("Invalid params: path and content are required");
|
74
|
-
}
|
75
|
-
return `update_document(path="${params.path}", content="${escapeString(params.content)}")`;
|
76
|
-
case "delete_document":
|
77
|
-
if (!params || !params.path) {
|
78
|
-
throw new Error("Invalid params: path is required");
|
79
|
-
}
|
80
|
-
return `delete_document(path="${params.path}")`;
|
81
|
-
case "analyze_docs":
|
82
|
-
return "analyze_docs()";
|
83
|
-
case "get_health_score":
|
84
|
-
return "get_health_score()";
|
85
|
-
case "get_suggestions":
|
86
|
-
return "get_suggestions()";
|
87
|
-
default:
|
88
|
-
return null;
|
89
|
-
}
|
90
|
-
}
|
91
|
-
/**
|
92
|
-
* Create a JSON-RPC 2.0 success response
|
93
|
-
*/
|
94
|
-
function createSuccessResponse(id, result) {
|
95
|
-
return {
|
96
|
-
jsonrpc: "2.0",
|
97
|
-
result,
|
98
|
-
id,
|
99
|
-
};
|
100
|
-
}
|
101
|
-
/**
|
102
|
-
* Create a JSON-RPC 2.0 error response
|
103
|
-
*/
|
104
|
-
function createErrorResponse(id, code, message, data) {
|
105
|
-
return {
|
106
|
-
jsonrpc: "2.0",
|
107
|
-
error: {
|
108
|
-
code,
|
109
|
-
message,
|
110
|
-
data,
|
111
|
-
},
|
112
|
-
id,
|
113
|
-
};
|
114
|
-
}
|
115
|
-
/**
|
116
|
-
* Escape special characters in a string
|
117
|
-
*/
|
118
|
-
function escapeString(str) {
|
119
|
-
return str.replace(/"/g, '\\"').replace(/\n/g, "\\n");
|
120
|
-
}
|
121
|
-
//# sourceMappingURL=jsonrpc.js.map
|
package/dist/cli/jsonrpc.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"jsonrpc.js","sourceRoot":"","sources":["../../src/cli/jsonrpc.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,0CAAoC;AA8BpC;;GAEG;AACI,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,OAGC;IAED,IAAI;QACF,6BAA6B;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAmB,CAAC;QAEzD,uBAAuB;QACvB,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE;YAC7B,OAAO,mBAAmB,CACxB,OAAO,CAAC,EAAE,EACV,CAAC,KAAK,EACN,mDAAmD,CACpD,CAAC;SACH;QAED,6BAA6B;QAC7B,IAAI,OAAO,CAAC,MAAM,KAAK,0BAA0B,EAAE;YACjD,OAAO,qBAAqB,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;SAC7D;QAED,yDAAyD;QACzD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACrE,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,mBAAmB,CACxB,OAAO,CAAC,EAAE,EACV,CAAC,KAAK,EACN,qBAAqB,OAAO,CAAC,MAAM,EAAE,CACtC,CAAC;SACH;QAED,oBAAoB;QACpB,MAAM,MAAM,GAAG,MAAM,IAAA,gBAAK,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE9C,4CAA4C;QAC5C,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,OAAO,qBAAqB,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;SACvD;aAAM;YACL,OAAO,mBAAmB,CACxB,OAAO,CAAC,EAAE,EAC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AAI,CAAC,MAAM,CAAC,OAAO,EAAE;gBAC9C,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;aAClE;YACD,OAAO,yBAAyB,MAAM,CAAC,IAAI,eAAe,YAAY,CACpE,MAAM,CAAC,OAAO,CACf,IAAI,CAAC;QAER,KAAK,iBAAiB;YACpB,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC3B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;aACrD;YACD,OAAO,yBAAyB,MAAM,CAAC,IAAI,IAAI,CAAC;QAElD,KAAK,cAAc;YACjB,OAAO,gBAAgB,CAAC;QAE1B,KAAK,kBAAkB;YACrB,OAAO,oBAAoB,CAAC;QAE9B,KAAK,iBAAiB;YACpB,OAAO,mBAAmB,CAAC;QAE7B;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAC5B,EAA0B,EAC1B,MAAW;IAEX,OAAO;QACL,OAAO,EAAE,KAAK;QACd,MAAM;QACN,EAAE;KACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC1B,EAA0B,EAC1B,IAAY,EACZ,OAAe,EACf,IAAU;IAEV,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACL,IAAI;YACJ,OAAO;YACP,IAAI;SACL;QACD,EAAE;KACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Document Analyzer for generating insights about documentation
|
3
|
-
*/
|
4
|
-
import { DocAnalysisResult } from "../types/index.js";
|
5
|
-
import { DocManager } from "./docManager.js";
|
6
|
-
export declare class DocAnalyzer {
|
7
|
-
private docManager;
|
8
|
-
constructor(docManager: DocManager);
|
9
|
-
/**
|
10
|
-
* Analyze the documentation and generate insights
|
11
|
-
*/
|
12
|
-
analyzeDocumentation(directory?: string): Promise<DocAnalysisResult>;
|
13
|
-
/**
|
14
|
-
* Find documentation gaps (directories with few or no documents)
|
15
|
-
*/
|
16
|
-
findDocumentationGaps(): Promise<Record<string, number>>;
|
17
|
-
/**
|
18
|
-
* Calculate overall documentation health score (0-100)
|
19
|
-
*/
|
20
|
-
calculateHealthScore(): Promise<number>;
|
21
|
-
/**
|
22
|
-
* Generate suggestions for improving documentation
|
23
|
-
*/
|
24
|
-
generateSuggestions(): Promise<string[]>;
|
25
|
-
}
|