Skip to main content
Documentation access gives your agent a direct way to inspect package docs without leaving the coding session. GitHits covers both hosted documentation and documentation files backed by repositories. Use search when your agent knows the topic and needs the relevant docs page. Use docs_list when it needs to browse the available documentation set first. Use docs_read to read the exact page or line range. Use these tools when docs explain the public API better than source code, or when your agent needs to compare documented behavior against implementation behavior.
search is the primary discovery tool for documentation questions. It can search indexed package docs alongside code and symbols, then return documentation hits that chain into docs_read.Use it when your agent knows the package and topic, such as an option name, guide title, error message, migration note, or API behavior.CLI usage
npx githits@latest search "middleware error handling" --in npm:express --source docs
npx githits@latest search "streaming responses" --in pypi:requests --source docs
Key parameters
query
string
required
Discovery query string. Describe the documentation topic, API, option, behavior, or error message you need.
target
string
Single search target. Package format: npm:react@18.2.0 or npm:react for latest. Repository format: https://github.com/facebook/react.
source
string
Set to docs when you only want documentation results. Omit it when documentation can be mixed with code and symbol results.
limit
number
Maximum results to return.
When a result points to documentation, pass its pageId to docs_read to read the page or a focused line range.
docs_list lists available documentation pages for a package. It covers hosted/crawled docs and repository-backed documentation files.Every entry includes a stable pageId, a sourceKind (crawled or repo), and a source URL. Repository-backed entries also expose repoUrl, gitRef, and filePath for source follow-ups.CLI usage
npx githits@latest docs list npm:express
npx githits@latest docs list pypi:requests --limit 20
Parameters
registry
string
required
Package registry.
package_name
string
required
Package name. Scoped names are supported.
version
string
Optional package version.
limit
number
Maximum pages to return (1-500, default 100).
after
string
Pagination cursor from a previous docs_list response.
docs_read reads a single documentation page by its pageId. Pass the pageId returned by docs_list or from a search result.Use start_line and end_line to fetch a slice of a long page. The response carries totalLines so the agent can continue reading the next slice when needed.CLI usage
npx githits@latest docs read <pageId>
npx githits@latest docs read <pageId> --lines 50-150
Parameters
page_id
string
required
Documentation page ID from docs_list or search results.
start_line
number
Starting line (1-indexed). Omit for the full page.
end_line
number
Ending line (inclusive). Omit for end of page.

MCP tool reference

MCP toolCLI commandPurpose
searchnpx githits@latest searchFind documentation pages by topic, API, option, behavior, or error
docs_listnpx githits@latest docs listBrowse documentation pages for a package
docs_readnpx githits@latest docs readRead a documentation page by page ID