The Deepwiki MCP Server is an unofficial tool that helps retrieve and format documentation from Deepwiki. It crawls pages from specified Deepwiki URLs, converts them to Markdown format, and returns either a complete document or a structured list of pages, making documentation retrieval quick and efficient.
The easiest way to install and use the Deepwiki MCP Server is with npx:
npx -y mcp-deepwiki@latest
To integrate with Cursor, add the following to your .cursor/mcp.json
file:
{
"mcpServers": {
"mcp-deepwiki": {
"command": "npx",
"args": ["-y", "mcp-deepwiki@latest"]
}
}
}
If you prefer to install from source:
# Clone the repository
git clone https://github.com/regenrek/deepwiki-mcp.git
cd deepwiki-mcp
# Install dependencies
npm install
# Build the package
npm run build
You can customize the server behavior with these environment variables:
DEEPWIKI_MAX_CONCURRENCY=10
DEEPWIKI_REQUEST_TIMEOUT=60000
DEEPWIKI_MAX_RETRIES=5
DEEPWIKI_RETRY_DELAY=500
You can use various prompts to fetch documentation:
deepwiki fetch how can i use gpt-image-1 with "vercel ai" sdk
deepwiki fetch how can i create new blocks in shadcn?
deepwiki fetch i want to understand how X works
To fetch complete documentation (default behavior):
use deepwiki https://deepwiki.com/shadcn-ui/ui
use deepwiki multiple pages https://deepwiki.com/shadcn-ui/ui
To fetch just a single page:
use deepwiki fetch single page https://deepwiki.com/tailwindlabs/tailwindcss/2.2-theme-system
You can also use shorthand notation:
use deepwiki fetch tailwindlabs/tailwindcss
Other useful command formats:
deepwiki fetch library
deepwiki fetch url
deepwiki fetch <name>/<repo>
deepwiki multiple pages ...
deepwiki single page url ...
The package registers a tool named deepwiki_fetch
that you can use with any MCP-compatible client:
{
"action": "deepwiki_fetch",
"params": {
"url": "https://deepwiki.com/user/repo",
"mode": "aggregate",
"maxDepth": "1"
}
}
url
(required): The starting URL of the Deepwiki repositorymode
(optional): Output mode, either "aggregate" for a single Markdown document (default) or "pages" for structured page datamaxDepth
(optional): Maximum depth of pages to crawl (default: 10)For HTTP transport, you can make direct API calls:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"id": "req-1",
"action": "deepwiki_fetch",
"params": {
"url": "https://deepwiki.com/user/repo",
"mode": "aggregate"
}
}'
{
"status": "ok",
"data": "# Page Title\n\nPage content...\n\n---\n\n# Another Page\n\nMore content...",
"totalPages": 5,
"totalBytes": 25000,
"elapsedMs": 1200
}
{
"status": "ok",
"data": [
{
"path": "index",
"markdown": "# Home Page\n\nWelcome to the repository."
},
{
"path": "section/page1",
"markdown": "# First Page\n\nThis is the first page content."
}
],
"totalPages": 2,
"totalBytes": 12000,
"elapsedMs": 800
}
Permission Denied: If you get EACCES errors when running the CLI, make sure to make the binary executable:
chmod +x ./node_modules/.bin/mcp-deepwiki
Connection Refused: Make sure the port is available and not blocked by a firewall:
# Check if port is in use
lsof -i :3000
Timeout Errors: For large repositories, consider increasing the timeout and concurrency:
DEEPWIKI_REQUEST_TIMEOUT=60000 DEEPWIKI_MAX_CONCURRENCY=10 npx mcp-deepwiki
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.