Mind Forge
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mind ForgeGenerate flashcards from my uploaded PDF on neural networks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mind Forge
Ingest, query, and generate study materials from documents — all through your OpenCode chat.
Mind Forge is an OpenCode plugin that turns documents (PDFs, DOCX files, Markdown, images, web pages) into a searchable knowledge base with vector search, a knowledge graph, and study tools. You describe what you want in chat, and the LLM calls the right MCP tool automatically.
Status: MVP implemented. The full pipe — ingest → embed → graph → study — is functional.
Quick Start
# 1. Clone and install
git clone https://github.com/goncalompontes/mind-forge.git
cd mind-forge
npm install
npm run build
# 2. Register in your OpenCode configAdd to your opencode.json:
{
"mcpServers": {
"mind-forge": {
"command": "node",
"args": ["/path/to/mind-forge/dist/index.js"]
}
}
}Then use it in chat:
You: Ingest the PDF at ~/papers/transformer-attention.pdf
Mind Forge: Ingested "Attention Is All You Need" (PDF, 15 chunks, 42 entities, 18 relationships)
You: Query: "how does multi-head attention work?"
Mind Forge: [3 results, scores 84–92%] Found in "Attention Is All You Need" chunk 4: "Multi-head attention allows the model to jointly attend to information from different representation subspaces..."
Related MCP server: Personal Research Assistant MCP
Architecture
Mind Forge registers three MCP tools that the LLM calls automatically:
Tool | Purpose | Pipeline |
| Import a document | extract → embed → store → graph |
| Search your knowledge base | vector search + graph enrichment + FTS5 |
| Create study materials | cards, quiz, exam, or review |
Data Flow
Document → extract() → chunks → embed() → store (SQLite + sqlite-vec)
↘ extractEntitiesAndRelationships() → graph store
↓
User query → embed() → vector search (ANN) → merge with FTS5 + graph enrichment → results
↓
User request → createCards() / generateQuiz() / createExam() → study materialsStorage
SQLite via
better-sqlite3with WAL modeVector index via
sqlite-vec(768-dimension FLOAT embeddings)Full-text search via FTS5 virtual table
Knowledge graph in SQLite (entities + relationships tables)
Single file at
~/.mind-forge/store.db(configurable viaMIND_FORGE_DB_PATH)
Source Format Support
Format | Extractor | Library | Notes |
|
| Metadata via | |
DOCX |
|
| Metadata from |
Markdown |
|
| Frontmatter parsing (title, author, custom fields) |
Image |
|
| PNG, JPG, JPEG, WebP; configurable OCR language |
URL |
|
| SSRF protection, size-limited streaming |
Configuration
Mind Forge auto-detects the best embedding provider. You can configure via environment variables:
Env Variable | Purpose | Default |
| Database file path |
|
| Ollama server URL |
|
Embedding provider selection (via EmbeddingConfig):
auto(default) — tries Ollama first, falls back to API provider if configuredollama— local Ollama (nomic-embed-textdefault, falls back toall-minilm,mxbai-embed-large)llm— OpenAI-compatible API (requiresapiKey)
Default chunk size: 1000 tokens (~4000 characters), paragraph-aware splitting.
Project Structure
src/
├── index.ts # Plugin entry point — registers MCP server
├── types.ts # All shared domain types (12 interfaces, 5 type aliases)
├── embed/ # Embedding providers
│ ├── provider.ts # Factory — auto/Ollama/LLM selection
│ ├── ollama.ts # Ollama adapter (ollama npm package)
│ └── llm-provider.ts # OpenAI-compatible API adapter
├── extract/ # Document extraction
│ ├── index.ts # Orchestrator + paragraph-aware chunking
│ ├── pdf.ts # PDF via pdftotext + pdf-parse
│ ├── docx.ts # DOCX via mammoth
│ ├── markdown.ts # Markdown via gray-matter
│ ├── image.ts # Image OCR via tesseract.js
│ └── url.ts # Web pages via @mozilla/readability
├── store/ # SQLite persistence
│ ├── database.ts # Singleton, schema, sqlite-vec init
│ ├── documents.ts # Document + chunk CRUD
│ └── vectors.ts # Vector insert + ANN search
├── graph/ # Knowledge graph
│ ├── extractor.ts # Pattern-based entity/relationship extraction
│ ├── index.ts # Graph storage (atomic transactions)
│ └── query.ts # BFS traversal, neighbors, pathfinding
├── study/ # Study tools
│ ├── cards.ts # SM-2 spaced repetition cards
│ ├── quiz.ts # Quiz generation + grading (MCQ, T/F, fill-blank)
│ └── exam.ts # Timed exam mode
└── mcp/ # MCP server
├── server.ts # Server registration + 3 tool handlers
├── ingest.tool.ts # IngestTool class (extract → embed → store → graph)
└── query.tool.ts # QueryTool class (hybrid search)Dependencies
Package | Purpose |
| MCP server framework |
| OpenCode plugin registration |
| SQLite database |
| Vector search extension |
| Local embedding via Ollama |
| Image OCR |
| Web page content extraction |
| DOCX text extraction |
| Markdown frontmatter parsing |
| PDF text extraction (fallback) |
| DOM parsing for Readability |
Scripts
Script | Command |
|
|
|
|
|
|
Key Design Decisions
Conversational interface: All interaction through OpenCode chat via MCP tools. No slash commands, no custom UI.
Graceful degradation: Embedding or graph failures don't block ingestion. Document + chunks are always stored.
Hybrid search: Vector similarity (0.7 weight) + FTS5 BM25 (0.3 weight) merged with dedup by chunk ID.
Pattern-based extraction: Regex patterns for entities and relationships at MVP (LLM callback extension point available).
SSRF protection: URL extraction resolves hostnames to IPs and rejects private/reserved ranges before connecting.
This server cannot be deployed
Maintenance
Related MCP Connectors
- backrowOAuthai.backrow
Turn any recording or document into notes, flashcards and quizzes your agent can read and act on
Ingest, manage, and retrieve documents for RAG-powered AI applications
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Voice-led, FSRS-scheduled flashcards from YouTube, PDFs, web, or text. Auto-graded quizzes.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables personalized AI tutoring by allowing students to upload PDF/DOCX study materials that are processed and indexed for semantic search. Provides intelligent responses based on the student's own learning materials using RAG technology.-
- FlicenseNot gradedqualityDmaintenanceEnables semantic search and conversational querying across a personal research library of PDFs, DOCX, and other documents using a vector database. It provides tools for document summarization, finding related papers, and high-accuracy retrieval for AI clients like Claude Desktop.-
- FlicenseNot gradedqualityDmaintenanceEnables building and exploring a knowledge graph from files (PDF, DOCX, code) with AI enrichment via Ollama or Claude. Supports pinning documents, linking entities, and traversing the graph.-
- AlicenseAqualityDmaintenanceEnables browsing and preparing study materials from local documents (PDF, Markdown, text, Word) via tools for overview, search, reading, chunking, and quiz generation.9MIT