API Reference
This document provides a detailed reference for the tools exposed by the Deepwiki MCP Server. These tools can be invoked by any MCP-compatible client.
Tool: deepwiki_fetch
This is the primary tool for fetching and converting Deepwiki documentation.
Description: Fetches content from a deepwiki.com
repository, converts it to Markdown, and returns the result.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
url |
string (required) |
- | The target URL. Can be a full URL (https://... ), owner/repo format (vercel/ai ), a space-separated phrase (vercel ai ), or a single library keyword (ai ). |
maxDepth |
number (integer, 0 or 1) |
1 |
The crawl depth. 0 fetches only the root page. 1 fetches the root page and pages linked directly from it. Depths greater than 1 are not permitted. |
mode |
"aggregate" | "pages" |
"aggregate" |
The output format. aggregate returns a single Markdown string. pages returns an array of page objects. |
verbose |
boolean |
false |
If true, enables verbose logging to the server's console during the crawling process. |
Example Request
{
"action": "deepwiki_fetch",
"params": {
"url": "tailwindlabs/tailwindcss",
"mode": "pages",
"maxDepth": 1
}
}
Success Response (pages
mode)
{
"status": "ok",
"mode": "pages",
"pages": [
{
"path": "/tailwindlabs/tailwindcss",
"markdown": "# Tailwind CSS\n\n...content..."
},
{
"path": "/tailwindlabs/tailwindcss/docs/installation",
"markdown": "# Installation\n\n...content..."
}
],
"totalBytes": 150234,
"totalElapsedMs": 1850
}
Error Response
If a non-allowed domain is provided:
{
"status": "error",
"code": "DOMAIN_NOT_ALLOWED",
"message": "Only deepwiki.com domains are allowed"
}
Tool: deepwiki_search
This tool allows for searching within the content of a Deepwiki repository.
Note: This tool is implemented in src/tools/deepwikiSearch.ts
but is commented out in the main src/index.ts
entry point, meaning it may not be active by default.
Description: Crawls a deepwiki.com
repository, performs a case-insensitive search for a query string, and returns snippets of the matches.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
url |
string (required) |
- | The root Deepwiki repository URL to search within. |
query |
string (required) |
- | The case-insensitive, literal string to search for. |
maxDepth |
number (integer, >= 0) |
1 |
The crawl depth. |
maxMatches |
number (integer, 1-100) |
10 |
The maximum number of matching snippets to return. |
mode |
"aggregate" | "pages" |
- | Determines how links are rewritten in the processed Markdown. |
verbose |
boolean |
false |
Enables verbose logging on the server. |
Example Request
{
"action": "deepwiki_search",
"params": {
"url": "https://deepwiki.com/vercel/ai",
"query": "LangChain",
"maxMatches": 5
}
}
Success Response
{
"status": "ok",
"query": "LangChain",
"matches": [
{
"path": "/vercel/ai/docs/integrations",
"snippet": "... integrates seamlessly with **LangChain** to provide powerful AI ..."
},
{
"path": "/vercel/ai/docs/examples",
"snippet": "... an example of using the Vercel AI SDK with **LangChain** is available ..."
}
],
"totalSearchedPages": 12
}