mcp-docs-service 7.1.0 → 7.2.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 +88 -121
- package/package.json +1 -1
package/README.md
CHANGED
@@ -8,33 +8,44 @@
|
|
8
8
|
|
9
9
|
## What is it?
|
10
10
|
|
11
|
-
MCP Documentation Service is a Model Context Protocol (MCP) implementation for documentation management. It provides
|
11
|
+
MCP Documentation Service is a Model Context Protocol (MCP) implementation for documentation management with a focus on single-file documentation generation for AI assistants. It provides tools for reading, writing, and managing markdown docs with frontmatter metadata, all optimized for LLM context windows. The service works seamlessly with AI assistants like Claude in Cursor or Claude Desktop.
|
12
12
|
|
13
13
|
## Features
|
14
14
|
|
15
|
-
- **
|
16
|
-
- **
|
15
|
+
- **Single-File Documentation**: Generate one comprehensive document for AI assistants
|
16
|
+
- **Read and Write Documents**: Easily read and write markdown documents with frontmatter
|
17
|
+
- **Edit Documents**: Make precise line-based edits with diff previews
|
17
18
|
- **List and Search**: Find documents by content or metadata
|
18
|
-
- **Navigation Generation**: Create navigation structures
|
19
|
-
- **Health Checks**: Analyze documentation quality and
|
20
|
-
- **
|
21
|
-
- **Frontmatter Support**: Full support for YAML frontmatter in markdown documents
|
22
|
-
- **Markdown Compatibility**: Works with standard markdown files
|
19
|
+
- **Navigation Generation**: Create navigation structures automatically
|
20
|
+
- **Health Checks**: Analyze documentation quality and find issues
|
21
|
+
- **Docker Support**: Run consistently across any environment
|
23
22
|
|
24
23
|
## Quick Start
|
25
24
|
|
26
|
-
###
|
25
|
+
### Option 1: Using Docker (Recommended)
|
27
26
|
|
28
|
-
|
27
|
+
The easiest way to get started with consistent behavior across environments:
|
29
28
|
|
30
29
|
```bash
|
31
|
-
|
30
|
+
# Pull and run directly
|
31
|
+
docker run -v ./docs:/app/docs -p 3899:3899 ghcr.io/alekspetrov/mcp-docs-service:latest /app/docs --single-doc
|
32
|
+
|
33
|
+
# Or with docker-compose
|
34
|
+
docker-compose up -d
|
32
35
|
```
|
33
36
|
|
34
|
-
|
37
|
+
See [Docker Usage](docs/docker-usage.md) for more configuration options.
|
38
|
+
|
39
|
+
### Option 2: Node Installation
|
40
|
+
|
41
|
+
Requires Node to be installed on your machine.
|
35
42
|
|
36
43
|
```bash
|
37
|
-
|
44
|
+
# Install globally
|
45
|
+
npm install -g mcp-docs-service
|
46
|
+
|
47
|
+
# Or use directly with npx
|
48
|
+
npx mcp-docs-service /path/to/docs --single-doc
|
38
49
|
```
|
39
50
|
|
40
51
|
### Cursor Integration
|
@@ -46,12 +57,75 @@ To use with Cursor, create a `.cursor/mcp.json` file in your project root:
|
|
46
57
|
"mcpServers": {
|
47
58
|
"docs-manager": {
|
48
59
|
"command": "npx",
|
49
|
-
"args": [
|
60
|
+
"args": [
|
61
|
+
"-y",
|
62
|
+
"mcp-docs-service@latest",
|
63
|
+
"/path/to/your/docs",
|
64
|
+
"--single-doc"
|
65
|
+
]
|
50
66
|
}
|
51
67
|
}
|
52
68
|
}
|
53
69
|
```
|
54
70
|
|
71
|
+
### Advanced Cursor Integration with Rules
|
72
|
+
|
73
|
+
For an enhanced experience with Cursor's AI, add a `.cursorrules` file to your project:
|
74
|
+
|
75
|
+
```json
|
76
|
+
{
|
77
|
+
"rules": {
|
78
|
+
"context_initialization": {
|
79
|
+
"description": "Starting point for each interaction",
|
80
|
+
"steps": [
|
81
|
+
"ALWAYS read docs/single-file-docs.md first",
|
82
|
+
"ALWAYS read docs/docker-usage.md when Docker is mentioned"
|
83
|
+
]
|
84
|
+
},
|
85
|
+
"operational_protocol": {
|
86
|
+
"description": "How to approach documentation tasks",
|
87
|
+
"tool_selection": [
|
88
|
+
"ALWAYS use mcp_docs_manager_* functions for ALL documentation tasks",
|
89
|
+
"PREFER mcp_docs_manager_generate_llms_doc for creating single documents"
|
90
|
+
]
|
91
|
+
},
|
92
|
+
"safety_requirements": [
|
93
|
+
"ALWAYS regenerate single_doc after documentation changes"
|
94
|
+
]
|
95
|
+
}
|
96
|
+
}
|
97
|
+
```
|
98
|
+
|
99
|
+
This configuration helps AI assistants in Cursor understand how to best work with your documentation, ensuring they always:
|
100
|
+
|
101
|
+
- Read the most important docs first
|
102
|
+
- Use the proper MCP tools for documentation tasks
|
103
|
+
- Follow best practices for documentation management
|
104
|
+
|
105
|
+
### Best Practices for Documentation Tools
|
106
|
+
|
107
|
+
When working with the MCP Documentation Service, always:
|
108
|
+
|
109
|
+
1. **Use the Right Tools for Documentation Tasks**:
|
110
|
+
|
111
|
+
- `mcp_docs_manager_read_document` - For reading documents
|
112
|
+
- `mcp_docs_manager_write_document` - For creating/updating docs
|
113
|
+
- `mcp_docs_manager_generate_llms_doc` - For generating the single comprehensive doc
|
114
|
+
- `mcp_docs_manager_interactive_template` - For creating docs with templates
|
115
|
+
|
116
|
+
2. **Regenerate Single Docs After Changes**:
|
117
|
+
|
118
|
+
```
|
119
|
+
npx mcp-docs-service /path/to/docs --generate-single-doc
|
120
|
+
```
|
121
|
+
|
122
|
+
Or ask Claude: "Please regenerate the single doc after my changes"
|
123
|
+
|
124
|
+
3. **Organize Documentation for AI Understanding**:
|
125
|
+
- Keep a `.notes` directory with essential documentation
|
126
|
+
- Use consistent frontmatter in all markdown files
|
127
|
+
- Maintain clear relationships between documents
|
128
|
+
|
55
129
|
### Claude Desktop Integration
|
56
130
|
|
57
131
|
To use MCP Docs Service with Claude Desktop:
|
@@ -176,110 +250,3 @@ description: A new document created with MCP Docs Service
|
|
176
250
|
|
177
251
|
This is a new document created with MCP Docs Service."
|
178
252
|
```
|
179
|
-
|
180
|
-
#### Editing a Document
|
181
|
-
|
182
|
-
```
|
183
|
-
@docs-manager mcp_docs_manager_edit_document path=README.md edits=[{"oldText":"# Documentation", "newText":"# Project Documentation"}]
|
184
|
-
```
|
185
|
-
|
186
|
-
#### Searching Documents
|
187
|
-
|
188
|
-
```
|
189
|
-
@docs-manager mcp_docs_manager_search_documents query="getting started"
|
190
|
-
```
|
191
|
-
|
192
|
-
#### Generating Navigation
|
193
|
-
|
194
|
-
```
|
195
|
-
@docs-manager mcp_docs_manager_generate_navigation
|
196
|
-
```
|
197
|
-
|
198
|
-
## Contributing
|
199
|
-
|
200
|
-
Contributions are welcome! Here's how you can contribute:
|
201
|
-
|
202
|
-
1. Fork the repository
|
203
|
-
2. Create a feature branch: `git checkout -b feature/my-feature`
|
204
|
-
3. Commit your changes: `git commit -am 'Add my feature'`
|
205
|
-
4. Push to the branch: `git push origin feature/my-feature`
|
206
|
-
5. Submit a pull request
|
207
|
-
|
208
|
-
Please make sure your code follows the existing style and includes appropriate tests.
|
209
|
-
|
210
|
-
## Testing and Coverage
|
211
|
-
|
212
|
-
The MCP Docs Service has comprehensive test coverage to ensure reliability and stability. We use Vitest for testing and track coverage metrics to maintain code quality.
|
213
|
-
|
214
|
-
### Running Tests
|
215
|
-
|
216
|
-
```bash
|
217
|
-
# Run all tests
|
218
|
-
npm test
|
219
|
-
|
220
|
-
# Run tests with coverage report
|
221
|
-
npm run test:coverage
|
222
|
-
```
|
223
|
-
|
224
|
-
The test suite includes:
|
225
|
-
|
226
|
-
- Unit tests for utility functions and handlers
|
227
|
-
- Integration tests for document flow
|
228
|
-
- End-to-end tests for the MCP service
|
229
|
-
|
230
|
-
Our tests are designed to be robust and handle potential errors in the implementation, ensuring they pass even if there are issues with the underlying code.
|
231
|
-
|
232
|
-
### Coverage Reports
|
233
|
-
|
234
|
-
After running the coverage command, detailed reports are generated in the `coverage` directory:
|
235
|
-
|
236
|
-
- HTML report: `coverage/index.html`
|
237
|
-
- JSON report: `coverage/coverage-final.json`
|
238
|
-
|
239
|
-
We maintain high test coverage to ensure the reliability of the service, with a focus on testing critical paths and edge cases.
|
240
|
-
|
241
|
-
## Documentation Health
|
242
|
-
|
243
|
-
We use the MCP Docs Service to maintain the health of our own documentation. The health score is based on:
|
244
|
-
|
245
|
-
- Completeness of metadata (title, description, etc.)
|
246
|
-
- Presence of broken links
|
247
|
-
- Orphaned documents (not linked from anywhere)
|
248
|
-
- Consistent formatting and style
|
249
|
-
|
250
|
-
You can check the health of your documentation with:
|
251
|
-
|
252
|
-
```bash
|
253
|
-
npx mcp-docs-service --health-check /path/to/docs
|
254
|
-
```
|
255
|
-
|
256
|
-
### Resilient by Default
|
257
|
-
|
258
|
-
MCP Docs Service is designed to be resilient by default. The service automatically handles incomplete or poorly structured documentation without failing:
|
259
|
-
|
260
|
-
- Returns a minimum health score of 70 even with issues
|
261
|
-
- Handles missing documentation directories gracefully
|
262
|
-
- Continues processing even when files have errors
|
263
|
-
- Provides lenient scoring for metadata completeness and broken links
|
264
|
-
|
265
|
-
This makes the service particularly useful for:
|
266
|
-
|
267
|
-
- Legacy projects with minimal documentation
|
268
|
-
- Projects in early stages of documentation development
|
269
|
-
- When migrating documentation from other formats
|
270
|
-
|
271
|
-
The service will always provide helpful feedback rather than failing, allowing you to incrementally improve your documentation over time.
|
272
|
-
|
273
|
-
## Documentation
|
274
|
-
|
275
|
-
For more detailed information, check out our documentation:
|
276
|
-
|
277
|
-
- [Getting Started Guide](https://github.com/alekspetrov/mcp-docs-service/blob/main/docs/guides/getting-started.md)
|
278
|
-
- [MCP Integration Guide](https://github.com/alekspetrov/mcp-docs-service/blob/main/docs/guides/mcp-integration.md)
|
279
|
-
- [MCP Protocol Usage](https://github.com/alekspetrov/mcp-docs-service/blob/main/docs/guides/mcp-protocol-usage.md)
|
280
|
-
- [API Reference](https://github.com/alekspetrov/mcp-docs-service/blob/main/docs/api/tools-reference.md)
|
281
|
-
- [Examples](https://github.com/alekspetrov/mcp-docs-service/blob/main/docs/examples/basic-usage.md)
|
282
|
-
|
283
|
-
## License
|
284
|
-
|
285
|
-
MIT
|
package/package.json
CHANGED