mcp-docs-service 0.4.0 → 0.5.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 CHANGED
@@ -1,110 +1,284 @@
1
1
  # MCP Documentation Service
2
2
 
3
- A Model Context Protocol (MCP) implementation for documentation management. This service provides tools for reading, writing, and managing markdown documentation.
3
+ [![Test Coverage](https://codecov.io/gh/alekspetrov/mcp-docs-service/branch/main/graph/badge.svg)](https://codecov.io/gh/alekspetrov/mcp-docs-service)
4
+
5
+ <a href="https://glama.ai/mcp/servers/icfujodcjd">
6
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/icfujodcjd/badge" />
7
+ </a>
8
+
9
+ ## What is it?
10
+
11
+ MCP Documentation Service is a Model Context Protocol (MCP) implementation for documentation management. It provides a set of tools for reading, writing, and managing markdown documentation with frontmatter metadata. The service is designed to work seamlessly with AI assistants like Claude in Cursor or Claude Desktop, making it easy to manage your documentation through natural language interactions.
4
12
 
5
13
  ## Features
6
14
 
7
- - **Read and Write Documents**: Easily read and write markdown documents with frontmatter
8
- - **Edit Documents**: Make precise edits to documents with diff previews
15
+ - **Read and Write Documents**: Easily read and write markdown documents with frontmatter metadata
16
+ - **Edit Documents**: Make precise line-based edits to documents with diff previews
9
17
  - **List and Search**: Find documents by content or metadata
10
18
  - **Navigation Generation**: Create navigation structures from your documentation
11
- - **Health Checks**: Analyze documentation quality and identify issues
19
+ - **Health Checks**: Analyze documentation quality and identify issues like missing metadata or broken links
20
+ - **MCP Integration**: Seamless integration with the Model Context Protocol
21
+ - **Frontmatter Support**: Full support for YAML frontmatter in markdown documents
22
+ - **Markdown Compatibility**: Works with standard markdown files
12
23
 
13
- ## Installation
24
+ ## Quick Start
14
25
 
15
- ```bash
16
- npm install -g mcp-docs-service
17
- ```
26
+ ### Installation
18
27
 
19
- Or use directly with npx:
28
+ Requires Node to be installed on your machine.
20
29
 
21
30
  ```bash
22
- npx mcp-docs-service-npx /path/to/docs
31
+ npm install -g mcp-docs-service
23
32
  ```
24
33
 
25
- > **Note**: When using with npx, use the `mcp-docs-service-npx` command to ensure proper stdio handling.
26
-
27
- ## Usage
28
-
29
- ### Command Line
34
+ Or use directly with npx:
30
35
 
31
36
  ```bash
32
- # Use with default docs directory (./docs)
33
- mcp-docs-service
34
-
35
- # Specify a custom docs directory
36
- mcp-docs-service /path/to/docs
37
-
38
- # Create docs directory if it doesn't exist
39
- mcp-docs-service --create-dir
40
-
41
- # Run a health check on your documentation
42
- mcp-docs-service --health-check
37
+ npx mcp-docs-service /path/to/docs
43
38
  ```
44
39
 
45
40
  ### Cursor Integration
46
41
 
47
- To use with Cursor, create a `.cursor/mcp.json` file with:
42
+ To use with Cursor, create a `.cursor/mcp.json` file in your project root:
48
43
 
49
44
  ```json
50
45
  {
51
46
  "mcpServers": {
52
47
  "docs-manager": {
53
- "command": "mcp-docs-service-cursor",
54
- "args": ["/path/to/your/docs"],
55
- "env": {
56
- "NODE_ENV": "production",
57
- "DEBUG": "mcp:*"
58
- }
48
+ "command": "npx",
49
+ "args": ["-y", "mcp-docs-service", "/path/to/your/docs"]
59
50
  }
60
51
  }
61
52
  }
62
53
  ```
63
54
 
64
- > **Note**: For Cursor integration, use the `mcp-docs-service-cursor` command instead of `mcp-docs-service`. This special wrapper ensures proper stdio handling for Cursor's MCP protocol communication.
55
+ ### Claude Desktop Integration
56
+
57
+ To use MCP Docs Service with Claude Desktop:
58
+
59
+ 1. **Install Claude Desktop** - Download the latest version from [Claude's website](https://claude.ai/desktop).
60
+
61
+ 2. **Configure Claude Desktop for MCP**:
65
62
 
66
- ### NPX Integration
63
+ - Open Claude Desktop
64
+ - Click on the Claude menu and select "Developer Settings"
65
+ - This will create a configuration file at:
66
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
67
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
67
68
 
68
- For Cursor integration with npx, use:
69
+ 3. **Edit the configuration file** to add the MCP Docs Service:
69
70
 
70
71
  ```json
71
72
  {
72
73
  "mcpServers": {
73
74
  "docs-manager": {
74
75
  "command": "npx",
75
- "args": ["-y", "mcp-docs-service-npx", "/path/to/your/docs"],
76
- "env": {
77
- "NODE_ENV": "production",
78
- "DEBUG": "mcp:*"
79
- }
76
+ "args": ["-y", "mcp-docs-service", "/path/to/your/docs"]
80
77
  }
81
78
  }
82
79
  }
83
80
  ```
84
81
 
85
- ## Available Tools
82
+ Make sure to replace `/path/to/your/docs` with the absolute path to your documentation directory.
83
+
84
+ 4. **Restart Claude Desktop** completely.
85
+
86
+ 5. **Verify the tool is available** - After restarting, you should see a green dot for docs-manager MCP tool (Cursor Settings > MCP)
87
+
88
+ 6. **Troubleshooting**:
89
+ - If the server doesn't appear, check the logs at:
90
+ - macOS: `~/Library/Logs/Claude/mcp*.log`
91
+ - Windows: `%APPDATA%\Claude\logs\mcp*.log`
92
+ - Ensure Node.js is installed on your system
93
+ - Make sure the paths in your configuration are absolute and valid
94
+
95
+ ## Examples
96
+
97
+ ### Using with Claude in Cursor
98
+
99
+ When using Claude in Cursor, you can invoke the tools in two ways:
100
+
101
+ 1. **Using Natural Language** (Recommended):
102
+ - Simply ask Claude to perform the task in plain English:
103
+
104
+ ```
105
+ Can you search my documentation for anything related to "getting started"?
106
+ ```
107
+
108
+ ```
109
+ Please list all the markdown files in my docs directory.
110
+ ```
111
+
112
+ ```
113
+ Could you check if there are any issues with my documentation?
114
+ ```
115
+
116
+ 2. **Using Direct Tool Syntax**:
117
+ - For more precise control, you can use the direct tool syntax:
118
+
119
+ ```
120
+ @docs-manager mcp_docs_manager_read_document path=docs/getting-started.md
121
+ ```
122
+
123
+ ```
124
+ @docs-manager mcp_docs_manager_list_documents recursive=true
125
+ ```
126
+
127
+ ```
128
+ @docs-manager mcp_docs_manager_check_documentation_health
129
+ ```
130
+
131
+ ### Using with Claude Desktop
132
+
133
+ When using Claude Desktop, you can invoke the tools in two ways:
134
+
135
+ 1. **Using Natural Language** (Recommended):
136
+
137
+ ```
138
+ Can you read the README.md file for me?
139
+ ```
140
+
141
+ ```
142
+ Please find all documents that mention "API" in my documentation.
143
+ ```
144
+
145
+ ```
146
+ I'd like you to check the health of our documentation and tell me if there are any issues.
147
+ ```
148
+
149
+ 2. **Using the Tool Picker**:
150
+ - Click the hammer icon in the bottom right corner of the input box
151
+ - Select "docs-manager" from the list of available tools
152
+ - Choose the specific tool you want to use
153
+ - Fill in the required parameters and click "Run"
86
154
 
87
- The service provides the following tools:
155
+ Claude will interpret your natural language requests and use the appropriate tool with the correct parameters. You don't need to remember the exact tool names or parameter formats - just describe what you want to do!
88
156
 
89
- - `read_document`: Read a markdown document
90
- - `write_document`: Create or overwrite a document
91
- - `edit_document`: Make precise edits to a document
92
- - `list_documents`: List all documents in a directory
93
- - `search_documents`: Find documents containing specific text
94
- - `generate_navigation`: Create a navigation structure
95
- - `check_documentation_health`: Analyze documentation quality
157
+ ### Common Tool Commands
96
158
 
97
- ## Example
159
+ Here are some common commands you can use with the tools:
160
+
161
+ #### Reading a Document
162
+
163
+ ```
164
+ @docs-manager mcp_docs_manager_read_document path=docs/getting-started.md
165
+ ```
98
166
 
99
- Using with Claude in Cursor:
167
+ #### Writing a Document
100
168
 
101
169
  ```
102
- @docs-manager read_document path=README.md
170
+ @docs-manager mcp_docs_manager_write_document path=docs/new-document.md content="---
171
+ title: New Document
172
+ description: A new document created with MCP Docs Service
173
+ ---
174
+
175
+ # New Document
176
+
177
+ This is a new document created with MCP Docs Service."
103
178
  ```
104
179
 
180
+ #### Editing a Document
181
+
105
182
  ```
106
- @docs-manager edit_document path=README.md edits=[{"oldText":"# Documentation", "newText":"# Project Documentation"}]
183
+ @docs-manager mcp_docs_manager_edit_document path=README.md edits=[{"oldText":"# Documentation", "newText":"# Project Documentation"}]
184
+ ```
185
+
186
+ #### Searching Documents
187
+
107
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)
108
282
 
109
283
  ## License
110
284