AI Book Agent

Provides private access to ML textbooks via MCP to search, retrieve, and cite content for AI-assisted documentation.
  • python

0

GitHub Stars

python

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mcp-mirror-trakru_mcp-library-server": {
      "command": "python",
      "args": [
        "/path/to/ai-book-agent/server.py"
      ]
    }
  }
}

You can run a local MCP server that lets AI assistants access ML textbook content privately. It exposes tools to search, retrieve, and ground documentation in textbook sources, enabling precise, citation-backed outputs without leaving your environment.

How to use

With the AI Book Agent MCP Server, you use MCP clients to search across indexed textbooks, fetch full chapter content, generate documentation sections grounded in those sources, and obtain properly formatted citations.

Typical workflows you can perform include: - Searching for topics across all indexed books to locate relevant passages. - Retrieving exact chapter or section content for deeper understanding or verification. - Generating documentation sections that are explicitly grounded in textbook material. - Producing citations for included content in APA, MLA, or Chicago styles.

In your MCP client, you will trigger the following tools as needed: - searchBooks to locate relevant material by topic or concept. - getChapterContent to pull the content of a chosen book chapter. - generateSection to produce documentation sections based on the textbook sources. - citeSources to generate formal citations for the used content.

How to install

Prerequisites: you need a Linux system (Ubuntu 22.04+ recommended), Python 3.11+, Node.js 18+, at least 16 GB RAM, and about 20 GB free disk space.

Step 1: Clone the project and enter the directory.

# Clone the repository
git clone <repository-url>
cd ai-book-agent

Step 2: Install Python dependencies including the MCP SDK and required libraries.

pip install "mcp[cli]" sentence-transformers chromadb ollama ebooklib beautifulsoup4

# Or use a requirements file if provided
pip install -r requirements.txt

Step 3: Install Ollama for local LLM access and pull the needed model.

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Pull required models
ollama pull qwen2.5:7b

Step 4: Index existing books so they are available to the server.

python scripts/index_books.py

Step 5: Configure the server. Create a configuration file with embedding, generation, and book data paths as shown.

embeddings:
  model: "all-MiniLM-L6-v2"
  device: "cpu"  # or "cuda"

generation:
  provider: "ollama"
  model: "qwen2.5:7b"
  base_url: "http://localhost:11434"
  
books:
  data_dir: "data/epub"
  index_dir: "data/vector_db"

Additional notes

Add the MCP server to your client configuration to enable local control. For Claude Desktop, you can specify the MCP server as a local stdio process with the Python entry point.

Example for Claude Desktop configuration shows the following runtime command and argument path.

{
  "mcpServers": {
    "ai_book_agent": {
      "command": "python",
      "args": ["/path/to/ai-book-agent/server.py"]
    }
  }
}

Available tools

searchBooks

Search ML textbooks for topics or concepts across all indexed books and return relevant passages with optional context.

getChapterContent

Fetch full content of a specified book chapter, returning markdown or plain text as requested.

generateSection

Create a documentation section grounded in textbook sources, with optional outline and style preferences.

citeSources

Produce properly formatted citations for content drawn from specific book sections and pages.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational