mcp-docs-service 0.3.5 → 0.3.7
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/cursor-wrapper.cjs +111 -0
- package/dist/index.js +27 -13
- package/package.json +5 -3
- package/dist/cli/bin.d.ts +0 -8
- package/dist/cli/bin.js +0 -133
- package/dist/cli/bin.js.map +0 -1
- package/dist/handlers/docs.d.ts +0 -26
- package/dist/handlers/docs.js +0 -513
- package/dist/handlers/docs.js.map +0 -1
- package/dist/handlers/file.d.ts +0 -32
- package/dist/handlers/file.js +0 -222
- package/dist/handlers/file.js.map +0 -1
- package/dist/handlers/index.d.ts +0 -1
- package/dist/handlers/index.js +0 -3
- package/dist/handlers/index.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.js +0 -3
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/tools.d.ts +0 -164
- package/dist/schemas/tools.js +0 -53
- package/dist/schemas/tools.js.map +0 -1
- package/dist/types/docs.d.ts +0 -74
- package/dist/types/docs.js +0 -2
- package/dist/types/docs.js.map +0 -1
- package/dist/types/file.d.ts +0 -21
- package/dist/types/file.js +0 -2
- package/dist/types/file.js.map +0 -1
- package/dist/types/index.d.ts +0 -44
- package/dist/types/index.js +0 -4
- package/dist/types/index.js.map +0 -1
- package/dist/types/tools.d.ts +0 -11
- package/dist/types/tools.js +0 -2
- package/dist/types/tools.js.map +0 -1
- package/dist/utils/file.d.ts +0 -24
- package/dist/utils/file.js +0 -94
- package/dist/utils/file.js.map +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -3
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/path.d.ts +0 -16
- package/dist/utils/path.js +0 -70
- package/dist/utils/path.js.map +0 -1
@@ -0,0 +1,111 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
/**
|
4
|
+
* MCP Cursor Wrapper
|
5
|
+
*
|
6
|
+
* This script is a wrapper for the MCP Docs Service that ensures proper stdio handling for Cursor.
|
7
|
+
* It redirects all console.log output to stderr to avoid interfering with the JSON communication.
|
8
|
+
*/
|
9
|
+
|
10
|
+
const { spawn } = require("child_process");
|
11
|
+
const path = require("path");
|
12
|
+
const fs = require("fs");
|
13
|
+
|
14
|
+
// Create a debug log file
|
15
|
+
const logDir = path.join(
|
16
|
+
process.env.HOME || process.env.USERPROFILE,
|
17
|
+
".mcp-docs-service"
|
18
|
+
);
|
19
|
+
try {
|
20
|
+
if (!fs.existsSync(logDir)) {
|
21
|
+
fs.mkdirSync(logDir, { recursive: true });
|
22
|
+
}
|
23
|
+
} catch (err) {
|
24
|
+
// Ignore errors creating log directory
|
25
|
+
}
|
26
|
+
|
27
|
+
const logFile = path.join(logDir, "cursor-debug.log");
|
28
|
+
try {
|
29
|
+
fs.writeFileSync(
|
30
|
+
logFile,
|
31
|
+
`MCP Cursor Wrapper called at ${new Date().toISOString()}\n`
|
32
|
+
);
|
33
|
+
} catch (err) {
|
34
|
+
// Ignore errors writing to log file
|
35
|
+
}
|
36
|
+
|
37
|
+
// Helper function to log to the file
|
38
|
+
const logToFile = (message) => {
|
39
|
+
try {
|
40
|
+
fs.appendFileSync(logFile, `${message}\n`);
|
41
|
+
} catch (err) {
|
42
|
+
// Ignore errors writing to log file
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
46
|
+
// Log debug information
|
47
|
+
logToFile(`Process arguments: ${JSON.stringify(process.argv)}`);
|
48
|
+
logToFile(`Working directory: ${process.cwd()}`);
|
49
|
+
logToFile(`Script directory: ${__dirname}`);
|
50
|
+
|
51
|
+
// Find the path to the actual service script
|
52
|
+
const servicePath = path.resolve(path.join(__dirname, "dist", "index.js"));
|
53
|
+
logToFile(`Service path: ${servicePath}`);
|
54
|
+
|
55
|
+
// Check if the service script exists
|
56
|
+
if (!fs.existsSync(servicePath)) {
|
57
|
+
logToFile(`ERROR: Service script not found at ${servicePath}`);
|
58
|
+
console.error(`ERROR: Service script not found at ${servicePath}`);
|
59
|
+
process.exit(1);
|
60
|
+
}
|
61
|
+
|
62
|
+
// Get command line arguments, skipping the first two (node and script path)
|
63
|
+
const args = process.argv.slice(2);
|
64
|
+
logToFile(`Command line arguments: ${JSON.stringify(args)}`);
|
65
|
+
|
66
|
+
// Set environment variables
|
67
|
+
const env = {
|
68
|
+
...process.env,
|
69
|
+
MCP_CURSOR_WRAPPER: "true",
|
70
|
+
// Redirect console.log to stderr
|
71
|
+
NODE_OPTIONS: `${process.env.NODE_OPTIONS || ""} --redirect-warnings=stderr`,
|
72
|
+
};
|
73
|
+
|
74
|
+
// Create a child process with piped stdio
|
75
|
+
// This is critical for Cursor - we need to control stdin/stdout directly
|
76
|
+
const child = spawn("node", [servicePath, ...args], {
|
77
|
+
stdio: ["pipe", "pipe", "pipe"],
|
78
|
+
env,
|
79
|
+
});
|
80
|
+
|
81
|
+
// Redirect child's stderr to our stderr
|
82
|
+
child.stderr.on("data", (data) => {
|
83
|
+
process.stderr.write(data);
|
84
|
+
|
85
|
+
// Also log to file for debugging
|
86
|
+
try {
|
87
|
+
logToFile(`STDERR: ${data.toString()}`);
|
88
|
+
} catch (err) {
|
89
|
+
// Ignore errors
|
90
|
+
}
|
91
|
+
});
|
92
|
+
|
93
|
+
// Pipe our stdin directly to child's stdin
|
94
|
+
process.stdin.pipe(child.stdin);
|
95
|
+
|
96
|
+
// Pipe child's stdout directly to our stdout
|
97
|
+
// This is the critical part - we don't want to modify the JSON communication
|
98
|
+
child.stdout.pipe(process.stdout);
|
99
|
+
|
100
|
+
// Handle process exit
|
101
|
+
child.on("exit", (code) => {
|
102
|
+
logToFile(`Child process exited with code ${code}`);
|
103
|
+
process.exit(code || 0);
|
104
|
+
});
|
105
|
+
|
106
|
+
// Handle errors
|
107
|
+
child.on("error", (err) => {
|
108
|
+
logToFile(`Error spawning child process: ${err.message}`);
|
109
|
+
console.error(`Error spawning MCP Docs Service: ${err.message}`);
|
110
|
+
process.exit(1);
|
111
|
+
});
|
package/dist/index.js
CHANGED
@@ -15,6 +15,20 @@ import { z } from "zod";
|
|
15
15
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
16
16
|
import { createTwoFilesPatch } from "diff";
|
17
17
|
import { glob } from "glob";
|
18
|
+
// Setup logging to avoid interfering with MCP protocol
|
19
|
+
// When running under Cursor, we need to redirect console.log to stderr
|
20
|
+
const isCursorWrapper = process.env.MCP_CURSOR_WRAPPER === "true";
|
21
|
+
const isInspector = process.env.MCP_INSPECTOR === "true";
|
22
|
+
// Create a safe logging function that won't interfere with MCP protocol
|
23
|
+
const safeLog = (...args) => {
|
24
|
+
// When running under Cursor, redirect all logs to stderr
|
25
|
+
if (isCursorWrapper) {
|
26
|
+
console.error(...args);
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
console.log(...args);
|
30
|
+
}
|
31
|
+
};
|
18
32
|
// Command line argument parsing
|
19
33
|
const args = process.argv.slice(2);
|
20
34
|
let docsDir = path.join(process.cwd(), "docs");
|
@@ -42,7 +56,7 @@ docsDir = path.normalize(docsDir);
|
|
42
56
|
try {
|
43
57
|
const stats = await fs.stat(docsDir);
|
44
58
|
if (!stats.isDirectory()) {
|
45
|
-
|
59
|
+
safeLog(`Error: ${docsDir} is not a directory`);
|
46
60
|
process.exit(1);
|
47
61
|
}
|
48
62
|
}
|
@@ -51,7 +65,7 @@ catch (error) {
|
|
51
65
|
if (createDir) {
|
52
66
|
try {
|
53
67
|
await fs.mkdir(docsDir, { recursive: true });
|
54
|
-
|
68
|
+
safeLog(`Created docs directory: ${docsDir}`);
|
55
69
|
// Create a sample README.md
|
56
70
|
const readmePath = path.join(docsDir, "README.md");
|
57
71
|
try {
|
@@ -68,22 +82,22 @@ description: Project documentation
|
|
68
82
|
This is the documentation directory for your project.
|
69
83
|
`;
|
70
84
|
await fs.writeFile(readmePath, content);
|
71
|
-
|
85
|
+
safeLog(`Created sample README.md in ${docsDir}`);
|
72
86
|
}
|
73
87
|
}
|
74
88
|
catch (error) {
|
75
|
-
|
89
|
+
safeLog(`Error creating docs directory: ${error}`);
|
76
90
|
process.exit(1);
|
77
91
|
}
|
78
92
|
}
|
79
93
|
else {
|
80
|
-
|
81
|
-
|
94
|
+
safeLog(`Error: Docs directory does not exist: ${docsDir}`);
|
95
|
+
safeLog(`Use --create-dir to create it automatically`);
|
82
96
|
process.exit(1);
|
83
97
|
}
|
84
98
|
}
|
85
|
-
|
86
|
-
|
99
|
+
safeLog("MCP Documentation Service initialized with docs directory:", docsDir);
|
100
|
+
safeLog("Directory will be created if it doesn't exist");
|
87
101
|
// Schema definitions
|
88
102
|
const ReadDocumentArgsSchema = z.object({
|
89
103
|
path: z
|
@@ -438,7 +452,7 @@ async function checkDocumentationHealth(basePath) {
|
|
438
452
|
// Server setup
|
439
453
|
const server = new Server({
|
440
454
|
name: "mcp-docs-service",
|
441
|
-
version: "0.3.
|
455
|
+
version: "0.3.7",
|
442
456
|
}, {
|
443
457
|
capabilities: {
|
444
458
|
tools: {},
|
@@ -670,11 +684,11 @@ if (runHealthCheck) {
|
|
670
684
|
async function runServer() {
|
671
685
|
const transport = new StdioServerTransport();
|
672
686
|
await server.connect(transport);
|
673
|
-
|
674
|
-
|
675
|
-
|
687
|
+
safeLog("MCP Documentation Management Service started.");
|
688
|
+
safeLog("Using docs directory:", docsDir);
|
689
|
+
safeLog("Reading from stdin, writing results to stdout...");
|
676
690
|
}
|
677
691
|
runServer().catch((error) => {
|
678
|
-
|
692
|
+
safeLog("Fatal error running server:", error);
|
679
693
|
process.exit(1);
|
680
694
|
});
|
package/package.json
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "mcp-docs-service",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.7",
|
4
4
|
"description": "MCP Documentation Service - A Model Context Protocol implementation for documentation management",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.js",
|
7
7
|
"bin": {
|
8
|
-
"mcp-docs-service": "dist/index.js"
|
8
|
+
"mcp-docs-service": "dist/index.js",
|
9
|
+
"mcp-docs-service-cursor": "cursor-wrapper.cjs"
|
9
10
|
},
|
10
11
|
"files": [
|
11
12
|
"dist",
|
12
13
|
"README.md",
|
13
|
-
"LICENSE"
|
14
|
+
"LICENSE",
|
15
|
+
"cursor-wrapper.cjs"
|
14
16
|
],
|
15
17
|
"scripts": {
|
16
18
|
"build": "tsc",
|
package/dist/cli/bin.d.ts
DELETED
package/dist/cli/bin.js
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
/**
|
3
|
-
* MCP Docs Service CLI
|
4
|
-
*
|
5
|
-
* This is the entry point for the CLI version of the MCP Docs Service.
|
6
|
-
* It simply imports and runs the main service.
|
7
|
-
*/
|
8
|
-
import path from "path";
|
9
|
-
import fs from "fs";
|
10
|
-
import { fileURLToPath } from "url";
|
11
|
-
// Get the current directory
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
13
|
-
const __dirname = path.dirname(__filename);
|
14
|
-
// Check if we're running under MCP Inspector
|
15
|
-
const isMCPInspector = process.env.MCP_INSPECTOR === "true" ||
|
16
|
-
process.argv.some((arg) => arg.includes("modelcontextprotocol/inspector"));
|
17
|
-
// Create a logging function that respects MCP Inspector mode
|
18
|
-
const log = (...args) => {
|
19
|
-
if (!isMCPInspector) {
|
20
|
-
console.log(...args);
|
21
|
-
}
|
22
|
-
};
|
23
|
-
const errorLog = (...args) => {
|
24
|
-
console.error(...args);
|
25
|
-
};
|
26
|
-
// Parse command line arguments
|
27
|
-
const args = process.argv.slice(2);
|
28
|
-
log("CLI Arguments:", JSON.stringify(args));
|
29
|
-
let docsDir = path.join(process.cwd(), "docs");
|
30
|
-
let createDir = false;
|
31
|
-
let healthCheck = false;
|
32
|
-
let showHelp = false;
|
33
|
-
// MCP Inspector specific handling
|
34
|
-
// When run through MCP Inspector, it might pass arguments in a different format
|
35
|
-
if (isMCPInspector) {
|
36
|
-
log("Detected MCP Inspector environment");
|
37
|
-
// Try to find a valid docs directory in all arguments
|
38
|
-
// This is a more aggressive approach but should work with various argument formats
|
39
|
-
for (const arg of process.argv) {
|
40
|
-
if (arg.endsWith("/docs") || arg.includes("/docs ")) {
|
41
|
-
const potentialPath = arg.split(" ")[0];
|
42
|
-
log("Found potential docs path in MCP Inspector args:", potentialPath);
|
43
|
-
if (fs.existsSync(potentialPath)) {
|
44
|
-
docsDir = path.resolve(potentialPath);
|
45
|
-
log("Using docs directory from MCP Inspector:", docsDir);
|
46
|
-
break;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
// If we couldn't find a valid docs directory, use the default
|
51
|
-
log("Using docs directory:", docsDir);
|
52
|
-
}
|
53
|
-
else {
|
54
|
-
// Standard argument parsing
|
55
|
-
for (let i = 0; i < args.length; i++) {
|
56
|
-
log(`Processing arg[${i}]:`, args[i]);
|
57
|
-
if (args[i] === "--docs-dir" && i + 1 < args.length) {
|
58
|
-
docsDir = path.resolve(args[i + 1]);
|
59
|
-
log("Setting docs dir from --docs-dir flag:", docsDir);
|
60
|
-
i++; // Skip the next argument
|
61
|
-
}
|
62
|
-
else if (args[i] === "--create-dir") {
|
63
|
-
createDir = true;
|
64
|
-
}
|
65
|
-
else if (args[i] === "--health-check") {
|
66
|
-
healthCheck = true;
|
67
|
-
}
|
68
|
-
else if (args[i] === "--help" || args[i] === "-h") {
|
69
|
-
showHelp = true;
|
70
|
-
}
|
71
|
-
else if (!args[i].startsWith("--")) {
|
72
|
-
// Handle positional argument as docs directory
|
73
|
-
const potentialPath = path.resolve(args[i]);
|
74
|
-
log("Potential positional path:", potentialPath);
|
75
|
-
log("Path exists?", fs.existsSync(potentialPath));
|
76
|
-
if (fs.existsSync(potentialPath)) {
|
77
|
-
docsDir = potentialPath;
|
78
|
-
log("Setting docs dir from positional argument:", docsDir);
|
79
|
-
}
|
80
|
-
else {
|
81
|
-
log("Path doesn't exist, not using as docs dir:", potentialPath);
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
log("Final docs dir:", docsDir);
|
87
|
-
// Show help if requested
|
88
|
-
if (showHelp) {
|
89
|
-
console.log(`
|
90
|
-
MCP Docs Service - Documentation Management Service
|
91
|
-
|
92
|
-
Usage:
|
93
|
-
mcp-docs-service [options]
|
94
|
-
mcp-docs-service <docs-directory> [options]
|
95
|
-
|
96
|
-
Options:
|
97
|
-
--docs-dir <path> Specify the docs directory (default: ./docs)
|
98
|
-
--create-dir Create the docs directory if it doesn't exist
|
99
|
-
--health-check Run a health check on the documentation
|
100
|
-
--help, -h Show this help message
|
101
|
-
`);
|
102
|
-
process.exit(0);
|
103
|
-
}
|
104
|
-
// Create docs directory if it doesn't exist and --create-dir is specified
|
105
|
-
if (createDir) {
|
106
|
-
try {
|
107
|
-
if (!fs.existsSync(docsDir)) {
|
108
|
-
fs.mkdirSync(docsDir, { recursive: true });
|
109
|
-
log(`Created docs directory: ${docsDir}`);
|
110
|
-
}
|
111
|
-
}
|
112
|
-
catch (error) {
|
113
|
-
errorLog(`Error creating docs directory: ${error}`);
|
114
|
-
process.exit(1);
|
115
|
-
}
|
116
|
-
}
|
117
|
-
// Ensure the docs directory exists
|
118
|
-
if (!fs.existsSync(docsDir)) {
|
119
|
-
errorLog(`Error: Docs directory does not exist: ${docsDir}`);
|
120
|
-
errorLog(`Use --create-dir to create it automatically`);
|
121
|
-
process.exit(1);
|
122
|
-
}
|
123
|
-
// Add the docs directory to process.argv so it's available to the main service
|
124
|
-
process.argv.push(docsDir);
|
125
|
-
// Add health check flag to process.argv if specified
|
126
|
-
if (healthCheck) {
|
127
|
-
process.argv.push("--health-check");
|
128
|
-
}
|
129
|
-
// Import the main service
|
130
|
-
import "../index.js";
|
131
|
-
// The main service will handle the CLI arguments and execution
|
132
|
-
// No additional code needed here as the main index.ts already has CLI functionality
|
133
|
-
//# sourceMappingURL=bin.js.map
|
package/dist/cli/bin.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"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,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3C,GAAG,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,mCAAmC;AACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;IAC7D,QAAQ,CAAC,6CAA6C,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,+EAA+E;AAC/E,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE3B,qDAAqD;AACrD,IAAI,WAAW,EAAE,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC;AAED,0BAA0B;AAC1B,OAAO,aAAa,CAAC;AAErB,+DAA+D;AAC/D,oFAAoF"}
|
package/dist/handlers/docs.d.ts
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
import { ToolResponse } from "../types/tools.js";
|
2
|
-
/**
|
3
|
-
* Reads a markdown document and extracts its content and metadata
|
4
|
-
*/
|
5
|
-
export declare function readDocument(docPath: string, allowedDirectories: string[]): Promise<ToolResponse>;
|
6
|
-
/**
|
7
|
-
* Lists all markdown documents in a directory
|
8
|
-
*/
|
9
|
-
export declare function listDocuments(basePath: string, allowedDirectories: string[]): Promise<ToolResponse>;
|
10
|
-
/**
|
11
|
-
* Gets the structure of the documentation directory
|
12
|
-
*/
|
13
|
-
export declare function getStructure(basePath: string, allowedDirectories: string[]): Promise<ToolResponse>;
|
14
|
-
/**
|
15
|
-
* Gets the navigation structure for the documentation
|
16
|
-
*/
|
17
|
-
export declare function getNavigation(basePath: string, allowedDirectories: string[]): Promise<ToolResponse>;
|
18
|
-
/**
|
19
|
-
* Checks the health of documentation
|
20
|
-
*/
|
21
|
-
export declare function checkDocumentationHealth(basePath: string, options: {
|
22
|
-
checkLinks?: boolean;
|
23
|
-
checkMetadata?: boolean;
|
24
|
-
checkOrphans?: boolean;
|
25
|
-
requiredMetadataFields?: string[];
|
26
|
-
}, allowedDirectories: string[]): Promise<ToolResponse>;
|