owner/repo and the agent gets tools to search and read that repository’s code and docs — nothing else. Free, no auth.
Because the server is scoped to one project, this is the cleanest pattern for a documentation assistant: the agent cannot wander, and every answer traces to a file in that repo.
Prerequisites
- Python 3.10+
- A Google AI Studio key for Gemini. Swap
model_namefor any tool-calling model you already have a key for.
Build it
1
Install and set your key
2
Choose the repository
The repo is part of the URL, so make it a variable — that is the one thing you will change when you reuse this script.
3
Build the agent
fetch_swarms_documentation, not a generic fetch_docs. You do not need to know them; the agent discovers them.4
Ask for something a docs bot should be good at
The complete script
Turning it into a support bot
The pattern generalizes with two changes: point the URL at your own repository, and give the agent a persona that knows it is answering users rather than reading code for itself.max_loops=2 gives it room to search, read what it found, and then answer — one loop often is not enough when the first search misses.
DeepWiki or GitMCP?
Use GitMCP when the repository is decided before the question is asked.
Next
- Microsoft Learn — the same grounding idea against a vendor’s official docs.
- MCP in a multi-agent workflow — chain a repo reader into a docs checker.