Skip to main content

mcp-okf

Servidor MCP que transforma um bundle OKF (pasta com index.md e um .md por documento, como o gerado pela alm-sync do mcp-alm) numa base de conhecimento consultável em linguagem natural.

  • Índice: um arquivo SQLite por bundle (sem servidor, vários processos podem abrir): FTS5 (BM25) + vetores densos com cosseno por força bruta (numpy), fusão RRF.
  • Embeddings: fastembed local, paraphrase-multilingual-MiniLM-L12-v2 (PT-BR, ~220 MB); nada sai da máquina.
  • Links: links do frontmatter (nomes do DOORS Next), links do corpo para outros arquivos do bundle (cita) e URL do ALM de artefato que está no bundle; saída e entrada na leitura.
  • Visualização: okf_export_html grava okf.html no bundle: grafo 3D dos links, lista filtrável e cada documento renderizado (markdown formatado, links internos navegáveis).

Instalação

Requer o uv. Baixe o modelo uma vez, para a 1ª indexação não estourar o timeout do cliente MCP:

uvx --from mcp-okf python -c "from mcp_okf import store; store.embed(['x'])"

Configuração do cliente MCP (Kiro: ~/.kiro/settings/mcp.json ou .kiro/settings/mcp.json do projeto):

{
  "mcpServers": {
    "okf": {
      "command": "uvx",
      "args": ["mcp-okf@latest"],
      "env": { "UV_SYSTEM_CERTS": "true" }
    }
  }
}

Claude Code: claude mcp add okf -- uvx mcp-okf@latest.

Dados em ~/.config/mcp-okf/ (%APPDATA%\mcp-okf no Windows; ou MCP_OKF_HOME): <sha1(root)>.db por bundle. Nada é gravado no bundle, exceto o okf.html quando pedido. Vindo da 0.2: pode apagar qdrant/ e state/ dessa pasta (o enriquecimento pela LLM saiu; reindexe com okf_index).

Tools

root é sempre o caminho absoluto do bundle.

Tool Parâmetros Devolve
okf_index root, limit=200, force=False {documentos, indexados, removidos, restantes}; incremental por sha256; chame até restantes=0
okf_search root, query, limit=8, folder?, type? [{path, id, title, type, folder, score, trechos: [{section, text}]}]
okf_list_documents root, folder?, type? [{path, id, title, type, folder, description, indexado}]
okf_get_document root, ref (path ou id) {path, markdown, links: {saida, entrada}}
okf_export_html root {arquivo, documentos, links}; grava <root>/okf.html (bibliotecas via CDN)

Fluxo: okf_index até restantes=0 → perguntas com okf_search e okf_get_document. Depois de um novo sincronismo da alm-sync, rode okf_index de novo: só o que mudou é reindexado.

Como indexa

Cada documento vira chunks (corpo dividido por heading #..###, seções longas por parágrafo; cada chunk leva o prefixo <tipo> <id> — <título> | <pasta> | <seção>), gravados com o vetor e no FTS5. A busca funde o ranking denso e o BM25 (RRF) e agrupa por documento.

Testes

uv run pytest

Os testes usam um SQLite temporário e embeddings falsos (não baixam modelo).

Metadata

Release files for mcp-okf 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-okf 1.0.4
File Size Uploaded Provenance Actions
mcp_okf-1.0.4.tar.gz 18.3 kB Without provenance Details for mcp_okf-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-okf 1.0.4
File Interpreter ABI Platform Actions
mcp_okf-1.0.4-py3-none-any.whl Python 3 none any Details for mcp_okf-1.0.4-py3-none-any.whl

Total release size: 36.2 kB

Release files / mcp_okf-1.0.4.tar.gz

Download URL mcp_okf-1.0.4.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5d327a77e0e0620eebfdf2ce210ff53f31dfd2d34dae4a63d5c31b45c3feef46
BLAKE2b-256 checksum
How to use checksums
e8cf831f19600c47219214c7cf4c476f9a877112a9b336e7efd87f46771dfed7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mcp_okf-1.0.4-py3-none-any.whl

Download URL mcp_okf-1.0.4-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8413224ef83fa80689981d98984087da0fc39c34b9bc274c8130cb8faeb25c14
BLAKE2b-256 checksum
How to use checksums
859e5a2a92a38e10f673546f36525e26792d9a68c802313d72203cf469d6e3c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mcp-okf 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page