AI Tools
MCP server, llms.txt, and markdown endpoints that let AI agents read, search, and integrate Bora Pesa.
Bora Pesa is built to be integrated by AI coding agents as well as humans. Three complementary surfaces expose the same documentation:
- MCP server (
@borapesa/mcp): searchable docs, provider registry, and code examples inside your agent - llms.txt endpoints: the whole site as plain markdown over HTTPS
- AGENTS.md: contributor conventions for agents working inside the repository
MCP server
The Model Context Protocol server ships the full documentation snapshot inside the package, so it works offline and stays versioned with each release. Once connected, your agent can answer provider questions, look up config fields, and pull runnable examples while it writes your integration.
Tools
| Tool | What it does |
|---|---|
search_docs | Keyword search across all guides and API reference pages |
get_doc | Read any docs page as markdown |
list_docs | List every page with title and description |
list_providers | Compare Selcom, AzamPay, ClickPesa, Snippe, and the Bogus test provider |
get_provider | Config fields, capabilities, and webhook verification notes for one provider |
get_example | Runnable TypeScript for quickstart, webhooks, events, disbursement, and more |
Every docs page is also exposed as an MCP resource under borapesa://docs/<path>.
Claude Code
claude mcp add borapesa -- npx -y @borapesa/mcpOr check a .mcp.json into your project root so every contributor's agent picks it up:
{
"mcpServers": {
"borapesa": {
"command": "npx",
"args": ["-y", "@borapesa/mcp"]
}
}
}Cursor
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"borapesa": {
"command": "npx",
"args": ["-y", "@borapesa/mcp"]
}
}
}VS Code (GitHub Copilot)
Add to .vscode/mcp.json:
{
"servers": {
"borapesa": {
"command": "npx",
"args": ["-y", "@borapesa/mcp"]
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"borapesa": {
"command": "npx",
"args": ["-y", "@borapesa/mcp"]
}
}
}The server runs locally over stdio and makes no network calls. It bundles the docs that shipped with its release, so pin the package version if you want docs matching an older SDK version.
llms.txt endpoints
For agents that fetch over HTTPS instead of MCP, the site follows the llms.txt convention:
| URL | Contents |
|---|---|
/llms.txt | Index of every page with absolute markdown links |
/llms-full.txt | The entire documentation in a single file |
/llms/<path>/index.md | Any single page as markdown |
Examples:
https://borapesa.dev/llms/getting-started/index.md
https://borapesa.dev/llms/errors/index.md
https://borapesa.dev/llms/api/pesa/functions/createPesa/index.mdEvery docs page also has a copy-as-markdown button in its header, and the same content is linked for crawlers via robots.txt and sitemap.xml.
AGENTS.md
The repository root carries an AGENTS.md with the conventions agents must follow when contributing: whole-integer TZS amounts, MSISDN phone validation, extensionless imports, Biome formatting, and the test coverage bar. If you point a coding agent at the repo, it reads this file automatically.
Prompting tips
When asking an agent to integrate Bora Pesa, a prompt like this works well once the MCP server is connected:
Add mobile money checkout to this app using @borapesa/pesa with the ClickPesa
provider. Use the borapesa MCP tools to check provider config fields and copy
the webhook mounting pattern for my framework.Useful facts agents should know (all enforced by SDK validation):
- Amounts are whole TZS integers:
15000means TZS 15,000. Floats are rejected. - Phone numbers use MSISDN format
255XXXXXXXXX. Local07XXnumbers are rejected. - Only
provideris required increatePesa(). The event store defaults to in-memory. pesa.mountWebhookis a standard fetch handler servingPOST {basePath}/webhook,basePathdefaults to/pesa.- All provider calls are server-side. Never expose credentials to the browser.