@docsyncdev/mcp-server 1.0.0 → 1.1.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 +74 -45
- package/dist/index.d.ts +33 -5
- package/dist/index.js +66 -50
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @docsyncdev/mcp-server
|
|
2
2
|
|
|
3
3
|
MCP (Model Context Protocol) server for DocSync - enables AI coding assistants like Claude Code and Cursor to search and interact with your documentation.
|
|
4
4
|
|
|
@@ -8,6 +8,7 @@ MCP (Model Context Protocol) server for DocSync - enables AI coding assistants l
|
|
|
8
8
|
- **Semantic Search**: Search your documentation using natural language queries
|
|
9
9
|
- **Documentation Browser**: List and browse docs by level (module, topic, unit)
|
|
10
10
|
- **Full Document Retrieval**: Get complete document content by ID
|
|
11
|
+
- **Compact Mode**: Condensed output for quick lookups (reduces token usage ~30%)
|
|
11
12
|
- **Caching**: Built-in LRU cache reduces API calls and improves latency
|
|
12
13
|
- **Rate Limiting**: Server-side rate limiting prevents abuse
|
|
13
14
|
|
|
@@ -36,7 +37,7 @@ Add to your `claude_desktop_config.json` or `.claude/settings.json`:
|
|
|
36
37
|
"mcpServers": {
|
|
37
38
|
"docsync": {
|
|
38
39
|
"command": "npx",
|
|
39
|
-
"args": ["@
|
|
40
|
+
"args": ["-y", "@docsyncdev/mcp-server"],
|
|
40
41
|
"env": {
|
|
41
42
|
"DOCSYNC_API_KEY": "ds_your_api_key_here",
|
|
42
43
|
"DOCSYNC_PROJECT_ID": "your-project-uuid"
|
|
@@ -55,7 +56,7 @@ Add to your Cursor MCP configuration:
|
|
|
55
56
|
"mcpServers": {
|
|
56
57
|
"docsync": {
|
|
57
58
|
"command": "npx",
|
|
58
|
-
"args": ["@
|
|
59
|
+
"args": ["-y", "@docsyncdev/mcp-server"],
|
|
59
60
|
"env": {
|
|
60
61
|
"DOCSYNC_API_KEY": "ds_your_api_key_here",
|
|
61
62
|
"DOCSYNC_PROJECT_ID": "your-project-uuid"
|
|
@@ -75,6 +76,7 @@ Search documentation semantically. Returns relevant chunks matching your query.
|
|
|
75
76
|
|
|
76
77
|
- `query` (string, required): Natural language search query
|
|
77
78
|
- `limit` (number, optional): Maximum results (default 10, max 50)
|
|
79
|
+
- `compact` (boolean, optional): Return condensed output with just paths and scores (default: false)
|
|
78
80
|
|
|
79
81
|
**Example:**
|
|
80
82
|
|
|
@@ -82,30 +84,34 @@ Search documentation semantically. Returns relevant chunks matching your query.
|
|
|
82
84
|
How does authentication work in this project?
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
**Compact mode example:**
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**Parameters:**
|
|
89
|
+
```
|
|
90
|
+
search_docs({ query: "authentication", compact: true })
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
→ **5 results for "authentication"**
|
|
93
|
+
- docs/topics/auth.md (95%)
|
|
94
|
+
- docs/modules/security.md (82%)
|
|
95
|
+
- ...
|
|
96
|
+
```
|
|
92
97
|
|
|
93
98
|
### get_docs_for_file ⭐
|
|
94
99
|
|
|
95
|
-
**The killer feature.** Get documentation relevant to a source code file, with full
|
|
100
|
+
**The killer feature.** Get documentation relevant to a source code file, with full context.
|
|
96
101
|
|
|
97
102
|
When you're working on `src/auth/jwt.ts`, this returns:
|
|
98
103
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
104
|
+
- Unit doc (JWT implementation details) - **full content**
|
|
105
|
+
- Module doc (Security architecture) - **full content**
|
|
106
|
+
- Related topics based on concepts (Auth, Tokens, etc.) - **summaries only**
|
|
102
107
|
|
|
103
|
-
|
|
108
|
+
One call for immediate context. Related topics give you paths to dive deeper if needed.
|
|
104
109
|
|
|
105
110
|
**Parameters:**
|
|
106
111
|
|
|
107
112
|
- `file_path` (string, required): Path to the source code file
|
|
108
113
|
- `include_content` (boolean, optional): Include full content (default: true)
|
|
114
|
+
- `compact` (boolean, optional): Return condensed output for quick lookups (default: false)
|
|
109
115
|
|
|
110
116
|
**Example:**
|
|
111
117
|
|
|
@@ -116,17 +122,44 @@ Get docs for src/services/payment-processor.ts
|
|
|
116
122
|
Returns:
|
|
117
123
|
|
|
118
124
|
```
|
|
125
|
+
# 📄 Unit Documentation
|
|
126
|
+
## PaymentProcessor Class
|
|
127
|
+
Detailed API for the payment processor...
|
|
128
|
+
[full content]
|
|
129
|
+
|
|
119
130
|
# 🏗️ Module Context
|
|
120
131
|
## Billing & Payments
|
|
121
132
|
Overview of the billing system architecture...
|
|
133
|
+
[full content]
|
|
122
134
|
|
|
123
|
-
# 📚
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
# 📚 Related Topics (3)
|
|
136
|
+
- **Payment Processing** (payments)
|
|
137
|
+
Path: docs/topics/payments.md
|
|
138
|
+
How payments flow through the system
|
|
126
139
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
- **Validation** (validation)
|
|
141
|
+
Path: docs/topics/validation.md
|
|
142
|
+
Input validation patterns
|
|
143
|
+
|
|
144
|
+
- **Error Handling** (errors)
|
|
145
|
+
Path: docs/topics/errors.md
|
|
146
|
+
Error handling strategies
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Compact mode** returns summaries with topic list:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
get_docs_for_file({ file_path: "src/auth/jwt.ts", compact: true })
|
|
153
|
+
|
|
154
|
+
→ ## src/auth/jwt.ts
|
|
155
|
+
**JWT Handler**
|
|
156
|
+
Handles JWT token creation and validation
|
|
157
|
+
|
|
158
|
+
- **Module:** Security — Security patterns
|
|
159
|
+
|
|
160
|
+
**Related Topics (2):**
|
|
161
|
+
- Authentication (authentication): docs/topics/auth.md
|
|
162
|
+
- Token Management (tokens): docs/topics/tokens.md
|
|
130
163
|
```
|
|
131
164
|
|
|
132
165
|
### list_docs
|
|
@@ -136,6 +169,7 @@ Browse all documentation, optionally filtered by level.
|
|
|
136
169
|
**Parameters:**
|
|
137
170
|
|
|
138
171
|
- `level` (string, optional): Filter by "module", "topic", "unit", or "all" (default)
|
|
172
|
+
- `compact` (boolean, optional): Return condensed output with just titles and paths (default: false)
|
|
139
173
|
|
|
140
174
|
**Example:**
|
|
141
175
|
|
|
@@ -143,20 +177,31 @@ Browse all documentation, optionally filtered by level.
|
|
|
143
177
|
List all module-level docs
|
|
144
178
|
```
|
|
145
179
|
|
|
180
|
+
**Compact mode** returns a simple list without summaries:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
list_docs({ level: "module", compact: true })
|
|
184
|
+
|
|
185
|
+
→ **3 docs in MyProject**
|
|
186
|
+
|
|
187
|
+
**Module** (3)
|
|
188
|
+
- Authentication: docs/modules/auth.md
|
|
189
|
+
- Billing: docs/modules/billing.md
|
|
190
|
+
- API: docs/modules/api.md
|
|
191
|
+
```
|
|
192
|
+
|
|
146
193
|
## Environment Variables
|
|
147
194
|
|
|
148
|
-
| Variable | Required | Description
|
|
149
|
-
| -------------------- | -------- |
|
|
150
|
-
| `DOCSYNC_API_KEY` | Yes | Your DocSync API key
|
|
151
|
-
| `DOCSYNC_PROJECT_ID` | Yes | Your DocSync project ID
|
|
152
|
-
| `DOCSYNC_API_URL` | No | Custom API URL (for development) |
|
|
195
|
+
| Variable | Required | Description |
|
|
196
|
+
| -------------------- | -------- | ----------------------- |
|
|
197
|
+
| `DOCSYNC_API_KEY` | Yes | Your DocSync API key |
|
|
198
|
+
| `DOCSYNC_PROJECT_ID` | Yes | Your DocSync project ID |
|
|
153
199
|
|
|
154
200
|
## Rate Limits
|
|
155
201
|
|
|
156
202
|
- `search_docs`: 200 requests per hour
|
|
157
203
|
- `get_docs_for_file`: 200 requests per hour
|
|
158
204
|
- `list_docs`: 200 requests per hour
|
|
159
|
-
- `get_document`: 500 requests per hour
|
|
160
205
|
|
|
161
206
|
Rate limits are per API key. If you hit a rate limit, the tool will return an error message.
|
|
162
207
|
|
|
@@ -186,23 +231,7 @@ The document ID may be stale if documentation was recently updated. Run a new se
|
|
|
186
231
|
|
|
187
232
|
### Connection issues
|
|
188
233
|
|
|
189
|
-
1.
|
|
190
|
-
2.
|
|
191
|
-
3.
|
|
192
|
-
|
|
193
|
-
## Development
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Install dependencies
|
|
197
|
-
npm install
|
|
198
|
-
|
|
199
|
-
# Build
|
|
200
|
-
npm run build
|
|
201
|
-
|
|
202
|
-
# Run locally
|
|
203
|
-
DOCSYNC_API_KEY=your_key DOCSYNC_PROJECT_ID=your_project node dist/index.js
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## License
|
|
207
|
-
|
|
208
|
-
MIT
|
|
234
|
+
1. Make sure your config uses `npx` with the `-y` flag: `"args": ["-y", "@docsyncdev/mcp-server"]`. The `-y` flag lets npx auto-install the package without prompting, which is required for MCP stdio communication.
|
|
235
|
+
2. Check that your API key is valid in DocSync settings
|
|
236
|
+
3. Verify your project ID is correct
|
|
237
|
+
4. Ensure you have internet connectivity
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,13 @@ interface ListDocsResponse {
|
|
|
52
52
|
}>;
|
|
53
53
|
count: number;
|
|
54
54
|
}
|
|
55
|
+
interface TopicSummary {
|
|
56
|
+
id: string;
|
|
57
|
+
file_path: string;
|
|
58
|
+
title: string;
|
|
59
|
+
concept: string;
|
|
60
|
+
summary: string | null;
|
|
61
|
+
}
|
|
55
62
|
interface FileDocsResponse {
|
|
56
63
|
success: boolean;
|
|
57
64
|
project_id: string;
|
|
@@ -59,8 +66,8 @@ interface FileDocsResponse {
|
|
|
59
66
|
file_path: string;
|
|
60
67
|
doc_path: string;
|
|
61
68
|
unit_doc: DocInfo | null;
|
|
62
|
-
topic: DocInfo | null;
|
|
63
69
|
module: DocInfo | null;
|
|
70
|
+
related_topics: TopicSummary[];
|
|
64
71
|
}
|
|
65
72
|
/**
|
|
66
73
|
* Search results cache
|
|
@@ -82,6 +89,12 @@ interface ClientConfig {
|
|
|
82
89
|
projectId: string;
|
|
83
90
|
baseUrl?: string;
|
|
84
91
|
}
|
|
92
|
+
interface ClientMetadata {
|
|
93
|
+
hostname: string;
|
|
94
|
+
os: string;
|
|
95
|
+
editor: string | undefined;
|
|
96
|
+
version: string;
|
|
97
|
+
}
|
|
85
98
|
/**
|
|
86
99
|
* DocSync API client for MCP server
|
|
87
100
|
*/
|
|
@@ -102,6 +115,18 @@ declare class DocSyncClient {
|
|
|
102
115
|
* Get documentation related to a source file with hierarchy context
|
|
103
116
|
*/
|
|
104
117
|
getDocsForFile(filePath: string, includeContent?: boolean): Promise<FileDocsResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Register a new MCP session with the server
|
|
120
|
+
*/
|
|
121
|
+
registerSession(metadata: ClientMetadata): Promise<string>;
|
|
122
|
+
/**
|
|
123
|
+
* Send a heartbeat for an active session
|
|
124
|
+
*/
|
|
125
|
+
heartbeat(sessionId: string): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* End an active session (graceful disconnect)
|
|
128
|
+
*/
|
|
129
|
+
endSession(sessionId: string): Promise<void>;
|
|
105
130
|
/**
|
|
106
131
|
* Make authenticated request to DocSync API
|
|
107
132
|
*/
|
|
@@ -175,6 +200,7 @@ declare const searchToolDefinition: Tool;
|
|
|
175
200
|
interface SearchToolInput {
|
|
176
201
|
query: string;
|
|
177
202
|
limit?: number;
|
|
203
|
+
compact?: boolean;
|
|
178
204
|
}
|
|
179
205
|
/**
|
|
180
206
|
* Execute search_docs tool
|
|
@@ -194,6 +220,7 @@ declare const LIST_DOCS_TOOL_NAME = "list_docs";
|
|
|
194
220
|
declare const listDocsToolDefinition: Tool;
|
|
195
221
|
interface ListDocsToolInput {
|
|
196
222
|
level?: 'module' | 'topic' | 'unit' | 'all';
|
|
223
|
+
compact?: boolean;
|
|
197
224
|
}
|
|
198
225
|
/**
|
|
199
226
|
* Execute list_docs tool
|
|
@@ -204,12 +231,12 @@ declare function executeListDocsTool(client: DocSyncClient, input: ListDocsToolI
|
|
|
204
231
|
* get_docs_for_file MCP Tool
|
|
205
232
|
*
|
|
206
233
|
* The killer feature: given a source code file, returns related documentation
|
|
207
|
-
*
|
|
234
|
+
* with module context and related topics based on concepts.
|
|
208
235
|
*
|
|
209
236
|
* This gives agents full context about what they're working on:
|
|
210
|
-
* - Specific docs for the file/component
|
|
211
|
-
* -
|
|
212
|
-
* -
|
|
237
|
+
* - Specific docs for the file/component (full content)
|
|
238
|
+
* - Module-level architecture (full content)
|
|
239
|
+
* - Related topics by concept (metadata only - fetch if needed)
|
|
213
240
|
*/
|
|
214
241
|
|
|
215
242
|
declare const FILE_DOCS_TOOL_NAME = "get_docs_for_file";
|
|
@@ -220,6 +247,7 @@ declare const fileDocsToolDefinition: Tool;
|
|
|
220
247
|
interface FileDocsToolInput {
|
|
221
248
|
file_path: string;
|
|
222
249
|
include_content?: boolean;
|
|
250
|
+
compact?: boolean;
|
|
223
251
|
}
|
|
224
252
|
/**
|
|
225
253
|
* Execute get_docs_for_file tool
|