Connect this knowledge base to your AI agent
Your agent knows Raku the way it knows everything else: from whatever it absorbed once. It cannot open a page, and it cannot tell you which document an answer came from. This knowledge base ships an MCP server that changes both.
What you need first
Node.js ā the server is a small Node program.
An MCP-capable client: Claude Code, Cursor, or anything else that reads an
mcpServersconfig.
Get the bundle
Every data release carries raku-kb-mcp-offline.tar.gz ā the server together
with a prebuilt search index, so nothing has to be rebuilt locally:
Releases ā take the newest tag starting with
data-.
Three commands
tar xzf raku-kb-mcp-offline.tar.gz
cd raku-kb-mcp && npm install
claude mcp add raku-kb -- node "$PWD/bin/raku-kb-mcp.mjs"
For a client other than Claude Code, point it at the same file:
{
"mcpServers": {
"raku-kb": {
"command": "node",
"args": ["/path/to/raku-kb-mcp/bin/raku-kb-mcp.mjs"]
}
}
}
What the server gives
| Tool | You give it | You get back |
|---|---|---|
raku_kb_search | query, limit | matching pages: url, title, section, snippet |
raku_kb_page | a url or path | the text of that page |
raku_kb_sections | nothing | top-level sections with page counts |
Search finds the page. raku_kb_page opens it. Together they let the agent
answer from a document you can then open yourself.
Check it worked
Ask your agent something that needs more than one file:
How does an action class share state between rules in a Raku grammar?
A working answer looks like this:
Search returns a handful of hits, with
/doc/language/grammarsamong the first.The answer sits under "Always succeed" assertion, a subsection of Special tokens ā not under the sections whose names sound closer.
The example to look at is
Digifierwith itsDevanagariaction class: it declareshas @!numbers, and both thedigitandsuccmethods write to it. That is the shared state.Attributes in grammars, further down, states the neighbouring limit: grammar attributes are reachable only from methods, and changing one inside a method called from a token changes it for that token's own match object alone.
If your agent names the page and the section, the server is connected. If it answers without naming a source, it is answering from memory ā which is the thing this server exists to replace.
Or hand it the whole check at once ā paste this:
Use the raku-kb MCP server to answer this, and answer only from it: how does an
action class share state between rules in a Raku grammar? Give me the page url
you used, the section the answer came from, and quote the passage you are
relying on. If the collection does not hold the answer, say so instead of
filling it in.
The last two sentences carry the weight. Asking for the url, the section and the
quoted passage is how you tell a sourced answer from a remembered one; asking it
to say when the collection comes up empty is how you find the edges of what it
holds. Ask for a quote rather than line numbers: raku_kb_page returns the text
of a page, not numbered lines.
One note if you script the check instead of typing it. A client running without
a person to approve tool calls may refuse to reach the server at all and report
that it cannot answer. That is the approval policy, not the collection. In Codex,
--approve-for-me is what let the call through.
What is in the collection, and how fresh
What the server reads is the document collection available through it: the official Raku documentation, module documentation from both ecosystems, and the examples repository. It does not necessarily include every page on this site, and it holds nothing about other languages. Ask the server for its sections and it will tell you how many pages each holds ā that count is the honest one, because it comes from the index the server actually reads.
Do not read a miss as an absence: if this service does not find something, that is a fact about the collection, not about Raku.
The bundled index is a snapshot taken when the data release was cut. It can therefore trail the live site by up to a month, and that is deliberate: the offline bundle follows the data channel, the website follows its own.
To find out what you have, ask for the sections ā the counts move with each
rebuild. To move forward, download a newer data- release and unpack it over
the old directory.
Why this is possible here
The knowledge base is written in Podlite, so every page keeps its structure through the build: sections stay sections, and a search hit can be traced back to the document it came from. The same markup that publishes the site feeds the index the server reads.
If you want your agent to handle Podlite documents of your own ā parse them, check them, query them ā there is a separate kit for that: Podlite for your agent. This page hands over a document collection; that one hands over a parser.