MCP Server
/docs exposes a Model Context Protocol server at
https://slashdocs.com/mcp.
Connect once, get version-pinned documentation on every query — no hallucinations, no stale training data.
01 — Connect
Claude Code — run once in your terminal. The --scope user flag registers the server globally across all your projects.
$ claude mcp add --scope user SlashDocs --transport http https://slashdocs.com/mcp \ --header "Authorization: Bearer YOUR_API_KEY"
Claude Desktop, Cursor, Windsurf — add this to your MCP config file:
{
"mcpServers": {
"SlashDocs": {
"type": "http",
"url": "https://slashdocs.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
OpenCode CLI — edit ~/.config/opencode/opencode.json:
{
"mcp": {
"SlashDocs": {
"type": "remote",
"url": "https://slashdocs.com/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:YOUR_API_KEY}"
}
}
}
}
02 — How it works
Every documentation lookup follows three tool calls. Search results carry file_path and doc_slug, so reading the full file is always one direct call away — no guessing.
list-docs-tool(query: "laravel")
Find the right slug — e.g. laravel-12. Call with no query to see all available docs.
search-docs-tool(query: "rate limiting", docs: ["laravel-12"])
Returns matching chunks — each result includes file_path, doc_slug, heading, and a content preview.
read-file-tool(doc_slug: "laravel-12", file_path: "routing.md")
Full file content from the file_path in step 2. Use head / tail / offset+limit for large files.
03 — Available tools
Five read-only tools. Your agent calls them automatically — you don't need to prompt it.
list-docs-tool
read-only
Search available documentation sources by name, slug, or organization. Call with no query to list all available docs.
query
string
optional
Filter by name, slug, or org (e.g. "laravel", "react"). Omit to list all.
search-docs-tool
read-only
Search documentation by keyword or semantic meaning. Each result includes file_path and doc_slug for direct use with read-file-tool.
query
string
required
What to search for.
docs
string[]
optional
Limit to specific slugs, e.g. ["laravel-12"]. Omit to search all.
mode
string
optional
"keyword" (default, fast) or "semantic" (meaning-based).
limit
integer
optional
Results per page (1–50). Default: 10.
offset
integer
optional
Pagination offset. Default: 0.
read-file-tool
read-only
Read full file content. Use file_path and doc_slug from any search-docs-tool result — no need to know paths in advance.
doc_slug
string
required
The documentation slug, e.g. "laravel-12".
file_path
string
required
The file path from a search result.
head
integer
optional
Return first N chunks only.
tail
integer
optional
Return last N chunks only.
offset
integer
optional
Skip N chunks (use with limit).
limit
integer
optional
Return N chunks from offset.
list-files-tool
read-only
List all file paths available for a given slug. Useful for browsing the structure of a documentation source without a search query.
doc_slug
string
required
The documentation slug, e.g. "frankenphp".
get-chunks-tool
read-only
Paginated access to structured chunks of a documentation page — returns each section with its heading and index. Use when you need to navigate a file section by section.
doc_slug
string
required
The documentation slug.
file_path
string
required
The file path from search results.
offset
integer
optional
Chunks to skip. Default: 0.
limit
integer
optional
Max chunks to return. Default: 10.
04 — Add to AGENTS.md
Tell your agent which docs to use for this project. Read package.json or composer.json, map the dependencies to their slugs (e.g. laravel/framework ^12 → laravel-12), then paste this into your project's AGENTS.md or CLAUDE.md:
## Documentation (SlashDocs MCP) Before answering questions about any library or framework, check the SlashDocs MCP for accurate, version-pinned documentation. Workflow: 1. list-docs-tool(query: "<library>") — find the slug 2. search-docs-tool(query: "...", docs: ["<slug>"]) — find relevant chunks 3. read-file-tool(doc_slug, file_path) — read the full section ^ file_path comes directly from the search result, no guessing needed This project uses: [list your slugs, e.g. laravel-12, react, tailwindcss] Always prefer SlashDocs over training data for API signatures, config options, and version-specific behaviour.
Common slug mappings: laravel/framework ^12 → laravel-12 · "react" → react · "vue" → vue-3 · "tailwindcss" → tailwindcss · "@inertiajs/react" → inertia · "filament/filament" → filament
Built with laravel/mcp. All tools are read-only — /docs never writes to your environment.