mcp-docs-service 0.2.17 → 0.3.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 +33 -199
- package/dist/index.d.ts +6 -0
- package/dist/index.js +640 -591
- package/dist/index.js.map +1 -1
- package/package.json +32 -46
- package/CHANGELOG.md +0 -188
- package/cursor-wrapper.js +0 -199
- 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
- package/mcp-inspector-wrapper.js +0 -208
- package/npx-standalone.cjs +0 -216
- package/npx-wrapper.js +0 -119
package/README.md
CHANGED
@@ -1,141 +1,48 @@
|
|
1
1
|
# MCP Documentation Service
|
2
2
|
|
3
|
-
|
3
|
+
A Model Context Protocol (MCP) implementation for documentation management. This service provides tools for reading, writing, and managing markdown documentation.
|
4
4
|
|
5
5
|
## Features
|
6
6
|
|
7
|
-
- **
|
8
|
-
- **
|
9
|
-
- **Search**:
|
10
|
-
- **
|
11
|
-
- **
|
12
|
-
- **Navigation Generation**: Generate navigation structures for documentation
|
13
|
-
- **Tag Management**: Organize documentation by tags and categories
|
14
|
-
- **Health Check**: Analyze documentation health and get suggestions for improvement
|
15
|
-
- **Custom Directory Support**: Specify a custom docs directory and create it if it doesn't exist
|
16
|
-
|
17
|
-
## Documentation
|
18
|
-
|
19
|
-
Comprehensive documentation is available in the `docs` directory:
|
20
|
-
|
21
|
-
- [Getting Started Guide](docs/guides/getting-started.md) - Introduction to the MCP Docs Manager
|
22
|
-
- [API Overview](docs/api/overview.md) - Overview of the API and available tools
|
23
|
-
- [Tools Reference](docs/api/tools-reference.md) - Complete reference of all available tools
|
24
|
-
- [Features Overview](docs/features.md) - Comprehensive overview of all features
|
25
|
-
- [Health Check Guide](docs/guides/health-check.md) - Guide for checking documentation health
|
26
|
-
- [Basic Usage Tutorial](docs/tutorials/basic-usage.md) - Tutorial for basic usage
|
27
|
-
- [Examples](docs/examples/) - Code examples for common tasks
|
28
|
-
- [Navigation Generator](docs/examples/navigation-generator.md) - Example of how to generate navigation for documentation
|
29
|
-
- [Knowledge Base Generator](docs/examples/knowledge-base-generator.md) - Example of how to generate a knowledge base for LLM context
|
30
|
-
- [Roadmap](docs/roadmap.md) - Development roadmap and planned features
|
7
|
+
- **Read and Write Documents**: Easily read and write markdown documents with frontmatter
|
8
|
+
- **Edit Documents**: Make precise edits to documents with diff previews
|
9
|
+
- **List and Search**: Find documents by content or metadata
|
10
|
+
- **Navigation Generation**: Create navigation structures from your documentation
|
11
|
+
- **Health Checks**: Analyze documentation quality and identify issues
|
31
12
|
|
32
13
|
## Installation
|
33
14
|
|
34
|
-
### Via npx (Recommended)
|
35
|
-
|
36
|
-
The easiest way to use MCP Documentation Service is through npx:
|
37
|
-
|
38
|
-
```bash
|
39
|
-
# Use default docs directory (./docs)
|
40
|
-
npx mcp-docs-service
|
41
|
-
|
42
|
-
# Specify a custom docs directory
|
43
|
-
npx mcp-docs-service --docs-dir ./my-custom-docs
|
44
|
-
|
45
|
-
# Create the directory if it doesn't exist
|
46
|
-
npx mcp-docs-service --docs-dir ./my-custom-docs --create-dir
|
47
|
-
|
48
|
-
# Run a health check on your documentation
|
49
|
-
npx mcp-docs-service --health-check
|
50
|
-
|
51
|
-
# Show help
|
52
|
-
npx mcp-docs-service --help
|
53
|
-
```
|
54
|
-
|
55
|
-
### Global Installation
|
56
|
-
|
57
|
-
You can also install it globally:
|
58
|
-
|
59
15
|
```bash
|
60
16
|
npm install -g mcp-docs-service
|
61
|
-
|
62
|
-
# Then use it with the same options as npx
|
63
|
-
mcp-docs-service --docs-dir ./my-custom-docs --create-dir
|
64
17
|
```
|
65
18
|
|
66
|
-
|
67
|
-
|
68
|
-
If you prefer to install it locally in your project:
|
19
|
+
Or use directly with npx:
|
69
20
|
|
70
21
|
```bash
|
71
|
-
|
22
|
+
npx mcp-docs-service
|
72
23
|
```
|
73
24
|
|
74
|
-
|
75
|
-
|
76
|
-
The MCP Documentation Service supports the following command-line options:
|
77
|
-
|
78
|
-
- `--docs-dir <path>`: Specify the docs directory (default: ./docs)
|
79
|
-
- `--create-dir`: Create the docs directory if it doesn't exist
|
80
|
-
- `--health-check`: Run a health check on the documentation
|
81
|
-
- `--help`, `-h`: Show help message
|
25
|
+
## Usage
|
82
26
|
|
83
|
-
|
84
|
-
|
85
|
-
The MCP Documentation Service includes a health check feature that analyzes your documentation and provides insights into its quality, completeness, and structure.
|
86
|
-
|
87
|
-
To run a health check:
|
27
|
+
### Command Line
|
88
28
|
|
89
29
|
```bash
|
90
|
-
#
|
91
|
-
|
92
|
-
|
93
|
-
# Or using the npm script
|
94
|
-
npm run health-check
|
95
|
-
```
|
96
|
-
|
97
|
-
The health check analyzes:
|
98
|
-
|
99
|
-
- Metadata completeness
|
100
|
-
- Broken links
|
101
|
-
- Document status distribution
|
102
|
-
- Tag usage
|
103
|
-
|
104
|
-
For more details, see the [Health Check Guide](docs/guides/health-check.md).
|
105
|
-
|
106
|
-
## Integration
|
107
|
-
|
108
|
-
### With Cursor IDE
|
109
|
-
|
110
|
-
Add this to your `.cursor/mcp.json` file:
|
30
|
+
# Use with default docs directory (./docs)
|
31
|
+
mcp-docs-service
|
111
32
|
|
112
|
-
|
113
|
-
|
114
|
-
"mcpServers": {
|
115
|
-
"docs-manager": {
|
116
|
-
"command": "npx",
|
117
|
-
"args": ["-y", "mcp-docs-service"]
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}
|
121
|
-
```
|
33
|
+
# Specify a custom docs directory
|
34
|
+
mcp-docs-service /path/to/docs
|
122
35
|
|
123
|
-
|
36
|
+
# Create docs directory if it doesn't exist
|
37
|
+
mcp-docs-service --create-dir
|
124
38
|
|
125
|
-
|
126
|
-
|
127
|
-
"mcpServers": {
|
128
|
-
"docs-manager": {
|
129
|
-
"command": "npx",
|
130
|
-
"args": ["-y", "mcp-docs-service", "./my-custom-docs", "--create-dir"]
|
131
|
-
}
|
132
|
-
}
|
133
|
-
}
|
39
|
+
# Run a health check on your documentation
|
40
|
+
mcp-docs-service --health-check
|
134
41
|
```
|
135
42
|
|
136
|
-
###
|
43
|
+
### Cursor Integration
|
137
44
|
|
138
|
-
|
45
|
+
To use with Cursor, create a `.cursor/mcp.json` file with:
|
139
46
|
|
140
47
|
```json
|
141
48
|
{
|
@@ -148,102 +55,29 @@ Add this to your `claude_desktop_config.json` file:
|
|
148
55
|
}
|
149
56
|
```
|
150
57
|
|
151
|
-
|
152
|
-
|
153
|
-
```json
|
154
|
-
{
|
155
|
-
"mcpServers": {
|
156
|
-
"docs-manager": {
|
157
|
-
"command": "npx",
|
158
|
-
"args": [
|
159
|
-
"-y",
|
160
|
-
"mcp-docs-service",
|
161
|
-
"--docs-dir",
|
162
|
-
"./my-custom-docs",
|
163
|
-
"--create-dir"
|
164
|
-
]
|
165
|
-
}
|
166
|
-
}
|
167
|
-
}
|
168
|
-
```
|
169
|
-
|
170
|
-
## Programmatic Usage
|
58
|
+
## Available Tools
|
171
59
|
|
172
|
-
|
60
|
+
The service provides the following tools:
|
173
61
|
|
174
|
-
|
175
|
-
|
62
|
+
- `read_document`: Read a markdown document
|
63
|
+
- `write_document`: Create or overwrite a document
|
64
|
+
- `edit_document`: Make precise edits to a document
|
65
|
+
- `list_documents`: List all documents in a directory
|
66
|
+
- `search_documents`: Find documents containing specific text
|
67
|
+
- `generate_navigation`: Create a navigation structure
|
68
|
+
- `check_documentation_health`: Analyze documentation quality
|
176
69
|
|
177
|
-
|
178
|
-
const server = new MCPDocsServer("./docs");
|
70
|
+
## Example
|
179
71
|
|
180
|
-
|
181
|
-
const customServer = new MCPDocsServer("./my-custom-docs", {
|
182
|
-
createIfNotExists: true, // Create the directory if it doesn't exist
|
183
|
-
fileExtensions: [".md", ".mdx"], // Specify file extensions to consider (optional)
|
184
|
-
});
|
185
|
-
|
186
|
-
// Execute a query
|
187
|
-
async function example() {
|
188
|
-
try {
|
189
|
-
const result = await server.executeQuery("list_files");
|
190
|
-
console.log(result);
|
191
|
-
} catch (error) {
|
192
|
-
console.error(error);
|
193
|
-
}
|
194
|
-
}
|
72
|
+
Using with Claude in Cursor:
|
195
73
|
|
196
|
-
example();
|
197
74
|
```
|
198
|
-
|
199
|
-
You can also use the query function directly:
|
200
|
-
|
201
|
-
```javascript
|
202
|
-
const { query } = require("mcp-docs-service");
|
203
|
-
|
204
|
-
// Execute a query with a custom docs directory
|
205
|
-
async function example() {
|
206
|
-
try {
|
207
|
-
const result = await query("list_files", {
|
208
|
-
docsDir: "./my-custom-docs",
|
209
|
-
createIfNotExists: true,
|
210
|
-
});
|
211
|
-
console.log(result);
|
212
|
-
} catch (error) {
|
213
|
-
console.error(error);
|
214
|
-
}
|
215
|
-
}
|
216
|
-
|
217
|
-
example();
|
75
|
+
@docs-manager read_document path=README.md
|
218
76
|
```
|
219
77
|
|
220
|
-
## Query Format
|
221
|
-
|
222
|
-
The service uses a SQL-like query format to execute commands:
|
223
|
-
|
224
|
-
```
|
225
|
-
command_name(param1="value1", param2="value2")
|
226
78
|
```
|
227
|
-
|
228
|
-
For example:
|
229
|
-
|
79
|
+
@docs-manager edit_document path=README.md edits=[{"oldText":"# Documentation", "newText":"# Project Documentation"}]
|
230
80
|
```
|
231
|
-
get_document(path="architecture/overview.md")
|
232
|
-
```
|
233
|
-
|
234
|
-
## Available Commands
|
235
|
-
|
236
|
-
### Documentation Tools
|
237
|
-
|
238
|
-
- **read_document(path="path/to/doc.md")**: Read a markdown document and extract its content and metadata
|
239
|
-
- **list_documents(basePath="")**: List all markdown documents in a directory
|
240
|
-
- **get_structure(basePath="")**: Get the structure of the documentation directory
|
241
|
-
- **get_navigation(basePath="")**: Get the navigation structure for the documentation
|
242
|
-
- **get_docs_knowledge_base(basePath="", includeSummaries=true, maxSummaryLength=500)**: Create a comprehensive knowledge base of documentation for LLM context
|
243
|
-
- **write_document(path="path/to/doc.md", content="content", metadata={...})**: Write content to a markdown document with frontmatter
|
244
|
-
- **edit_document(path="path/to/doc.md", edits=[{oldText: "...", newText: "..."}])**: Apply edits to a markdown document while preserving frontmatter
|
245
|
-
- **delete_document(path="path/to/doc.md")**: Delete a markdown document
|
246
|
-
- **search_documents(basePath="", query="search term", tags=["tag1"], status="published")**: Search for markdown documents matching criteria
|
247
81
|
|
248
82
|
## License
|
249
83
|
|