Notebook Library MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
pip install -r mcp_servers/notebook_library/requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add notebook-library -- python "<FULL_PATH_TO_NOTEBOOK_LIBRARY_MCP>/dist/index.js"

Replace <FULL_PATH_TO_NOTEBOOK_LIBRARY_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Token-efficient document retrieval for substrate AI agents.

Notebook Library MCP Server

Token-efficient document retrieval for substrate AI agents. Drop PDFs, text files, and markdown into notebook folders — they get chunked, embedded, and indexed for semantic search. Queries return only the most relevant passages (~2,500 tokens) instead of loading entire documents (50,000+).

What It Does

Your AI agent gets a notebook_library tool with these actions:

Action Description
list_notebooks See all available notebooks
create_notebook Create a new notebook collection
query_notebook Semantic search within a notebook (the main one!)
browse_notebook List documents in a notebook
read_document Deep-read a specific document chunk by chunk
notebook_stats Get statistics about a notebook
sync_notebook Re-sync after adding/changing files
remove_document Remove a document from the search index

Supported file formats: .pdf, .txt, .md, .text, .markdown

Architecture

data/
├── notebooks/               # Your document folders
│   ├── Research_Papers/     # Each subfolder = one notebook
│   │   ├── paper1.pdf
│   │   └── notes.md
│   └── Business_Docs/
│       └── plan.txt
└── notebook_chromadb/       # Vector database (auto-created)
    └── manifests/           # File change tracking

mcp_servers/
└── notebook_library/
    ├── server.py              # MCP server (if running standalone)
    ├── notebook_manager.py    # Core: ChromaDB ingestion + search
    ├── document_processor.py  # Text extraction + chunking
    ├── file_watcher.py        # Auto-ingestion on file changes
    └── requirements.txt

backend/tools/
├── notebook_library_tool.py        # Tool wrapper for consciousness loop
└── notebook_library_tool_schema.json  # Tool schema definition

Embedding strategy (multi-tier fallback):

  1. Hugging Face (jinaai/jina-embeddings-v2-base-de) — local, free, multilingual
  2. Ollama (nomic-embed-text) — local fallback if HF fails

No external API keys needed. Everything runs locally.

Setup Guide

1. Install Dependencies

From your substrate root:

pip install -r mcp_servers/notebook_library/requirements.txt

Key dependencies:

  • chromadb==0.4.18 — vector database
  • transformers + torch — Hugging Face embeddings (primary)
  • ollama — embedding fallback
  • PyMuPDF — PDF text extraction
  • watchdog — file system monitoring

Note: First run will download the Hugging Face embedding model (~270MB). This is a one-time download.

2. Create Data Directories

mkdir -p data/notebooks
mkdir -p data/notebook_chromadb

3. Copy the MCP Server Files

Copy the entire mcp_servers/notebook_library/ directory into your substrate:

your_substrate/
└── mcp_servers/
    └── notebook_library/
        ├── __init__.py
        ├── server.py
        ├── notebook_manager.py
        ├── document_processor.py
        ├── file_watcher.py
        └── requirements.txt

4. Copy the Tool Wrapper

Copy these two files into your backend/tools/ directory:

backend/tools/notebook_library_tool.py — The tool function your consciousness loop calls. This imports NotebookManager directly (no subprocess).

backend/tools/notebook_library_tool_schema.json — The tool schema so your agent knows how to call it.

5. Register the Tool in Your Consciousness Loop

Three integration points:

a) Import in `integration_tools.py`

Add to your imports:

from tools.notebook_library_tool import notebook_library_tool as _notebook_library_tool

Add the wrapper method to your IntegrationTools class:

def notebook_library(self, **kwargs) -> Dict[str, Any]:
    """
    Notebook Library — token-efficient document retrieval.
    """
    try:
        result = _notebook_library_tool(**kwargs)
        return result
    except Exception as e:
        return {
            "status": "error",
            "message": f"Notebook library error: {str(e)}"
        }

Add 'notebook_library_tool' to your tool schema loading list so the JSON schema gets picked up.

b) Add tool call handler in `consciousness_loop.py`

In your tool execution block (where you handle elif tool_name == "..." cases), add:

elif tool_name == "notebook_library":
    result = self.tools.notebook_library(**arguments)
c) Verify schema loading

The tool schema file (notebook_library_tool_schema.json) must be in backend/tools/ alongside your other tool schemas. The schema loader should pick it up automatically if it follows the same pattern as your other tools.

6. Add Documents

Create notebook folders and drop files in:

mkdir -p data/notebooks/My_Research
cp ~/some_paper.pdf data/notebooks/My_Research/
cp ~/notes.md data/notebooks/My_Research/

Documents are auto-ingested when your agent first queries the notebook, or you can trigger a manual sync via the sync_notebook action.

Envi

Tools (8)

list_notebooksSee all available notebooks
create_notebookCreate a new notebook collection
query_notebookSemantic search within a notebook
browse_notebookList documents in a notebook
read_documentDeep-read a specific document chunk by chunk
notebook_statsGet statistics about a notebook
sync_notebookRe-sync after adding/changing files
remove_documentRemove a document from the search index

Configuration

claude_desktop_config.json
{ "mcpServers": { "notebook_library": { "command": "python", "args": ["path/to/mcp_servers/notebook_library/server.py"] } } }

Try it

List all my available notebooks to see what research collections I have.
Search the 'Research_Papers' notebook for information regarding the latest findings on transformer architectures.
Read the document 'project_plan.txt' in the 'Business_Docs' notebook to summarize the next steps.
Sync the 'My_Research' notebook to ensure the latest PDF files I added are indexed.

Frequently Asked Questions

What are the key features of Notebook Library MCP Server?

Token-efficient semantic search for large documents. Supports PDF, TXT, and Markdown file formats. Local-only embedding using Hugging Face or Ollama. Automatic file change monitoring and ingestion. Deep-reading capability for specific document chunks.

What can I use Notebook Library MCP Server for?

Indexing large research paper collections for quick AI-assisted Q&A. Managing business documentation for rapid retrieval during meetings. Building a local knowledge base that doesn't require external API keys. Summarizing long-form technical manuals without exceeding context windows.

How do I install Notebook Library MCP Server?

Install Notebook Library MCP Server by running: pip install -r mcp_servers/notebook_library/requirements.txt

What MCP clients work with Notebook Library MCP Server?

Notebook Library MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Notebook Library MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare