Skip to main content
Glama

Knowledge MCP

Um Knowledge Engine para projetos de software: entrega contexto relevante no início de uma tarefa e acumula conhecimento ao final dela. Não é uma memória — a inteligência de decidir o que é relevante e o que merece ser lembrado fica dentro do MCP, não no cliente.

Estado atual

Fase

Escopo

Status

0

Spike técnico das dependências

✅ concluída

1

Núcleo de arquivos (.knowledge/)

✅ concluída

2

KnowledgeStore, IndexBackend, KnowledgeIndexer + contrato

✅ concluída

3

As 5 tools + extractor, sobre backend em memória

✅ concluída

4

Backend Graphiti (recuperação semântica)

✅ concluída

5

Empacotamento e integração

✅ concluída

O MVP é utilizável de ponta a ponta, validado por E2E real através do protocolo MCP.

Related MCP server: Claude Habitat

Os dois backends de índice

O padrão é graphiti: recuperação semântica é o desenho pretendido do produto. Se o Neo4j não estiver no ar, o sistema degrada sozinho para a fonte de verdade — sem erro e sem lentidão (um disjuntor evita repetir o timeout de conexão).

graphiti (padrão)

memory

Recuperação

semântica (resolve sinônimos)

lexical, com casamento por prefixo

Infraestrutura

Neo4j local (sem Docker)

nenhuma

LLM por gravação

2 chamadas, em background

nenhum

Relacionamentos entre registros

sim (grafo de entidades e fatos)

não

Para subir o Neo4j:

scripts\start-neo4j.cmd

Ele não inicia sozinho com o Windows. Com ele parado, remember, search e context continuam funcionando pela fonte de verdade — só a recuperação semântica fica indisponível, e as tools avisam.

Com assinatura Pro/Max, as chamadas de LLM não são cobradas por token — consomem as janelas de limite do plano. O valor em dólar que o SDK reporta é estimado a preços de tabela da API e serve como proxy de consumo, não como fatura.

Quanto você espera (medido, backend graphiti)

Operação

Tempo

remember

17–27 ms

search, context, start_task

20–50 ms

primeira busca da sessão

~3 s (carrega o modelo na memória)

indexação no grafo

16 s por registro, em background

Você nunca espera pela indexação: remember grava o arquivo e devolve. O grafo alcança depois, e enquanto isso a busca funciona pela fonte de verdade (ADR-004).

O modelo de embedding (~1 GB) é baixado uma vez por máquina, em %LOCALAPPDATA%\knowledge-mcp\models, e compartilhado por todos os projetos.

Com memory, buscar "login" não encontra um registro sobre "autenticação". Com graphiti, encontra — é o que tests/test_semantic_recall.py verifica.

Para ligar o backend semântico:

set KNOWLEDGE_MCP_INDEX=graphiti
set KNOWLEDGE_MCP_NEO4J_PASSWORD=sua-senha

Se o Neo4j estiver fora do ar, o sistema continua lendo, escrevendo e buscando pela fonte de verdade — só perde a recuperação semântica.

As cinco tools

Tool

O quê

Escreve?

start_task

Contexto relevante antes de começar uma tarefa

não

context

Consulta livre ao conhecimento do projeto

não

finish_task

Sugere o que merece virar conhecimento permanente

não

remember

Grava o conhecimento aprovado

sim

search

Procura no conhecimento registrado

não

O fluxo de escrita é sempre finish_task → o usuário aprova → remember. O MCP não guarda estado de aprovação: ela vive na conversa (ADR-006).

Arquitetura em uma tela

KnowledgeRepository     único autorizado a escrever em .knowledge — fonte de verdade
        │
        ▼
KnowledgeIndexer        sincroniza .knowledge com o índice; fila, hashes, rebuild
        │
        ▼
KnowledgeStore          apenas consulta: busca, relacionamentos, contexto
        │
        ▼
Graphiti                detalhe de implementação, substituível

As decisões estruturais estão em docs/adr/ e são verificadas mecanicamente por testes em tests/test_architecture_rules.py — uma violação quebra o build, não só a convenção.

Princípios

  1. É melhor deixar de registrar um conhecimento do que registrar um conhecimento incorreto. Precisão importa mais que cobertura.

  2. A fonte de verdade é o .knowledge/. O índice é reconstruível.

  3. Evitar modelagem prematura. Campo, estado ou operação só entra quando houver caso real.

  4. O índice é uma aceleração, não uma dependência funcional. Sem o backend de índice, o sistema continua lendo, escrevendo e buscando — só perde qualidade de recuperação.

O formato .knowledge/

.knowledge/
  manifest.yaml       versão do schema, projeto, configuração do índice
  decisions/          um diretório por tipo de registro
  entities/
  preferences/
  conventions/
  technologies/
  summaries/
  cache/              descartável e não versionado (índice, grafo, embeddings)

Cada registro é Markdown com frontmatter de exatamente quatro campos:

---
id: dec-20260731-adiar-a-escolha-do-backend-de-grafo
type: decision
title: Adiar a escolha do backend de grafo
created_at: 2026-07-31
---
**Contexto:** ...
**Decisão:** ...
**Consequências:** ...

O id é a identidade do registro; o caminho do arquivo é detalhe de armazenamento. Renomear ou mover o arquivo à mão não cria um registro novo.

O formato é deliberadamente aberto: qualquer ferramenta deve conseguir produzi-lo ou consumi-lo — scripts, outros MCPs, outras IDEs, ou o próprio desenvolvedor editando à mão.

Instalação

Requer Python 3.13 (o 3.14 ainda não tem wheels para parte das dependências de grafo) e o Claude Code autenticado — o MCP usa a sessão existente, sem chave de API separada.

py -3.13 -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"

Registrar no Claude Code

O servidor descobre a raiz do projeto pelo diretório de trabalho, então um registro global serve todos os seus projetos — cada um ganha seu próprio .knowledge/.

claude mcp add knowledge --scope user -- C:\Users\guilh\.virtualenvs\knowledge-mcp\Scripts\knowledge-mcp.exe

Para registrar só num projeto, crie um .mcp.json na raiz dele:

{
  "mcpServers": {
    "knowledge": {
      "command": "C:\\Users\\guilh\\.virtualenvs\\knowledge-mcp\\Scripts\\knowledge-mcp.exe"
    }
  }
}

Para apontar para um projeto fixo, independentemente do diretório de trabalho, defina a variável de ambiente KNOWLEDGE_MCP_PROJECT.

Verifique a conexão com:

claude -p "/mcp" --mcp-config .mcp.json

Como usar

O fluxo natural é conversacional — você não gerencia conhecimento:

  1. Ao começar algo, o agente chama start_task e recebe as decisões, regras e convenções que importam para aquela tarefa.

  2. Ao terminar, ele chama finish_task com um resumo. O MCP responde com uma sugestão do que merece ser lembrado — sem gravar nada.

  3. Você aprova (ou não) na conversa. Só então o agente chama remember.

search e context ficam disponíveis para consulta a qualquer momento.

Desenvolvimento

python -m pytest

Os testes em tests/test_architecture_rules.py verificam as decisões dos ADRs mecanicamente: escrever em .knowledge/ fora do repositório, ou importar graphiti_core fora de store/graphiti/, quebra o build.

Available Tools

5 tools
contextB

Consulta livre ao conhecimento do projeto, para quando a pergunta nao e o inicio de uma tarefa. Ex.: 'o que sabemos sobre autenticacao?'. Somente leitura.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations provided, so the description carries full responsibility for behavioral disclosure. It does state 'Somente leitura' (read-only), which covers the safety profile, but provides no detail about what the tool actually returns, whether it searches the whole codebase or specific docs, what scope its knowledge covers, or any limitations. Given zero annotation coverage, this is thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded, stating purpose and read-only nature in two concise clauses. However, it includes some filler phrasing ('Consulta livre ao conhecimento do projeto') and could be tightened. It's reasonably efficient but not maximally dense with useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a knowledge-consultation tool with an output schema but no annotations. With zero parameter documentation and minimal behavioral disclosure, the description leaves significant gaps: what kind of knowledge domain, what volume/format of output, whether it's code-aware or documentation-aware, and how it differs from 'search'. For a knowledge-query tool, the description should provide more context about its answer scope and nature.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and only one 'query' parameter, the description offers the example 'o que sabemos sobre autenticacao?' which implies the query is a natural-language question. However, it doesn't specify the expected format, language, or any constraints on the query beyond the example. The single simple parameter partially compensates, but the description adds minimal formal guidance about it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear purpose: free consultation of project knowledge, distinguished from task-initiation queries via the example 'o que sabemos sobre autenticacao?'. It clearly states read-only behavior. It distinguishes from siblings implicitly by noting this is for non-task queries, though it doesn't name specific sibling alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives an explicit usage context ('quando a pergunta nao e o inicio de uma tarefa') and provides a concrete example query. However, it doesn't explicitly say when NOT to use it or name alternative tools, though the sibling context (search, start_task) implies an alternative. The guidance is useful but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

finish_taskA

Chame ao TERMINAR uma tarefa, passando um resumo do que foi feito e decidido. Analisa o resumo e SUGERE o que merece virar conhecimento permanente. NAO grava nada. Apresente o resultado ao usuario e, somente se ele aprovar, chame remember com o change_set devolvido.

ParametersJSON Schema
NameRequiredDescriptionDefault
summaryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description explicitly states the tool does NOT write anything ('NAO grava nada') and requires user approval before calling `remember`, which is important behavioral transparency. However, no annotations are provided, so the description carries the full burden; it does not mention what the return/output looks like beyond the change_set being returned, and doesn't clarify side effects of the analysis itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, dense with information, no waste. The description packs purpose, workflow, non-persistence behavior, and the approval gate into a compact block. Slightly long but every sentence earns its place; the flow is clearly presented.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one string parameter and a rich workflow (analyze, suggest, get approval, call remember), the description covers the key behavioral elements. The output schema exists, so return format needn't be detailed. It could mention error cases or what happens if analysis yields nothing, but overall it's fairly complete for this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description fully carries the burden for parameter meaning. It explains that `summary` should be a summary of what was done and decided, which adds meaningful context. With only one parameter and this explanation, the guidance is adequate and adds value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool finishes a task by passing a summary of what was done and decided. It names the specific verb (finish) and resource (task). It distinguishes from siblings by explaining this is the task-completion step, separate from remember (persisting knowledge) and search/context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on when to call it (when finishing a task) and the workflow: it analyzes the summary, suggests what should become permanent knowledge, doesn't save anything, and only calls `remember` if the user approves the change_set. It names the alternative (`remember`) and the conditional flow, though it doesn't explicitly say when NOT to use it beyond the non-writing behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rememberA

Grava conhecimento na base do projeto. Use com change_set para aplicar uma sugestao do finish_task JA APROVADA pelo usuario, ou com type/title/content para um registro avulso. Escreve em disco: confirme com o usuario antes.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeNo
titleNo
contentNo
change_setNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior4/5

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 explicitly discloses the key behavioral trait: 'Escreve em disco: confirme com o usuario antes' (writes to disk, confirm with the user first). This is a side-effect disclosure that is valuable. However, it doesn't describe return values or what confirmation flow looks like in detail, but the disk-write disclosure is the critical one.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact paragraph of three sentences. It's front-loaded with the core purpose, then usage modes, then the critical side-effect warning. No filler or repetition. Slightly dense but efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite 0% schema coverage and no annotations, the description covers the essential aspects: purpose, two usage modes, and the write-to-disk side effect. It has an output schema, so return value explanation isn't strictly needed. For a tool with 4 parameters and no annotations, this is reasonably complete, though it could elaborate on confirmation expectations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It groups parameters into two usage modes (change_set vs type/title/content) which adds semantic meaning beyond the bare schema. However, it doesn't explain each parameter's type requirements or format details, leaving the agent to infer specifics. The mode-grouping is helpful but not exhaustive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states what the tool does: 'Grava conhecimento na base do projeto' (records knowledge in the project base). It identifies the resource (knowledge base) and the action (record/save). It distinguishes the two usage modes (change_set with an approved finish_task suggestion, or standalone type/title/content) which helps differentiate from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: use with change_set for applying an approved finish_task suggestion, or with type/title/content for standalone records. It names the specific sibling tool (finish_task) and describes when to use each mode, though it doesn't explicitly say when NOT to use it or name direct alternatives for recording knowledge.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

start_taskA

Chame ANTES de comecar qualquer tarefa neste projeto. Devolve o conhecimento acumulado que e relevante para ela: regras do projeto, decisoes ja tomadas, preferencias e convencoes. Somente leitura.

ParametersJSON Schema
NameRequiredDescriptionDefault
task_descriptionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations provided, so the description carries the full burden of behavioral disclosure. It explicitly states 'Somente leitura' (read-only), which is valuable behavioral information. However, it doesn't disclose what happens when no relevant knowledge exists, potential failure modes, or whether it modifies state in any way beyond the read-only claim.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact—three sentences in Portuguese—and front-loaded with the most critical instruction (call before starting any task). Every sentence adds value: the timing instruction, the output description, and the read-only note. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a single required parameter and an output schema present, which lowers the burden on the description for explaining return values. The description covers the tool's core behavior adequately for its simplicity. However, given 0% schema coverage, it would benefit from elaborating on what the 'task_description' parameter should contain, and the relationship to sibling tools like 'remember' and 'context' is not clarified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate for the sole parameter. While the description explains the overall tool behavior well, it doesn't specifically describe what the 'task_description' parameter should contain (e.g., format, level of detail, whether it's a free-form description or a specific format). With only one parameter and 0% schema coverage, the description carries the burden and only partially addresses the parameter's intended usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Chame ANTES de comecar qualquer tarefa neste projeto' (call BEFORE starting any task in this project), and explains what it does—returns accumulated knowledge relevant to the task including project rules, decisions, preferences, and conventions. While clear and specific, it doesn't explicitly distinguish itself from the sibling tools like 'context', 'search', or 'remember', which could overlap in function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage context: it should be called BEFORE starting any task. 'Chame ANTES de comecar qualquer tarefa' is a clear temporal guideline. However, it doesn't explicitly state when NOT to use this tool versus alternatives like 'search' or 'context', nor does it name specific sibling alternatives for exclusion.

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.

  1. 5 tool updatesv0.1.0
    • First observedcontext
    • First observedfinish_task
    • First observedremember
    • First observedsearch
    • First observedstart_task

TDQS

A3.5/5.0

Scored across 5 tools

Disambiguation4/5

The tools are mostly distinct: search/context are read-only queries (with context being more natural-language free-form), start_task/finish_task are lifecycle hooks, and remember is the only write operation. The main ambiguity is between search and context, which both retrieve project knowledge, though descriptions differentiate them reasonably.

Naming Consistency3/5

Tool names follow a clean snake_case verb pattern (search, context, remember, start_task, finish_task). However, they mix verbs and nouns inconsistently - two are bare verbs (context, remember, search) while two are verb_noun compound tasks (start_task, finish_task). The naming is readable but not patterned.

Tool Count5/5

Five tools is ideal for a knowledge-management MCP server. Each tool maps to a clear function: querying (search/context), task lifecycle (start/finish), and writing (remember). There's no bloat or redundancy in the count.

Completeness4/5

The surface covers the full knowledge-management lifecycle: read (search/context), write (remember), and contextual hooks (start/finish_task). A minor gap is the absence of an explicit delete/update operation for knowledge records - forget or edit are missing - but the core workflow is well covered.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A local MCP server providing persistent memory for AI coding assistants by storing and searching architectural decisions, patterns, and solutions. It also includes tools for git automation and mapping codebase expertise based on project history.
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    An MCP server that provides persistent project context, workflow management, and knowledge capture for AI coding agents. It enables agents to maintain structured memory across sessions by tracking project profiles, conventions, skills, and technical debt.
    7
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    An MCP server that builds a semantic graph memory from a project directory, indexing documentation and code into graph structures and exposing 70+ MCP tools for search, knowledge management, task management, and more.
    9 npm
    15
    Elastic 2.0