Skip to main content
Glama
Software Literature MCP

Software Literature MCP

by rcarubbi

Software Literature MCP

Local MCP server for indexing and searching technical books (PDF/EPUB) with hybrid semantic and full-text search. Source documents and index remain on your machine; text sent for embeddings goes to your configured embedding provider.

Requirements

  • Python 3.11+

  • An embeddings API with an OpenAI-compatible POST /embeddings endpoint

  • Provider API key (or OpenCode Console credentials)

Related MCP server: opencode-document-rag-mcp

Install

git clone https://github.com/rcarubbi/software-literature-mcp.git
cd software-literature-mcp
python -m venv .venv

Activate the virtual environment, then:

python -m pip install -r requirements.txt

Put PDF/EPUB files under ~/Books (or configure BOOKS_DIRECTORY). Set EMBEDDING_API_KEY, EMBEDDING_BASE_URL, and EMBEDDING_MODEL for your provider. Defaults target OpenCode Console and text-embedding-3-small.

For OpenCode Console users, the server can read the opencode key from OpenCode's auth.json on Windows or macOS/Linux. Alternatively, set OPENCODE_API_KEY. For other providers, use EMBEDDING_API_KEY; optionally set OPENCODE_AUTH_PROVIDER and OPENCODE_AUTH_FILE if using a compatible OpenCode auth entry.

Example PowerShell:

$env:BOOKS_DIRECTORY = "$HOME\Books"
$env:EMBEDDING_BASE_URL = "https://opencode.ai/inference/openai/v1"
$env:EMBEDDING_MODEL = "text-embedding-3-small"
$env:EMBEDDING_API_KEY = "your-provider-key"

Do not commit API keys. Any text submitted for indexing or search is sent to the configured provider for embedding; review that provider's privacy and pricing terms.

OpenCode MCP configuration

Add a server entry to your OpenCode config (opencode.json), adjusting paths and environment variables:

{
  "mcp": {
    "software-literature": {
      "type": "local",
      "command": ["C:\\path\\to\\software-literature-mcp\\.venv\\Scripts\\python.exe", "C:\\path\\to\\software-literature-mcp\\server.py"],
      "environment": {
        "BOOKS_DIRECTORY": "C:\\Users\\you\\Books",
        "EMBEDDING_BASE_URL": "https://opencode.ai/inference/openai/v1",
        "EMBEDDING_MODEL": "text-embedding-3-small"
      }
    }
  }
}

On macOS/Linux, set command to the venv Python executable and server path, and use your books directory. Keep secrets in the process environment rather than this config file.

Tools

  • index_books(action="estimate"): extract books locally and estimate token count/cost; does not call the embedding API.

  • index_books(action="status"): show indexed books.

  • index_books(action="execute", confirm_cost=true, max_cost_usd=...): index only if the estimate is within the explicitly supplied ceiling.

  • search_books(query, top_k=8, book=...): hybrid semantic/full-text search with book, source path, page/chapter, and excerpts.

Cost estimate uses EMBEDDING_PRICE_PER_MILLION_TOKENS (default $0.02, OpenCode Console text-embedding-3-small). Set it to your provider's price; set to 0 for a free/local endpoint. The ceiling is a guard, not a guarantee of provider billing.

Index database defaults to the OS user data directory. Override with LITERATURE_DATA_DIRECTORY. An index is tied to its embedding base URL and model; use a separate data directory when changing either.

Test

python -m unittest discover -s tests -v

License

MIT. See LICENSE.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables indexing local documents (PDF, Markdown, text, code) into a knowledge base and querying them via semantic search using local embeddings, all running privately on your machine.
      4
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables local semantic search over PDF, DOCX, PPTX, and EPUB documents by converting them to Markdown, indexing them in ChromaDB, and retrieving complete structure-aware sections with tables and equations.
      6
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables question answering over technical documents (Markdown, TXT, PDF) using hybrid retrieval (vector + lexical) with cited sources and audit logging, fully locally with optional cloud fallback.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables local AI agents to perform hybrid search (BM25 + vector) over privately indexed local files, including notes, PDFs, DOCX, source code, and OCR'd images. All indexing and retrieval stay on the machine with read-only, whitelist-scoped access.
      3
      MIT