Enables remote access to the MCP server through Cloudflare Tunnels, making the book agent accessible from anywhere
Provides composability with other MCP servers, allowing book knowledge to be combined with GitHub access
Utilizes Ollama to run local LLMs (specifically Qwen 2.5 7B) for content generation, enabling private and cost-effective operation
AI Book Agent MCP Server
An MCP (Model Context Protocol) server that provides AI assistants with intelligent access to ML textbook content for creating accurate, source-grounded documentation. This pure Python implementation uses local models for complete privacy and cost efficiency.
Overview
This project transforms authoritative ML textbooks into a knowledge service that any MCP-compatible AI assistant can access. Using local LLMs (Qwen) and embeddings (sentence-transformers), it creates a private, cost-effective RAG system exposed via the official Python MCP SDK.
Why MCP?
Traditional Approach Limitations
- Knowledge locked in a single application
- Users must switch between tools
- Cannot leverage AI assistants they already use
- Difficult to integrate with existing workflows
MCP Server Benefits
- Universal Access: Works with Claude Desktop, VS Code, and any MCP client
- Workflow Integration: Use book knowledge directly in your IDE or chat
- Composability: Combine with other MCP servers (filesystem, GitHub, etc.)
- Future-Proof: As MCP ecosystem grows, your book agent automatically works with new tools
Architecture
Technology Stack
- MCP Framework: Official Python SDK (
mcp[cli]
) - Language: Python 3.11+
- Embeddings: sentence-transformers (all-MiniLM-L6-v2)
- LLM: Ollama with Qwen 2.5 7B
- Vector Store: ChromaDB/FAISS
- Book Parsing: ebooklib, BeautifulSoup4
- Transport: stdio (local) or HTTP (remote)
Core Features as MCP Tools
1. searchBooks
Search across all indexed books for relevant content
2. getChapterContent
Retrieve specific chapter or section content
3. generateSection
Generate documentation based on book content
4. citeSources
Get proper citations for content
Resources
The server exposes book content as browsable resources:
Prompts
Pre-configured prompts for common tasks:
doc_generator
concept_explainer
Use Cases
1. In Claude Desktop
2. In VS Code
3. Documentation Pipeline
Getting Started
Prerequisites
- Linux system (Ubuntu 22.04+ recommended)
- Python 3.11+
- Node.js 18+
- 16GB RAM minimum
- 20GB free disk space
Installation
Configuration
Configure the server:
Add to Claude Desktop config:
Basic Usage
Once configured, the tools are available in any MCP client:
Development
Adding New Books
Extending Tools
Add new tools directly in server.py
:
Testing
Project Structure
Pure Python Architecture
This project uses a simplified, single-language approach:
- Python MCP Server: Official SDK handles MCP protocol and tool exposure
- Integrated RAG: All ML components run in the same Python process
- Local Models: Complete privacy with Ollama and sentence-transformers
Benefits of this approach:
- Simpler deployment: Single Python service
- Direct ML access: No API overhead between MCP and RAG
- Easier debugging: One codebase, one process
- Better performance: No network calls between components
Remote Access
For accessing the server from anywhere:
Roadmap
- Basic MCP server structure
- EPUB parsing and indexing
- Core search tools
- Advanced RAG features
- Multi-book cross-referencing
- PDF support
- Streaming responses for long content
- Caching layer for performance
- Book update notifications
Contributing
See USER_GUIDE.md for details on:
- Adding new tools
- Improving search algorithms
- Supporting new book formats
- Performance optimizations
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Provides AI assistants with intelligent access to ML textbook content for creating accurate, source-grounded documentation using local models for privacy and cost efficiency.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol implementation that enables AI assistants to interact with markdown documentation files, providing capabilities for document management, metadata handling, search, and documentation health analysis.Last updated -1434611TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol implementation that enables AI-powered access to documentation resources, featuring URI-based navigation, template matching, and structured documentation management.Last updated -3PythonMIT License
- -securityAlicense-qualityProvides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.Last updated -62TypeScriptMIT License
- AsecurityAlicenseAqualityProvides a structured documentation system for context preservation in AI assistant environments, helping users create and manage memory banks for their projects.Last updated -310PythonMIT License