TheDocumentation Index
Fetch the complete documentation index at: https://docs.githits.com/llms.txt
Use this file to discover all available pages before exploring further.
get_example MCP tool and its CLI counterpart npx githits@latest example let you search the latest GitHub data using plain natural language. GitHits returns a distilled, source-cited code example based on real repositories, issues, discussions, and pull requests.
Code Examples are not version-aware. They use the latest available GitHub data. Use Code Navigation when your agent needs to inspect a specific package version or repository ref.
How agents use it
Your agent callsget_example automatically when it is stuck on an unfamiliar API, needs to validate a pattern, or encounters an error it cannot resolve from training data. You do not need to prompt it manually — once GitHits is connected via MCP, the agent decides when to reach for the tool.
You can also trigger it explicitly from the CLI for manual research or to give your agent a head start with fresh context:
Parameters
Natural-language description of the code pattern or API usage you need. Write it the way you would describe the problem to a colleague — for example,
"broadcast messages to specific rooms using python-socketio with Redis as the message queue backend".Programming language to target. Omit this parameter and GitHits infers the language from your query automatically. Only supply it when you need to force a specific language and want to be exact. If you are unsure of the canonical name, use
npx githits@latest languages first (see below).Controls license filtering for Code Examples only. Use
strict by default, yolo for unfiltered research, or custom for your configured blocklist at githits.com.Example output
The following query asks for a Python Redis pub/sub pattern. GitHits returns a working implementation alongside citations showing where the pattern comes from in the open-source ecosystem.- A canonical code example distilled from multiple real-world implementations
- Source repository citations (e.g.,
socketio/socket.io-redis-adapter,miguelgrinberg/python-socketio) - A
solution_idon the final line of the output, used when submitting feedback
Results reflect the latest available GitHub data, including recent repository changes and discussions. They are useful for current ecosystem patterns, not for version-pinned dependency inspection.
Language support
get_example supports over 800 programming languages. In most cases, GitHits infers the correct language from your query without any additional input.
When you need to force a specific language and are unsure of the exact name GitHits expects, use the search_language tool or npx githits@latest languages command to look it up:
Submitting feedback
After reviewing an example, submit feedback with thesolution_id from the output. See Feedback for the full tool reference.
MCP tool reference
| Tool | CLI command | Purpose |
|---|---|---|
get_example | npx githits@latest example | Natural-language search returning a canonical code example |
search_language | npx githits@latest languages | List or filter supported language names |