Codebase Memory MCP vs Knowledge Rag

A side-by-side look at the Codebase Memory MCP and Knowledge Rag MCP servers: transport, auth, tools, quality signals, and the config to install either one in Claude, Cursor, Windsurf or VS Code.

Codebase Memory MCP logoCodebase Memory MCPKnowledge & Memory · Local subprocess (stdio)Code-intelligence engine that indexes a repo into a persistent knowledge graph — functions, classes, call chains, HTTP routes, cross-service links. 159 languages via tree-sitter + Hybrid LSP, sub-ms structural queries, 99% fewer tokens than grep. Single static binary, zero dependencies, 100% local. npx codebase-memory-mcp73GreatAuth: no auth requiredKnowledge Rag logoKnowledge RagKnowledge & Memory · Local subprocess (stdio)Local RAG system for Claude Code with hybrid search (BM25 + semantic), cross-encoder reranking, markdown-aware chunking, query expansion, and 28 MCP tools. Runs entirely offline with zero external servers.67GreatAuth: no auth required

Verdict: choose Codebase Memory MCP for knowledge & memory work as a local process; choose Knowledge Rag for knowledge & memory as a local process. You can also run both side by side in one mcpServers block.

Which MCP server should you choose?

Codebase Memory MCP logoChoose Codebase Memory MCP when

  • You need dedicated capabilities in the Knowledge & Memory domain.
  • You prefer a local stdio subprocess transport.
  • Its auth model fits you: No auth required.
  • You want tools like index_repository, search_graph, query_graph.
Explore Codebase Memory MCP

Knowledge Rag logoChoose Knowledge Rag when

  • You need dedicated capabilities in the Knowledge & Memory domain.
  • You prefer a local stdio subprocess transport.
  • Its auth model fits you: No auth required.
  • You want tools like search_knowledge, get_document, reindex_documents.
Explore Knowledge Rag

Feature & specification comparison

Rows where the two servers differ are marked.

SpecCodebase Memory MCP logoCodebase Memory MCPKnowledge Rag logoKnowledge Rag
CategoryKnowledge & MemoryKnowledge & Memory
Quality signal73/100 · Great67/100 · Great
Install commandConfirmedConfirmed
TransportLocal subprocess (stdio)Local subprocess (stdio)
AuthNo auth requiredNo auth required
PricingFreeFree
Required env varsNone listedNone listed
Verified ownerCommunity listingCommunity listing
GitHub stars47,236301
Directory activity 8 views 1 installs 1 upvotes 9 views 0 installs 0 upvotes
Tools1713

Tools & capabilities

Codebase Memory MCP tools 17

  • index_repositoryIndex a repository. full/moderate add semantics; fast omits them; cross-repo-intelligence links services. Reports coverage gaps.
  • search_graphFind symbols via BM25 query, regex name/qn filters, or semantic_query. Rows keep qn/file/lines and in/out over CALLS/USAGE/CALL_REFERENCE/INHERITS/IMPLEMENTS.
  • query_graphRead-only Cypher for multi-hop, aggregation, complexity, or cross-service analysis. Default: 200 visible rows with exact/lower-bound totals and truncation; continue safely with next_cursor. graph=missed is a file tree of flagged coverage gaps; absence is not proof of completeness. Use get_graph_schema(diagnostics=full) for properties.
  • trace_pathTrace callers/callees, data flow, or cross-service paths. Defaults exclude tests and resolver evidence. Rows keep qn/hop with explicit totals, relations, and continuations.
  • get_code_snippetRead a search_graph symbol. auto bounds source and outlines large containers; full restores up to 500 lines. Source/outline pages continue; coverage_note marks gaps.
  • get_file_outlineDeclaration outline of one exact repository-relative file: optional exact label filter, source order, exact total/offset/limit paging; file/folder/container nodes excluded.
  • get_graph_schemaGet node-label and edge-type counts. diagnostics=full also lists queryable properties.
  • compare_graphsCompare two indexed snapshots: deterministic target-only additions and base-only removals of stable node/edge identities; each set capped by limit and a 512 KiB budget with exact totals and truncation reasons.
  • get_architectureCompact counts, languages, packages, entry points. Request structure, dependencies, routes, hotspots, boundaries, layers, clusters, cycles, or file_tree; path scopes a directory.
  • search_codeGraph-ranked text search: compact symbols, full bounded source, or file paths.
  • list_projectsList projects with stable paging. Identity is lean; stats adds graph sizes.
  • delete_projectDelete a project from the index
  • +5 more on the listing page

Knowledge Rag tools 13

  • search_knowledge Hybrid search combining semantic search + BM25 keyword search with cross-encoder reranking. Read-only. No side effects. Args: query: Search query text (1–3 keywords recommended; phrase queries also work) max_results: Maximum number of results (default: 5, max: 20) category: Optional category filter — one of: security, ctf, logscale, development, general, redteam, blueteam. Call list_categories() first to see available categories and counts. hybrid_alpha: Balance between semantic and keyword search. 0.0 = keyword-only (best for exact technical terms like CVE IDs or tool names), 0.3 = balanced default, 1.0 = semantic-only (best for conceptual or natural-language queries). min_score: Minimum normalized relevance score (0.0–1.0) to include a result. Results scoring below this threshold are discarded. Default 0.0 returns all results. Use 0.2–0.4 to cut low-relevance noise. snippet_mode: When true (default), truncates content to ~500 characters at a natural break point and adds a content_length field with the original size. Use get_document() to fetch full content when needed. Set to false to return full chunk content. search_method: Dispatch selector (v4.8.2+). One of ``"auto"`` (router picks FTS5 fast-path for lexical queries when enabled, hybrid otherwise), ``"hybrid"`` (force hybrid path — kill switch for suspected router misclassification), or ``"fts5"`` (force FTS5 fast-path — debug/testing; errors out when the feature is disabled or the index is not ready). Default ``"auto"`` preserves pre-v4.8.2 behavior byte-for-byte when the fast-path is disabled in config. Returns: JSON string with results including content chunks, source filepath, relevance score, and search method used. Returns chunks, not full document content. Usage: Primary search tool — use for any topic or keyword lookup. Prefer search_similar() when you already have a reference document and want more like it. Prefer get_document() when you already know the exact filepath and need the full content.
  • get_document Get the full content of a specific document by filepath. Read-only. No side effects. Args: filepath: Relative path to the document within the documents directory (e.g., "security/technique.md"). Must be an indexed file — use list_documents() to browse available paths, or search_knowledge() to find the filepath by topic first. Returns: JSON string with full document content and metadata (filepath, category, size). Usage: Use when you need the complete text of a known file — search_knowledge() returns chunks, not full docs. Use search_knowledge() first to find the filepath if unknown. Use list_documents() to browse all available files by category.
  • reindex_documentsIndex or reindex all documents in the knowledge base (runs in background). ``force`` — smart reindex (detect changed files + rebuild BM25). Use after filesystem edits outside add_document/update_document. ``full_rebuild`` — nuclear rebuild (delete + re-embed). Use only after embedding-model change or index corruption. Mutually exclusive with resume. ``resume`` — pick up an interrupted smart reindex from ``data/reindex_checkpoint.json``. Falls back to a fresh smart run silently if the checkpoint is missing/corrupt/drifted (v4.8.0 Fase 4). Returns a JSON envelope. Poll ``get_reindex_status()`` until ``reindex.active`` becomes false. Add/update/URL tools already auto-index — use these flags only for the recovery/rebuild scenarios above.
  • get_reindex_status Get the current status of a background reindex operation. Lightweight — does not compute full index statistics. Use this to poll progress after calling reindex_documents(). Returns: JSON string with reindex status. When active: operation name, progress (processed/total), percent complete, indexed/skipped/errors counts, and start time. When inactive: active=false, plus last_result or last_error from the most recent completed reindex. Usage: Call repeatedly after reindex_documents() to monitor progress. When reindex.active becomes false, the operation is complete. Use get_index_stats() for full index health metrics.
  • list_categories List all document categories with their document counts. Read-only. No side effects. Reflects the live index state. Returns: JSON string with category names, document counts per category, and total document count. Usage: Use before filtering search_knowledge() or list_documents() by category to see which categories exist and how many documents each contains. Use get_index_stats() instead for broader system health metrics (model name, cache hit rate, BM25 status).
  • list_documents List all indexed documents, optionally filtered by category. Read-only. No side effects. Args: category: Optional category filter. Must be a valid category name — call list_categories() to see available options (e.g., security, ctf, logscale, development, general, redteam, blueteam). Returns: JSON string with list of document filepaths, categories, and metadata for each indexed file. Usage: Use to browse what's in the index or verify a specific file is indexed. Use list_categories() first to see valid category names. Use search_knowledge() when you want to find documents by topic rather than browsing the full list. Use get_document() to read a specific file once you have its filepath.
  • get_index_stats Get statistics and health metrics for the knowledge base index. Read-only. No side effects. Returns: JSON string with system metrics: total documents, total chunks, embedding model name, BM25 status, query cache hit rate, and file watcher status. Usage: Use for system health checks — verifying the embedding model loaded, checking index population, or monitoring cache efficiency. Use list_categories() for per-category document counts instead. Use evaluate_retrieval() to measure actual search quality with test queries.
  • add_document Add a new document to the knowledge base from raw text content. Mutating — writes a file to disk and indexes it immediately. No auth required. Args: content: Full text content of the document (markdown supported) filepath: Relative path within documents directory (e.g., "security/new-technique.md"). The subdirectory should match the category. category: Document category — one of: security, ctf, logscale, development, general, redteam, blueteam (default: general) Returns: JSON string with indexing results (filepath, chunks created, status). Usage: Use to add new documents from text content. Use add_from_url() instead when the source is a web page. Use update_document() to replace content of an existing file. The document is immediately searchable after this call — no manual reindex needed.
  • update_document Update the content of an existing document in the knowledge base. Mutating — overwrites the file on disk and re-indexes immediately. Old chunks are removed and replaced with new ones. Full content replacement, not a patch. Args: filepath: Full or relative path to the document file. Must be an already-indexed file — use list_documents() to find valid paths. content: New full-text content to replace the existing content entirely Returns: JSON string with update results (old chunk count, new chunk count, status). Usage: Use to replace a document's content completely. Use add_document() to create a new file instead. Use remove_document() to delete without replacing. Changes are immediately searchable — no manual reindex needed.
  • remove_document Remove a document from the knowledge base index. Mutating — removes index entries. If delete_file=True, also permanently deletes the file from disk (irreversible, cannot be undone). Args: filepath: Path to the document file. Must be an indexed document — use list_documents() to find valid paths. delete_file: If True, permanently deletes the file from disk in addition to removing from the index (default: False). Returns: JSON string with removal results (filepath, status). Usage: Use to unindex a document while keeping the file on disk (default). Set delete_file=True only for permanent removal. Use update_document() to replace content instead of removing. Use reindex_documents(force=True) if you deleted the file manually on disk outside of this tool.
  • add_from_url Fetch content from a URL, convert to markdown, and add to the knowledge base. Mutating — makes an outbound HTTP request (requires internet access), strips HTML, converts to markdown, saves to disk, and indexes immediately. Args: url: Full URL to fetch (https:// required). The page must be publicly accessible. category: Document category — one of: security, ctf, logscale, development, general, redteam, blueteam (default: general) title: Optional document title. Auto-detected from the page's <title> tag if omitted. Returns: JSON string with indexing results (detected title, filepath, chunks created, status). Usage: Use to ingest web content (writeups, blog posts, documentation pages) directly by URL. Use add_document() instead when you already have the text content. The document is immediately searchable after this call — no manual reindex needed.
  • search_similar Find documents semantically similar to a given reference document. Read-only. No side effects. Uses the document's embedding for similarity comparison. Args: filepath: Path to the reference document (must already be indexed — use list_documents() to verify). E.g., "security/technique.md" max_results: Number of similar documents to return (default: 5, max: 20) Returns: JSON string with list of similar document filepaths and similarity scores (0.0–1.0). Usage: Use when you have a specific document and want to discover thematically related ones. Use search_knowledge() instead when you have a text query rather than a reference document. The reference document must be indexed — call list_documents() to confirm it exists before calling this tool.
  • +1 more on the listing page

Ready-to-paste client configs

Paste either block (or both) into your client config, e.g. claude_desktop_config.json or ~/.cursor/mcp.json. We only show a config when the install command is confirmed.

Codebase Memory MCP

mcpServers (Claude Desktop / Cursor)
{
  "mcpServers": {
    "deusdata-codebase-memory-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codebase-memory-mcp"
      ]
    }
  }
}

Knowledge Rag

mcpServers (Claude Desktop / Cursor)
{
  "mcpServers": {
    "lyonzin-knowledge-rag": {
      "command": "uvx",
      "args": [
        "knowledge-rag"
      ]
    }
  }
}

Frequently asked questions

Codebase Memory MCP is categorized under Knowledge & Memory and uses a local stdio subprocess. Knowledge Rag belongs to Knowledge & Memory and uses a local stdio subprocess. Pick Codebase Memory MCP for knowledge & memory work and Knowledge Rag for knowledge & memory.

Copy the mcpServers block from the config section on this page into your client's config (for example claude_desktop_config.json or ~/.cursor/mcp.json), then fully restart the client.

Codebase Memory MCP is listed as free. Auth: no auth required. Knowledge Rag is listed as free. Auth: no auth required. If a server needs environment variables such as API keys, define them under the env key in your client's MCP config.

Yes. MCP clients support multiple servers: add deusdata-codebase-memory-mcp and lyonzin-knowledge-rag as separate keys in the same mcpServers object, and your assistant will call tools from either one.

On AllMCPs, Codebase Memory MCP has a quality signal of 73/100 (Great) with 8 views, 1 installs and 47,236 GitHub stars. Knowledge Rag has 67/100 (Great) with 9 views, 0 installs and 301 GitHub stars.