Skip to main content
Glama
lemma_docs_mcp

lemma_docs_mcp

by zackscriven

lemma_docs_mcp

Part of PracticeOS — the operating layer for therapy practice owners, by Private Practice Collective.

Read-only MCP (Model Context Protocol) server for semantic search over a locally supplied copy of Lemma's documentation (getlemma.com — healthcare-practice banking: entity accounts, deposit bonuses, fixed fee loans, cash sweeps, MSO-PC compliant banking). Same architecture as its siblings in this folder (whop_docs_mcp, stedi_docs_mcp, ghl_docs_mcp, …): stdio transport, TypeScript, two read-only tools, in-memory index built lazily on first call. It never calls live Lemma or banking APIs.

Open overview.html for the branded one-page summary.

Corpus

  • Default root: PPC/Product/PracticeOS/Lemma/docs/ (sibling PPC/ of MCP_Servers/ on the drive). Override with LEMMA_DOCS_CORPUS_ROOT.

  • Flat folder of lemma-docs-*.md files. As of 2026-08-26: 8 documents → 61 chunks — the full set of pages Lemma exposes via its markdown export endpoint.

  • Not covered (exists on getlemma.com but has no .md export): banking operations (accounts, cards, transactions, move money), insurance & billing (lockbox, EOB, reconciliation), invoicing, team management, API reference. The tools say so rather than guessing.

  • Namespace routing keys off filename prefix: quickstart → getting-started; changelog / roadmap → product-updates; everything else (the guides-* pages) → guides.

Related MCP server: kb-mcp-server

Tools

Tool

Purpose

lemma_docs_context

Ranked excerpt search for a question/task. Auto-routes to a namespace, returns compact chunks with ids, source paths, pagination, follow-ups.

lemma_docs_get

Full text of specific chunks by id, or a whole document by relative path. The expansion step after search.

Both declare readOnlyHint, idempotentHint, openWorldHint:false, and attach structured content alongside markdown.

Build & verify

npm install
npm run build
npm run dry-run          # index stats (8 docs → 61 chunks)
npm run query -- "how does the deposit bonus accrue"
npm run test             # assertions against the real corpus
npm run test:fixture     # 35-assertion behavior suite, runs anywhere
npm run smoke            # end-to-end MCP wire-protocol test (17 checks)

Register in Claude Desktop / Cowork

~/Library/Application Support/Claude/claude_desktop_config.json → mcpServers:

"lemma-docs": {
  "command": "/absolute/path/to/node",
  "args": ["/absolute/path/to/lemma_docs_mcp/dist/index.js"]
}

No env needed — the corpus root default resolves relative to this folder. Restart Claude Desktop after editing. For Codex, add the equivalent [mcp_servers.lemma-docs] TOML table (see MCP_Servers/CLAUDE.md).

Licensing

Code is MIT; the Lemma documentation content is © Lemma, supplied locally, never redistributed. See NOTICE.md before publishing anything from this folder.

Available Tools

2 tools
lemma_docs_contextSearch Lemma Docs ContextA
Read-onlyIdempotent

Search the local Lemma (getlemma.com) documentation corpus and return focused, ranked source excerpts for a question or task. Lemma is healthcare-practice banking: entity accounts, deposit bonuses, fixed fee loans, cash sweeps, MSO-PC compliant banking guardrails, and shared onboarding. Routes the query into one of three internal namespaces (getting-started: quickstart/onboarding/KYB; guides: deposit bonuses, fixed fee loans, MSO-PC compliance, collaboration, owning multiple entities; product-updates: changelog and roadmap) and returns compact chunks with source paths. This is a local documentation index only — it NEVER calls live Lemma or banking APIs, and it cannot move money or mutate any account state.

Coverage note: the corpus is the 8 pages Lemma exposes as markdown. Banking-operations pages (accounts, cards, transactions, move money), insurance/lockbox, invoicing, team-management, and the API reference are NOT in this index — say so instead of guessing when a query needs them.

Args:

  • query (string, required): The documentation question or task, 2-500 chars.

  • namespace ('auto' | 'getting-started' | 'guides' | 'product-updates', default 'auto'): Corpus area. Use 'auto' unless you already know the area.

  • intent ('answer' | 'build_context' | 'source_map', default 'answer'): How the returned context will be used; adjusts guidance.

  • max_chunks (int 1-12, default 6): Page size.

  • offset (int >= 0, default 0): Ranked matches to skip, for paging.

  • response_format ('markdown' | 'json', default 'markdown'): Text rendering; structured content is always attached.

Returns (structured): { query, namespace, intent, guidance, chunks: [{ id, score, namespace, source_type, path, heading, excerpt, metadata }], pagination: { total_matches, count, offset, has_more, next_offset? }, follow_ups: [string], truncated?, truncation_message?, stats: { indexed_chunks, returned_chunks } }

Chunk excerpts are capped; pass a chunk's id (or its path) to lemma_docs_get for the full text.

Examples:

  • "How does the deposit bonus accrue and when is it paid?" -> guides (deposit-bonuses).

  • "Open an account for a new PLLC" -> getting-started (quickstart, KYB, beneficial owners).

  • "Does Lemma support Zelle?" -> product-updates (roadmap workaround section).

  • "What guardrails does Lemma set up for an MSO-PC structure?" -> guides (mso-pc-compliance).

  • Follow-up paging: repeat the same query with offset=pagination.next_offset.

Errors:

  • "Lemma docs corpus root not found ..." -> set LEMMA_DOCS_CORPUS_ROOT to the absolute path of the lemma-docs-*.md folder and restart.

  • Empty chunks with guidance "No strong ... matches" -> retry with a more specific Lemma term (entity, deposit bonus, fixed fee loan, cash sweep, MSO-PC), or the topic may be outside the 8-page corpus.

Inputs: query (required), intent, offset, namespace, +2 more. Returns: query, stats, chunks, intent, +6 more

lemma_docs_getGet Lemma Docs ChunksA
Read-onlyIdempotent

Fetch the full text of specific indexed Lemma documentation chunks by id, or every chunk of one document by its relative path. Use this after lemma_docs_context to expand excerpts you actually need — do not use it to browse (use lemma_docs_context for discovery). Reads the local corpus index only; it NEVER calls live Lemma or banking APIs.

Args:

  • ids (string[], 1-8, optional): Chunk ids exactly as returned by lemma_docs_context.

  • path (string, optional): A relative corpus path exactly as returned in a result's 'path' field; returns all chunks of that document in order.

  • response_format ('markdown' | 'json', default 'markdown'): Text rendering; structured content is always attached. At least one of ids or path is required.

Returns (structured): { found: [{ id, namespace, source_type, path, heading, text, metadata }], missing: [string], truncated?, truncation_message? }

Examples:

  • ids=["lemma-docs-docs-guides-deposit-bonuses.md#md-1-0"] -> full text of that section.

  • path="lemma-docs-docs-guides-mso-pc-compliance.md" -> every chunk of that document (may truncate; follow the truncation message).

Errors:

  • Calling with neither ids nor path returns an error explaining both options.

  • Unknown ids/paths are reported in 'missing' rather than failing the whole call.

Inputs: ids, path, response_format. Returns: found, missing, truncated, truncation_message

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct roles: one performs ranked search/discovery over the corpus, the other retrieves full text for specific chunks or documents. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    Both tool names follow the same `lemma_docs_<verb>` pattern, with context indicating search/discovery and get indicating retrieval. The naming convention is consistent and predictable.

    Tool Count3/5

    Two tools is on the thin side, but for a narrow local-documentation retrieval server the search-and-get pair is a reasonable minimal setup. It feels slightly sparse rather than fully fleshed out.

    Completeness4/5

    The server covers the core documentation workflow: discover relevant chunks and then expand them to full text. Notable gaps like listing all documents or browsing the corpus are acknowledged by the tool descriptions, and the search tool can surface paths, so agents can work around them.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables any MCP-compatible AI assistant to search, filter, and retrieve information from a local document collection using a hybrid search pipeline with vector, BM25, reranking, and LLM enrichment.
      4
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables semantic search over a local knowledge base using MCP tools, allowing AI clients to retrieve relevant document chunks via the search_knowledge tool.
      21 npm
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides read-only MCP tools for hybrid semantic and keyword search over locally indexed PDF documentation, with citations and context retrieval for LLM agents.
      -