of-mcp
Provides tools for searching, retrieving, and navigating the Open Finance Brasil documentation hosted on Confluence, including page content, sections, and contextual answers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@of-mcpcomo funciona consentimento recorrente?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
of-mcp — Open Finance Brasil docs as an MCP server
A local MCP server that turns the public Confluence space at
openfinancebrasil.atlassian.net/wiki/spaces/OF into four tools any
MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.) can call:
Tool | What it returns |
| Top BM25 chunks (compact snippets + page id + URL) |
| Full markdown of one page; optional |
| Page tree (root pages, or children of a page id) |
| Verbose RAG context (full chunks + citations) for the host LLM to answer |
Why this design (token economy)
No embeddings. SQLite FTS5 (BM25) is local, instantaneous, and costs zero tokens. For keyword-heavy technical docs this is usually as good as semantic search. Optional
[semantic]extra is left as a hook if you need re-ranking.Heading-based chunks (~300 tokens).
search_docsreturns 6 small snippets by default — typically a few hundred tokens total — instead of whole pages.No internal LLM call.
answer_questionreturns the context, the calling assistant does the synthesis in its own context window. Avoids paying twice.
Setup
git clone <this-folder> of-mcp
cd of-mcp
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
cp .env.example .env # optional — defaults are fineNo Atlassian account or token needed. The OF Confluence space is public,
and the crawler hits the REST API anonymously. The ATLASSIAN_EMAIL /
ATLASSIAN_API_TOKEN variables in .env.example exist only as a fallback
in case Atlassian ever restricts the space — leave them empty.
Build the index
of-mcp-crawl # full crawl, incremental on subsequent runs
of-mcp-crawl --force # re-index every page
of-mcp-reindex # re-chunk from cached pages, no networkThe index lives in ./data/of.db (SQLite + FTS5).
Wire it up to Claude Desktop / Claude Code
Add this to your MCP client config (e.g. ~/.config/claude/claude_desktop_config.json):
{
"mcpServers": {
"of-mcp": {
"command": "/absolute/path/to/of-mcp/.venv/bin/of-mcp",
"env": {
"OF_MCP_DB_PATH": "/absolute/path/to/of-mcp/data/of.db"
}
}
}
}For Claude Code:
claude mcp add of-mcp /absolute/path/to/of-mcp/.venv/bin/of-mcpRestart the client. You should see the four tools available.
Usage examples
In your MCP-enabled chat:
use
search_docswith query "iniciação de pagamento erros 422"open the page returned and read the "Erros" section using
get_pageuse
answer_questionfor "como funciona consentimento recorrente?"
Project layout
of-mcp/
├── pyproject.toml
├── .env.example
├── README.md
├── data/ # SQLite index lives here (gitignored)
└── src/of_mcp/
├── server.py # FastMCP server + tool definitions
├── crawler.py # Confluence REST client + crawl orchestrator
├── chunker.py # HTML → Markdown → heading chunks
├── search.py # BM25 wrapper + output formatters
├── db.py # SQLite schema + FTS5 triggers
├── config.py # env loader
└── scripts/
├── crawl.py # `of-mcp-crawl` entrypoint
└── reindex.py # `of-mcp-reindex` entrypointRe-indexing on a schedule
The crawler is incremental (skips pages whose Confluence version is
unchanged), so a daily cron is cheap:
30 4 * * * cd /path/to/of-mcp && .venv/bin/of-mcp-crawl >> crawl.log 2>&1License
MIT — do whatever you want, but the OF documentation itself belongs to the Open Finance Brasil structure governance.
Available Tools
4 toolsanswer_questionA
Retrieve the most relevant chunks formatted as RAG context.
The MCP itself does NOT call an LLM — it returns the raw context plus citations so the calling assistant can answer using its own context window (saving tokens vs. running a second model here).
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | ||
| max_chunks | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Clearly discloses it does NOT call an LLM and returns raw context plus citations, which is beyond the basic read operation. With no annotations, the description effectively communicates behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with no redundancy. The key behavioral distinction is front-loaded, and every word adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Provides a clear overview but lacks parameter details, especially for max_chunks. While output schema exists and siblings are given, the description could elaborate on how chunks are selected or the format of citations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, and the description does not explain the parameters (question, max_chunks) beyond the implicit context. The default value of max_chunks is not mentioned, nor is the relationship between parameters and output.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves relevant chunks formatted as RAG context, distinguishing it from siblings like get_page, list_sections, and search_docs. It specifies it does not call an LLM, clarifying its role in the pipeline.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly explains the tool's purpose as providing raw context for the calling assistant, saving tokens by avoiding a second model call. However, it does not explicitly state when to avoid using it or mention alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_pageA
Return the full markdown of a page.
Args: page_ref: Confluence page id, exact title, or substring of the title. section: Optional heading text. If provided, only the matching section (and its sub-sections) is returned.
| Name | Required | Description | Default |
|---|---|---|---|
| page_ref | Yes | ||
| section | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool returns markdown content and optionally a section, but lacks details on permissions, rate limits, or error handling. Adequate for a simple read operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: one sentence for purpose, then clear bullet-like Args. Every sentence adds value with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and the presence of an output schema, the description fully covers what the agent needs to know. Parameter details are clear, and no additional behavioral context is necessary.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant meaning beyond the schema: page_ref accepts id, exact title, or substring; section is optional heading text to filter. This enriches the agent's understanding for correct invocation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (return) and resource (full markdown of a page). It distinguishes from siblings like list_sections (only sections) and search_docs (searching), as the name and description imply a specific retrieval function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains how to use the tool (page_ref can be id, title, or substring) and optional section filtering. It does not explicitly state when to use alternatives, but the sibling context and parameter semantics make it clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_sectionsA
List pages in the documentation tree.
Args: parent_id: If omitted, returns root pages of the OF space. Otherwise returns immediate children of the given page id.
| Name | Required | Description | Default |
|---|---|---|---|
| parent_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden. It discloses the hierarchical behavior (root vs children) but does not mention pagination, ordering, or potential side effects. The behavior is adequately described for a simple list operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences, no superfluous words, and the key information is front-loaded. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity (1 optional parameter, no annotations, output schema exists), the description is nearly complete. It covers the essential behavior. Minor omission: no mention of error handling or invalid IDs, but acceptable for this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With schema description coverage at 0%, the description fully explains the sole parameter parent_id, including its default behavior and effect on output. This adds significant meaning beyond the schema's type-only definition.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List pages in the documentation tree', using a specific verb and resource. It is easily distinguishable from sibling tools like get_page, search_docs, and answer_question.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to omit parent_id (returns root pages) and when to provide it (returns immediate children), giving clear usage context. However, it does not explicitly mention when not to use this tool or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_docsA
Search the Open Finance Brasil docs (BM25). Returns compact snippets.
Args: query: Natural-language query in Portuguese or English. limit: Max number of hits (default 6, hard-capped at 20).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden. It mentions BM25 search and compact snippets, but lacks details about whether it is read-only, any rate limits, or what the snippets contain beyond referring to an output schema. Minimal behavioral context beyond the core action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (3 sentences), front-loaded with the main purpose, and the Args block is efficiently formatted. Every sentence serves a purpose without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, the description covers parameters and basic behavior well. However, it lacks guidance on when to use this tool versus siblings like 'get_page' or 'list_sections', and does not mention the scope of the search (e.g., all docs or a subset). Minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description's parameter explanations add significant value: 'query' is natural-language in Portuguese/English, 'limit' has a default of 6 and a hard cap of 20. This fully compensates for the missing schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Search the Open Finance Brasil docs (BM25). Returns compact snippets.' It specifies the search algorithm and output format, and the tool name 'search_docs' combined with sibling tools like 'get_page' and 'list_sections' helps distinguish its purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains the parameters and their usage (query in Portuguese/English, limit with default and cap), but does not provide explicit guidance on when to use this tool versus siblings like 'get_page' or 'answer_question'. Usage is implied but not explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
answer_question - First observed
get_page - First observed
list_sections - First observed
search_docs
TDQS
Scored across 4 tools
Each tool serves a distinct purpose: answer_question returns RAG context, get_page retrieves full page markdown, list_sections navigates the doc tree, and search_docs performs keyword search. No overlap in functionality.
All tools follow a consistent verb_noun snake_case pattern (answer_question, get_page, list_sections, search_docs), making it easy to infer their actions.
With 4 tools, the server is well-scoped for documentation retrieval and search. Each tool earns its place, covering essential operations without unnecessary bloat.
The tool set covers the full lifecycle of documentation access: search (search_docs), context retrieval (answer_question), page content (get_page), and navigation (list_sections). No obvious gaps.
Related MCP Connectors
MCP server for querying Forkast documentation
Query any docs site via MCP. Submit a URL, ask questions, get cited answers.
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
- docs2mcpOAuthcom.docs2mcp
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.