Textrawl
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Textrawl
Your second brain, wired for AI.
Textrawl is a personal knowledge server with persistent memory, searchable documents, and proactive insights. Import your emails, PDFs, and notes — then ask questions, recall past conversations, and discover connections you missed. Access it all through MCP, the web dashboard, or the REST API.
How It Works
┌──────────────┐ ┌───────────────────────────────────────────┐
│ │ │ Your Second Brain │
│ MCP Client │◄───────►│ │
│ (Claude, │ MCP │ Documents Memory Conversations │
│ ChatGPT) │ │ ┌────────┐ ┌───────┐ ┌────────────┐ │
└──────────────┘ │ │ Emails │ │ Facts │ │Past sessions│ │
│ │ PDFs │ │People │ │ Summaries │ │
┌──────────────┐ │ │ Notes │ │ Links │ │ Context │ │
│ Dashboard │◄───────►│ └───┬────┘ └──┬────┘ └─────┬──────┘ │
│ (Web UI) │ REST │ └──────────┼──────────────┘ │
└──────────────┘ │ ▼ │
│ ┌───────────────────────────┐ │
│ │ Hybrid Search + Fusion │ │
│ └───────────────────────────┘ │
│ │ │
│ ▼ │
│ Insights · Daily Briefing │
└───────────────────────────────────────────┘
▲
│
┌──────────┴──────────┐
│ │
Desktop App CLI Tools
(drag & drop) (batch import)Related MCP server: knowledge-base-server
Why Textrawl?
Beyond keyword search. Most search tools only match exact words. Textrawl combines semantic understanding (finds "automobile" when you search "car") with traditional keyword matching — so you get relevant results without missing exact phrases.
Your data, your choice. Use OpenAI's embeddings for best accuracy, Google AI for multimodal support, or run locally with Ollama and local Postgres to keep document text and embeddings on your machine.
Import everything. Emails from Gmail exports, PDFs from your research, saved web pages, spreadsheets, Google Takeout archives — Textrawl converts them into searchable knowledge where the relevant converter is configured.
Features
Feature | Description |
Hybrid Search | Vector similarity + full-text search with Reciprocal Rank Fusion |
Persistent Memory | Remember facts about people, projects, and concepts across sessions |
Conversation Recall | Save and query past conversation context across sessions |
Proactive Insights | Automatically discover connections, patterns, and outliers in your knowledge |
Daily Briefing | Summary of recent additions, new insights, and resurfaced knowledge |
Unified RAG |
|
Web Dashboard | Command center with knowledge explorer, timeline, agent orchestration, and applets |
Desktop App | Drag-and-drop file conversion and upload (macOS, Windows, Linux) |
Multi-Format | PDF, DOCX, XLSX, CSV, JSON, HTML, Markdown/text, ZIP archives, MBOX/EML emails, Google Takeout |
MCP + REST + WebSocket | MCP tools, REST API, and real-time WebSocket events |
Agent Discovery | A2A protocol at |
Flexible Embeddings | OpenAI, Google AI, or Ollama (free, local) |
Smart Chunking | Paragraph-aware splitting with overlap for context |
CLI Tools | Batch processing for large archives |
Cloud Ready | Deploy to Docker, Cloud Run, or any container platform; large uploads require GCS/Cloud Tasks configuration |
Privacy Model
Textrawl is self-hosted, but data leaves your machine when you configure cloud services. Document text, chunks, embeddings, extracted memories, and conversation summaries may be sent to providers such as OpenAI/Google embeddings, Anthropic extraction, Neon/Supabase/RDS, Cloud Run, or GCS. For sensitive data, prefer Ollama/local Postgres and disable cloud LLM extraction/insights.
Quick Start
1. Set Up the Server
git clone https://github.com/jeffgreendesign/textrawl.git
cd textrawl
pnpm install
pnpm setup # Interactive setup for credentials
pnpm dev # Start the server2. Set Up Your Database
Create a free project at neon.tech
Copy the pooled connection string from the Neon dashboard into
DATABASE_URLin.envRun the base schema against your database:
psql $DATABASE_URL -f scripts/setup-db.sql(Use
setup-db-ollama.sqlfor Ollama /setup-db-ollama-v2.sqlfornomic-embed-text-v2-moe/setup-db-google.sqlfor Google AI)(Optional) For memory tools:
psql $DATABASE_URL -f scripts/setup-db-memory.sql(Optional) For conversation tools:
psql $DATABASE_URL -f scripts/setup-db-conversation.sql(Optional) For Row Level Security hardening:
psql $DATABASE_URL -f scripts/security-rls.sql
3. Connect Claude Desktop
Add to your Claude config (~/Library/Application Support/Claude/claude_desktop_config.json). Create this file if it doesn't exist:
{
"mcpServers": {
"textrawl": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:3000/mcp",
"--header",
"Accept: application/json, text/event-stream"
]
}
}
}Note: Requires Node.js 22+. If using nvm, ensure your default is set: nvm alias default 22
If you've set API_BEARER_TOKEN in .env, add the auth header:
"--header",
"Authorization: Bearer <your-token>"Restart Claude Desktop - you'll now see Textrawl's tools available.
3b. Connect ChatGPT Desktop (Alternative)
ChatGPT Desktop supports MCP servers natively (Pro/Plus required):
Open Settings → Connectors → Advanced → Developer mode
Add a new connector with your server URL:
http://localhost:3000/mcpIf using auth, add the
Authorization: Bearer <your-token>header
See OpenAI MCP documentation for details.
4. Add Your Documents
Imported documents, extracted memories, and conversation summaries are stored in your configured database/storage until deleted. Treat a Textrawl server as single-tenant unless you have added your own user isolation. Set API_BEARER_TOKEN, restrict CORS with ALLOWED_ORIGINS, and avoid importing third-party or private data without consent. Use forget_entity and delete_conversation to remove memory/conversation data, and list_documents/update_document to audit imported documents.
Option A: Desktop App (easiest)
pnpm desktop:devDrag files onto the window to convert and upload.
Option B: CLI (for batch imports)
pnpm convert -- mbox ~/Mail/archive.mbox
pnpm upload -- ./converted/Documentation
Guide | Description |
Vector dimensions, index counts, and storage estimates by embedding provider | |
Batch conversion and upload from command line | |
Row Level Security and access controls |
Configuration
Variable | Required | Description |
| Yes | Neon (or any PostgreSQL) pooled connection string |
| No | Direct connection for schema migrations (optional) |
| No |
|
| If OpenAI | For text-embedding-3-small (1536d) |
| If Ollama | Default: |
| If Ollama | Default: |
| If Google | For gemini-embedding-2 (1536d) |
| If Google | Default: |
| Prod only | Min 32 chars ( |
| No | Default: 3000 |
| No | debug, info, warn, error |
| No | Comma-separated CORS origins |
| No | Enable memory tools (default: true); requires |
| No | Enable conversation memory tools (default: true); requires |
| No | Enable proactive insight tools (default: true) |
| No | Enable LLM-based memory extraction (default: false) |
| If extraction | Required for |
| No | Model for extraction (default: claude-haiku-4-5) |
| No | Model for insight synthesis (default: claude-sonnet-5) |
| No | Token-efficient responses (default: true) |
| No |
|
| No | Semantic split sensitivity 0–1 (default: 0.5) |
| No | Redis URL for shared rate limiting across instances |
| OAuth | OAuth 2.0 client ID (all four OAuth vars required together) |
| OAuth | OAuth 2.0 client secret |
| OAuth | Min 32-char secret for JWT signing |
| OAuth | Comma-separated email allowlist (optional) |
| OAuth | Public server URL for OAuth redirect |
| No | pg_analyze report directory (default: ./reports/pg-analysis) |
Tool surfaces (compact vs full)
Textrawl advertises one of three tool surfaces via the MCP_TOOLSET environment
variable. The default normal surface is a small set of workflow tools — the
recommended interface for personal/family assistants. This follows the current MCP
maintainer guidance (Anthropic, Writing effective tools for AI agents): fewer
tools, consolidated by workflow into distinct, typed, well-named tools — not a
single "intent" dispatcher (which would discard per-tool schemas, annotations, and
the name signals models use to pick tools). The MCP spec defines no standard
tool-filtering primitive, so MCP_TOOLSET is a server-local convention; host/harness
lazy tool loading remains the canonical way to surface fewer tools at a time.
| Tools advertised |
| Workflow tools: |
| Workflow tools + diagnostics + all original granular tools (backward compatible). |
| Exactly the original tool set (no workflow tools). |
Recommended exposure: personal/family bots → MCP_TOOLSET=normal and
EXPOSE_ADMIN_TOOLS=false (so destructive forget_entity/delete_conversation are
never reachable); admin/dev contexts → MCP_TOOLSET=full.
Model guidance (GPT-5.5, Claude Sonnet, Claude Haiku): express intent through the
workflow tool that matches the job — ask to answer a question across sources,
search for raw matches, capture to save a note or URL, remember to store facts,
timeline/daily_briefing for temporal/briefing views. Use audience to scope who
an answer is for; family_shared/public_safe automatically exclude private memory,
conversations, and insights.
MCP Tools
Read-only tools (search, get_document, list_documents, query_memory, query_conversations, get_stats, health_check) include outputSchema and return structuredContent for programmatic consumption alongside the text content response.
Workflow Tools (compact normal surface)
Tool | Description |
| Save content to the knowledge base — |
| Write structured knowledge to the memory graph — |
ask, search, get_document, daily_briefing, and timeline (documented below)
complete the workflow surface. remember is only advertised when ENABLE_MEMORY=true
(omitted otherwise). ask/search accept audience + allowCrossProfile for
privacy scoping.
Document Tools
Tool | Description |
| Hybrid semantic + full-text search. Set |
| Retrieve document by ID |
| List with pagination and filtering |
| Update title and/or tags |
| Add markdown note to knowledge base |
Memory Tools (Persistent Memory)
Enable with ENABLE_MEMORY=true (default). Requires scripts/setup-db-memory.sql or setup-db-memory-ollama.sql.
Tool | Description |
| Store facts about entities (people, projects, concepts) |
| Store multiple facts and relations in a single batch call |
| Query the memory graph ( |
| Create relationships between entities |
| Delete an entity and all its memories |
| Extract entities and facts from text using LLM |
Conversation Tools (Conversation Memory)
Enable with ENABLE_CONVERSATIONS=true (default). Requires running one of the conversation schema scripts:
scripts/setup-db-conversation.sql(OpenAI embeddings, 1536d)scripts/setup-db-conversation-ollama.sql(Ollama v1 - nomic-embed-text, 1024d)scripts/setup-db-conversation-ollama-v2.sql(Ollama v2 - nomic-embed-text-v2-moe, 768d)scripts/setup-db-conversation-google.sql(Google AI - gemini-embedding-2, 1536d)
Tool | Description |
| Save conversation summary and turns for recall |
| Query past conversations ( |
| Delete a conversation session |
Insight Tools (Proactive Discovery)
Enable with ENABLE_INSIGHTS=true (default).
Tool | Description |
| View discovered cross-source connections and patterns |
| Trigger an insight scan across the knowledge base |
| Dismiss an insight from the queue |
Stats
Tool | Description |
| Statistics across all features ( |
| Check the health of all subsystems — returns pass/fail per component with overall status ( |
Unified Tools
Tool | Description |
| Unified RAG search across all knowledge sources (documents, memory, conversations, insights) |
| Generate a daily briefing with recent additions, new insights, and resurfaced knowledge |
| Fetch a URL, convert HTML to markdown, extract metadata, and save as a document |
| Browse knowledge chronologically within a date range, optionally filtered by topic |
Postgres Analysis Tools
Enabled when DATABASE_URL is configured. Connects directly to Postgres.
Tool | Description |
| Run comprehensive Postgres health analysis with table stats, index health, vacuum status, bloat estimates, and Textrawl-specific checks |
| Get actionable optimization recommendations filtered by severity |
| View past analysis reports and compare trends over time |
Search Parameters
Parameter | Type | Default | Description |
| string | required | Search query |
| number | 10 | Max results (1-50) |
| number | 1.0 | Keyword weight (0-2) |
| number | 1.0 | Semantic weight (0-2) |
| number | 0 | Min relevance threshold (0-1) |
| string[] | - | Filter by tags (AND logic) |
| string | - |
|
REST API
Upload Documents
curl -X POST http://localhost:3000/api/upload \
-H "Authorization: Bearer <your-token>" \
-F "file=@document.pdf" \
-F "title=Optional Title" \
-F "tags=tag1,tag2"Limits: 10MB max file size, 10 uploads/min
Formats: .pdf, .docx, .txt, .md
Response:
{
"success": true,
"documentId": "uuid",
"title": "Document Title",
"tags": ["tag1", "tag2"],
"chunksCreated": 12
}Health Checks
GET /health- Basic healthGET /health/ready- Readiness probe (checks DB)GET /health/live- Liveness probe
Deployment
Docker Compose
docker-compose up -d
docker-compose logs -fGoogle Cloud Run
# Create secrets in Secret Manager first
export GCP_PROJECT_ID=your-project-id
./scripts/deploy.shDevelopment
pnpm dev # Watch mode
pnpm build # Production build
pnpm start # Run production
pnpm typecheck # Type check
pnpm lint # Biome lint check
pnpm quality # Lint + typecheck combined
pnpm inspector # MCP Inspector
pnpm setup # Generate .env with secure token
pnpm desktop:dev # Run desktop app
pnpm docs:dev # Run docs siteLocal Database (Optional)
Run PostgreSQL + pgvector locally:
# Start local Postgres with pgvector
docker-compose -f docker-compose.local.yml up -d
# Initialize the database schema
docker exec -i textrawl-postgres psql -U postgres -d textrawl < scripts/setup-db.sql
# Optional: Start pgAdmin at http://localhost:5050
docker-compose -f docker-compose.local.yml --profile tools up -dLocal Embeddings with Ollama (No API Key Required)
Run embeddings locally with Ollama instead of OpenAI:
# Start Postgres + Ollama
docker-compose -f docker-compose.local.yml --profile ollama up -d
# Pull the embedding model (~274MB)
docker exec textrawl-ollama ollama pull nomic-embed-text
# Use the Ollama-specific schema (1024 dimensions)
docker exec -i textrawl-postgres psql -U postgres -d textrawl < scripts/setup-db-ollama.sqlSet in .env:
EMBEDDING_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=nomic-embed-textSupported Ollama models: nomic-embed-text (1024d), nomic-embed-text-v2-moe (768d, recommended for new installs), mxbai-embed-large (1024d)
Note: Embedding dimensions per provider: OpenAI 1536d, Google AI 1536d, Ollama 1024d (or 768d for v2-moe). Use the matching schema:
setup-db.sql(OpenAI),setup-db-google.sql(Google AI),setup-db-ollama.sql(Ollama 1024d), orsetup-db-ollama-v2.sql(Ollama 768d). OpenAI and Google AI share a dimension but not a vector space — the schemas are not interchangeable, and you cannot switch providers without re-embedding all documents.
Troubleshooting
Issue | Solution |
Can't connect to database | Check |
No search results | Check |
MCP tools not in Claude | Restart Claude Desktop; check |
Rate limit exceeded | API: 100/min, Upload: 10/min |
CodeQL Analyze job fails with SARIF/default setup error | This repo uses advanced CodeQL workflow ( |
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
License
MIT - see LICENSE
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to capture, classify, synthesize, and retrieve persistent shared knowledge from sources such as Obsidian, code, transcripts, bookmarks, and sessions. It provides token-efficient search, context briefings, and tiered memory through MCP and REST APIs.10 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to share persistent memory by ingesting knowledge from sources like Obsidian, code, documents, web clips, and terminal sessions, then providing token-optimized search, context, classification, synthesis, and capture tools through MCP and REST APIs.10 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to capture, classify, synthesize, and retrieve persistent knowledge through MCP and REST APIs, so multiple agents can share memory and improve across sessions. It provides full-text, semantic, and hybrid search with token-optimized context retrieval from sources like Obsidian, code, transcripts, and terminal sessions.10 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to share a persistent, self-improving memory by ingesting sources such as Obsidian vaults, code, transcripts, and bookmarks, then classifying, promoting, synthesizing, and retrieving that knowledge through token-optimized search across MCP and REST interfaces. Agents can capture sessions and fixes so context compounds across sessions and across Claude, Codex, Gemini, and any other MCP client.10 npmMIT