mcp-docs-service 0.2.17 → 0.3.1
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 +38 -189
- 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,250 +1,99 @@
|
|
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
|
-
|
25
|
+
## Usage
|
75
26
|
|
76
|
-
|
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
|
82
|
-
|
83
|
-
## Health Check
|
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
|
30
|
+
# Use with default docs directory (./docs)
|
31
|
+
mcp-docs-service
|
103
32
|
|
104
|
-
|
105
|
-
|
106
|
-
## Integration
|
107
|
-
|
108
|
-
### With Cursor IDE
|
109
|
-
|
110
|
-
Add this to your `.cursor/mcp.json` file:
|
111
|
-
|
112
|
-
```json
|
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
|
{
|
142
49
|
"mcpServers": {
|
143
50
|
"docs-manager": {
|
144
51
|
"command": "npx",
|
145
|
-
"args": ["-y", "mcp-docs-service"]
|
52
|
+
"args": ["-y", "mcp-docs-service", "./docs"]
|
146
53
|
}
|
147
54
|
}
|
148
55
|
}
|
149
56
|
```
|
150
57
|
|
151
|
-
|
58
|
+
This configuration specifies the `docs` directory in your project root. The docs directory path is provided directly as an argument, similar to how the filesystem MCP server works.
|
59
|
+
|
60
|
+
For a custom docs directory:
|
152
61
|
|
153
62
|
```json
|
154
63
|
{
|
155
64
|
"mcpServers": {
|
156
65
|
"docs-manager": {
|
157
66
|
"command": "npx",
|
158
|
-
"args": [
|
159
|
-
"-y",
|
160
|
-
"mcp-docs-service",
|
161
|
-
"--docs-dir",
|
162
|
-
"./my-custom-docs",
|
163
|
-
"--create-dir"
|
164
|
-
]
|
67
|
+
"args": ["-y", "mcp-docs-service", "./my-custom-docs"]
|
165
68
|
}
|
166
69
|
}
|
167
70
|
}
|
168
71
|
```
|
169
72
|
|
170
|
-
##
|
73
|
+
## Available Tools
|
171
74
|
|
172
|
-
|
75
|
+
The service provides the following tools:
|
173
76
|
|
174
|
-
|
175
|
-
|
77
|
+
- `read_document`: Read a markdown document
|
78
|
+
- `write_document`: Create or overwrite a document
|
79
|
+
- `edit_document`: Make precise edits to a document
|
80
|
+
- `list_documents`: List all documents in a directory
|
81
|
+
- `search_documents`: Find documents containing specific text
|
82
|
+
- `generate_navigation`: Create a navigation structure
|
83
|
+
- `check_documentation_health`: Analyze documentation quality
|
176
84
|
|
177
|
-
|
178
|
-
const server = new MCPDocsServer("./docs");
|
85
|
+
## Example
|
179
86
|
|
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
|
-
});
|
87
|
+
Using with Claude in Cursor:
|
185
88
|
|
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
|
-
}
|
195
|
-
|
196
|
-
example();
|
197
|
-
```
|
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();
|
218
89
|
```
|
219
|
-
|
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")
|
90
|
+
@docs-manager read_document path=README.md
|
226
91
|
```
|
227
92
|
|
228
|
-
For example:
|
229
|
-
|
230
93
|
```
|
231
|
-
|
94
|
+
@docs-manager edit_document path=README.md edits=[{"oldText":"# Documentation", "newText":"# Project Documentation"}]
|
232
95
|
```
|
233
96
|
|
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
|
-
|
248
97
|
## License
|
249
98
|
|
250
99
|
MIT
|