API documentation
MCP over HTTP transport for automations and compatible clients.
Endpoint
https://mcp.rkm-next.com.br/mcp
Authentication: Authorization: Bearer your personal key
Protocol: JSON-RPC 2.0
For guided setup, download the Next Installer from /conectar: it installs dependencies and registers Claude Code/Codex with your key.
Images
Search returns figures from documents, including PDF, Office files, and standalone images. The AI opens the figure with the next_get_image tool.
next_get_image
Search
next_search
Searches the served corpus and returns handles, snippets, modality, and stable locator.
Arguments
{"n_results": 5, "query": "como conectar o Claude?"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"degraded\": false, \"query\": \"como conectar o Claude?\", \"results\": [{\"handle\": \"ev_123\", \"modality\": \"text\", \"snippet\": \"...\", \"stable_locator\": \"doc.md#L10\"}], \"sidecanal\": null}", "type": "text"}], "isError": false, "structuredContent": {"degraded": false, "query": "como conectar o Claude?", "results": [{"handle": "ev_123", "modality": "text", "snippet": "...", "stable_locator": "doc.md#L10"}], "sidecanal": null}}}next_list_documents
Lists the documents the key can see, newest first, with path, area, last update and size; filters by area or folder and pages with the cursor.
Arguments
{"area": "empresa/politicas", "limite": 2}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"documentos\": [{\"area\": \"empresa/politicas\", \"atualizado_em\": \"2026-10-03T14:20:00Z\", \"caminho\": \"_empresa/politicas/reembolso-despesas.md\", \"datas_do\": \"arquivo\", \"origem\": \"empresa\", \"tamanho_bytes\": 18432, \"titulo\": \"reembolso-despesas.md\"}, {\"area\": \"empresa/politicas\", \"atualizado_em\": \"2026-09-28T09:05:00Z\", \"caminho\": \"_empresa/politicas/ferias-e-folgas.pdf\", \"datas_do\": \"arquivo\", \"origem\": \"empresa\", \"tamanho_bytes\": 254310, \"titulo\": \"ferias-e-folgas.pdf\"}], \"limite\": 2, \"proximo_cursor\": \"2\", \"total\": 7}", "type": "text"}], "isError": false, "structuredContent": {"documentos": [{"area": "empresa/politicas", "atualizado_em": "2026-10-03T14:20:00Z", "caminho": "_empresa/politicas/reembolso-despesas.md", "datas_do": "arquivo", "origem": "empresa", "tamanho_bytes": 18432, "titulo": "reembolso-despesas.md"}, {"area": "empresa/politicas", "atualizado_em": "2026-09-28T09:05:00Z", "caminho": "_empresa/politicas/ferias-e-folgas.pdf", "datas_do": "arquivo", "origem": "empresa", "tamanho_bytes": 254310, "titulo": "ferias-e-folgas.pdf"}], "limite": 2, "proximo_cursor": "2", "total": 7}}}next_get_document
Opens the document cited by the handle returned from search.
Arguments
{"handle": "ev_123"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"byte_range\": [10, 23], \"content\": \"trecho citado\", \"content_bytes\": 13, \"content_handle\": \"sha256:abc\", \"handle\": \"ev_123\", \"locator\": \"doc.md#L10\", \"reproduz\": true, \"source\": \"doc.md\"}", "type": "text"}], "isError": false, "structuredContent": {"byte_range": [10, 23], "content": "trecho citado", "content_bytes": 13, "content_handle": "sha256:abc", "handle": "ev_123", "locator": "doc.md#L10", "reproduz": true, "source": "doc.md"}}}next_get_image
Shows the indexed figure or image by the figura_id returned by search or the document.
Arguments
{"figura_id": "9999999999999999999999999999999999999999999999999999999999999999", "tamanho": "miniatura"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"bytes\": 2048, \"figura_id\": \"9999999999999999999999999999999999999999999999999999999999999999\", \"mime\": \"image/jpeg\", \"pagina\": 1, \"source\": \"relatorio-vendas.pdf\", \"tamanho\": \"miniatura\"}", "type": "text"}], "isError": false, "structuredContent": {"bytes": 2048, "figura_id": "9999999999999999999999999999999999999999999999999999999999999999", "mime": "image/jpeg", "pagina": 1, "source": "relatorio-vendas.pdf", "tamanho": "miniatura"}}}next_domains
Lists the domains available in the served corpus.
Arguments
{}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"domains\": [\"bling\", \"sefaz\", \"synflux\"]}", "type": "text"}], "isError": false, "structuredContent": {"domains": ["bling", "sefaz", "synflux"]}}}next_stats
Shows counts for the served index.
Arguments
{}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"indexing\": false, \"status\": \"ok\", \"total_chunks\": 340, \"total_documents\": 12}", "type": "text"}], "isError": false, "structuredContent": {"indexing": false, "status": "ok", "total_chunks": 340, "total_documents": 12}}}Corpus graph
graphify_stats
Gives an overview of the structural graph: nodes, edges, density, communities, and hubs.
Arguments
{}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"comunidades\": 41, \"edges\": 1974, \"edges_por_relacao\": {\"pertence_a\": 836, \"referencia\": 1138}, \"generation_id\": \"g_2026_09_05\", \"grau_medio\": 4.77, \"maior_comunidade\": 96, \"natureza\": \"estrutural: documento, pasta e link markdown (nao e grafo de conceitos)\", \"nodes\": 828, \"nodes_por_tipo\": {\"documento\": 792, \"pasta\": 36}, \"ontology_release\": \"estrutura@1\", \"orfaos\": 12, \"top_hubs\": [{\"grau\": 63, \"node\": \"sefaz/nfe/layout-4.00.md\"}, {\"grau\": 41, \"node\": \"bling/webhooks.md\"}]}", "type": "text"}], "isError": false, "structuredContent": {"comunidades": 41, "edges": 1974, "edges_por_relacao": {"pertence_a": 836, "referencia": 1138}, "generation_id": "g_2026_09_05", "grau_medio": 4.77, "maior_comunidade": 96, "natureza": "estrutural: documento, pasta e link markdown (nao e grafo de conceitos)", "nodes": 828, "nodes_por_tipo": {"documento": 792, "pasta": 36}, "ontology_release": "estrutura@1", "orfaos": 12, "top_hubs": [{"grau": 63, "node": "sefaz/nfe/layout-4.00.md"}, {"grau": 41, "node": "bling/webhooks.md"}]}}}graphify_query
From a question, walks the graph and returns the neighborhood of the documents found.
Arguments
{"depth": 2, "question": "webhook do Bling"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"depth\": 2, \"hops\": [{\"de\": \"bling/webhooks.md\", \"para\": \"bling/autenticacao.md\", \"relacao\": \"referencia\"}, {\"de\": \"bling/webhooks.md\", \"para\": \"bling/pedidos.md\", \"relacao\": \"referencia\"}], \"nodes\": [\"bling/webhooks.md\", \"bling/autenticacao.md\", \"bling/pedidos.md\"], \"origem_das_sementes\": \"busca\", \"question\": \"webhook do Bling\", \"relacoes_seguidas\": [\"referencia\"], \"seeds\": [\"bling/webhooks.md\"], \"total_hops\": 2}", "type": "text"}], "isError": false, "structuredContent": {"depth": 2, "hops": [{"de": "bling/webhooks.md", "para": "bling/autenticacao.md", "relacao": "referencia"}, {"de": "bling/webhooks.md", "para": "bling/pedidos.md", "relacao": "referencia"}], "nodes": ["bling/webhooks.md", "bling/autenticacao.md", "bling/pedidos.md"], "origem_das_sementes": "busca", "question": "webhook do Bling", "relacoes_seguidas": ["referencia"], "seeds": ["bling/webhooks.md"], "total_hops": 2}}}graphify_path
Finds the shortest path between two documents or folders in the graph.
Arguments
{"a": "bling/webhooks.md", "b": "sefaz/nfe/layout-4.00.md"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"a\": \"bling/webhooks.md\", \"b\": \"sefaz/nfe/layout-4.00.md\", \"caminho\": [\"bling/webhooks.md\", \"bling/integracao-fiscal.md\", \"sefaz/nfe/index.md\", \"sefaz/nfe/layout-4.00.md\"], \"encontrado\": true, \"relacoes\": [\"referencia\", \"referencia\", \"pertence_a\"], \"saltos\": 3}", "type": "text"}], "isError": false, "structuredContent": {"a": "bling/webhooks.md", "b": "sefaz/nfe/layout-4.00.md", "caminho": ["bling/webhooks.md", "bling/integracao-fiscal.md", "sefaz/nfe/index.md", "sefaz/nfe/layout-4.00.md"], "encontrado": true, "relacoes": ["referencia", "referencia", "pertence_a"], "saltos": 3}}}graphify_explain
Shows the immediate surroundings of a node: its neighbors and the relation of each edge.
Arguments
{"node": "sefaz/nfe/layout-4.00.md"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"grau\": 63, \"node\": \"sefaz/nfe/layout-4.00.md\", \"tipo\": \"documento\", \"vizinhos\": [{\"direcao\": \"saida\", \"no\": \"sefaz/nfe/regras-validacao.md\", \"relacao\": \"referencia\"}, {\"direcao\": \"entrada\", \"no\": \"sefaz/nfe\", \"relacao\": \"pertence_a\"}]}", "type": "text"}], "isError": false, "structuredContent": {"grau": 63, "node": "sefaz/nfe/layout-4.00.md", "tipo": "documento", "vizinhos": [{"direcao": "saida", "no": "sefaz/nfe/regras-validacao.md", "relacao": "referencia"}, {"direcao": "entrada", "no": "sefaz/nfe", "relacao": "pertence_a"}]}}}graphify_get_node
Returns metadata and provenance of a node: type, degree, community, and source.
Arguments
{"label": "bling/webhooks.md"}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"comunidade\": \"com_07\", \"confidence\": {\"kind\": \"structural\", \"method\": \"markdown-link\", \"score\": 1.0}, \"generation_id\": \"g_2026_09_05\", \"grau\": 41, \"label\": \"bling/webhooks.md\", \"n_provenance_refs\": 2, \"provenance_refs\": [\"sha256:9f2a\", \"sha256:1c7d\"], \"revision\": 3, \"tipo\": \"documento\"}", "type": "text"}], "isError": false, "structuredContent": {"comunidade": "com_07", "confidence": {"kind": "structural", "method": "markdown-link", "score": 1.0}, "generation_id": "g_2026_09_05", "grau": 41, "label": "bling/webhooks.md", "n_provenance_refs": 2, "provenance_refs": ["sha256:9f2a", "sha256:1c7d"], "revision": 3, "tipo": "documento"}}}graphify_god_nodes
Lists the structural hubs of the corpus: the most connected nodes by degree.
Arguments
{"n": 5}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"criterio\": \"grau (entrada + saida) no grafo estrutural\", \"hubs\": [{\"grau\": 63, \"node\": \"sefaz/nfe/layout-4.00.md\", \"tipo\": \"documento\"}, {\"grau\": 41, \"node\": \"bling/webhooks.md\", \"tipo\": \"documento\"}, {\"grau\": 38, \"node\": \"synflux\", \"tipo\": \"pasta\"}]}", "type": "text"}], "isError": false, "structuredContent": {"criterio": "grau (entrada + saida) no grafo estrutural", "hubs": [{"grau": 63, "node": "sefaz/nfe/layout-4.00.md", "tipo": "documento"}, {"grau": 41, "node": "bling/webhooks.md", "tipo": "documento"}, {"grau": 38, "node": "synflux", "tipo": "pasta"}]}}}graphify_community
Lists the members of a graph community, by id or by rank.
Arguments
{"rank": 0}Example response
{"id": 1, "jsonrpc": "2.0", "result": {"content": [{"text": "{\"community_id\": \"com_07\", \"membros\": [\"bling/webhooks.md\", \"bling/autenticacao.md\", \"bling/pedidos.md\"], \"rank\": 0, \"tamanho\": 96, \"truncado\": false}", "type": "text"}], "isError": false, "structuredContent": {"community_id": "com_07", "membros": ["bling/webhooks.md", "bling/autenticacao.md", "bling/pedidos.md"], "rank": 0, "tamanho": 96, "truncado": false}}}Prerequisites
Claude Code · Windows (PowerShell)
irm https://claude.ai/install.ps1 | iexIf the installer says .local\bin is not in PATH, run this line and reopen the terminal.
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path","User") + ";$env:USERPROFILE\.local\bin", "User")Then close and reopen the terminal, and check with claude --version.Claude Code · Mac and Linux (Terminal)
curl -fsSL https://claude.ai/install.sh | bashDo not use it on Windows: there this command fails with “bash is not recognized”. On Windows, use the installer or the Windows (PowerShell) block.Then close and reopen the terminal, and check with claude --version.
Codex · Windows (PowerShell)
npm install -g @openai/codexRequires Node.js 18+ (nodejs.org). Check with codex --version.
Codex · Mac and Linux (Terminal)
npm install -g @openai/codexRequires Node.js 18+ (nodejs.org). Check with codex --version.
If you see 'not recognized as a command', the program is not installed or the terminal was opened before installation.
Errors
401 without a key · 403 revoked key · ferramenta_indisponivel_neste_transporte
Kits
Claude Code
claude mcp add -s user --transport http next https://mcp.rkm-next.com.br/mcp --header "Authorization: Bearer YOUR_KEY"
Codex · Windows (PowerShell)
$env:NEXT_TOKEN = "YOUR_KEY" setx NEXT_TOKEN "YOUR_KEY" codex mcp add next --url https://mcp.rkm-next.com.br/mcp --bearer-token-env-var NEXT_TOKEN
Codex · Mac and Linux (Terminal)
export NEXT_TOKEN="YOUR_KEY" codex mcp add next --url https://mcp.rkm-next.com.br/mcp --bearer-token-env-var NEXT_TOKEN
HTTP curl
curl -X POST https://mcp.rkm-next.com.br/mcp -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" -d "@pergunta.json"
pergunta.json
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"next_search","arguments":{"query":"..."}}}