@docsyncdev/mcp-server
v1.1.1
Published
MCP server for DocSync - enables AI coding assistants to search and update documentation
Maintainers
Readme
@docsyncdev/mcp-server
MCP (Model Context Protocol) server for DocSync - enables AI coding assistants like Claude Code and Cursor to search and interact with your documentation.
Features
- Context-Aware Docs: Get documentation for any source file with full hierarchy (unit → topic → module)
- Semantic Search: Search your documentation using natural language queries
- Documentation Browser: List and browse docs by level (module, topic, unit)
- Full Document Retrieval: Get complete document content by ID
- Compact Mode: Condensed output for quick lookups (reduces token usage ~30%)
- Caching: Built-in LRU cache reduces API calls and improves latency
- Rate Limiting: Server-side rate limiting prevents abuse
Quick Start
1. Get Your API Key
- Go to your DocSync dashboard at docsync.dev
- Navigate to Settings > API Keys
- Click Create API Key and copy the key
2. Get Your Project ID
- In DocSync dashboard, go to Settings > API Keys
- Select your project from the dropdown
- Copy the project ID from the generated config
3. Configure Your AI Assistant
Claude Code
Add to your claude_desktop_config.json or .claude/settings.json:
{
"mcpServers": {
"docsync": {
"command": "npx",
"args": ["-y", "@docsyncdev/mcp-server"],
"env": {
"DOCSYNC_API_KEY": "ds_your_api_key_here",
"DOCSYNC_PROJECT_ID": "your-project-uuid"
}
}
}
}Cursor
Add to your Cursor MCP configuration:
{
"mcpServers": {
"docsync": {
"command": "npx",
"args": ["-y", "@docsyncdev/mcp-server"],
"env": {
"DOCSYNC_API_KEY": "ds_your_api_key_here",
"DOCSYNC_PROJECT_ID": "your-project-uuid"
}
}
}
}Available Tools
search_docs
Search documentation semantically. Returns relevant chunks matching your query.
Parameters:
query(string, required): Natural language search querylimit(number, optional): Maximum results (default 10, max 50)compact(boolean, optional): Return condensed output with just paths and scores (default: false)
Example:
How does authentication work in this project?Compact mode example:
search_docs({ query: "authentication", compact: true })
→ **5 results for "authentication"**
- docs/topics/auth.md (95%)
- docs/modules/security.md (82%)
- ...get_docs_for_file ⭐
The killer feature. Get documentation relevant to a source code file, with full context.
When you're working on src/auth/jwt.ts, this returns:
- Unit doc (JWT implementation details) - full content
- Module doc (Security architecture) - full content
- Related topics based on concepts (Auth, Tokens, etc.) - summaries only
One call for immediate context. Related topics give you paths to dive deeper if needed.
Parameters:
file_path(string, required): Path to the source code fileinclude_content(boolean, optional): Include full content (default: true)compact(boolean, optional): Return condensed output for quick lookups (default: false)
Example:
Get docs for src/services/payment-processor.tsReturns:
# 📄 Unit Documentation
## PaymentProcessor Class
Detailed API for the payment processor...
[full content]
# 🏗️ Module Context
## Billing & Payments
Overview of the billing system architecture...
[full content]
# 📚 Related Topics (3)
- **Payment Processing** (payments)
Path: docs/topics/payments.md
How payments flow through the system
- **Validation** (validation)
Path: docs/topics/validation.md
Input validation patterns
- **Error Handling** (errors)
Path: docs/topics/errors.md
Error handling strategiesCompact mode returns summaries with topic list:
get_docs_for_file({ file_path: "src/auth/jwt.ts", compact: true })
→ ## src/auth/jwt.ts
**JWT Handler**
Handles JWT token creation and validation
- **Module:** Security — Security patterns
**Related Topics (2):**
- Authentication (authentication): docs/topics/auth.md
- Token Management (tokens): docs/topics/tokens.mdlist_docs
Browse all documentation, optionally filtered by level.
Parameters:
level(string, optional): Filter by "module", "topic", "unit", or "all" (default)compact(boolean, optional): Return condensed output with just titles and paths (default: false)
Example:
List all module-level docsCompact mode returns a simple list without summaries:
list_docs({ level: "module", compact: true })
→ **3 docs in MyProject**
**Module** (3)
- Authentication: docs/modules/auth.md
- Billing: docs/modules/billing.md
- API: docs/modules/api.mdEnvironment Variables
| Variable | Required | Description |
| -------------------- | -------- | ----------------------- |
| DOCSYNC_API_KEY | Yes | Your DocSync API key |
| DOCSYNC_PROJECT_ID | Yes | Your DocSync project ID |
Rate Limits
search_docs: 200 requests per hourget_docs_for_file: 200 requests per hourlist_docs: 200 requests per hour
Rate limits are per API key. If you hit a rate limit, the tool will return an error message.
Caching
The MCP server includes an in-memory LRU cache:
- Cache size: 100 entries per cache type
- TTL: 5 minutes
- Repeated queries return cached results instantly
Cache clears when the MCP server process restarts.
Troubleshooting
"DOCSYNC_API_KEY environment variable is required"
Make sure you've added the env section to your MCP configuration with your API key.
"Rate limit exceeded"
Wait a few minutes before making more requests. Consider if your agent is making too many searches.
"Document not found"
The document ID may be stale if documentation was recently updated. Run a new search to get current document IDs.
Connection issues
- Make sure your config uses
npxwith the-yflag:"args": ["-y", "@docsyncdev/mcp-server"]. The-yflag lets npx auto-install the package without prompting, which is required for MCP stdio communication. - Check that your API key is valid in DocSync settings
- Verify your project ID is correct
- Ensure you have internet connectivity
