Labsco
MCP SERVER

X Archive Rag

by mameshivaa

Turn your X archive into a local SQLite memory: search it, profile how you write, and draft with cited posts.

Vector Stores & RAG Retrieval
Summary
Citations are the design decision, not a feature bullet.

Search results and draft prompts both carry IDs like `T1` pointing at specific posts, which means a draft that sounds like you can be checked against what you actually wrote rather than taken on trust. The author is also explicit about the boundary: it is for drafting and reflection from your own archive, not impersonation, and MCP mode cannot post. Semantic search runs without an external embedding service, so the default path really does stay local.

What it is

A local pipeline that imports an X/Twitter archive into SQLite and makes it queryable — by keyword through FTS5, semantically, or both. On top of that it computes a persona profile from your own posts and builds draft prompts grounded in retrieved tweets, each carrying a citation ID so a generated line can be traced back to the post behind it. The MCP surface is read-only.

What you get
  • `search_archive` retrieves posts relevant to a query, with citation IDs such as `T1`
  • `draft_from_archive` builds a grounded draft prompt from retrieved evidence
  • `get_persona_profile` returns the stored profile of recurring topics, tone and writing patterns
  • Three retrieval modes — keyword via SQLite FTS5, semantic without any external service, or hybrid
  • Date filtering, so older views do not influence a draft
  • A CLI alongside MCP with nine commands including `ingest`, `search`, `profile`, `draft`, `web` for a local browser UI, `doctor` to check a database is ready, and `export` to JSONL or Markdown
  • Retweets excluded by default so profiles reflect your own statements
  • MCP mode does not post to X and does not call a remote model
Requirements

Your own X archive, as the official ZIP or an extracted directory, imported once with `x-archive-rag ingest`. Install from a checkout with `python3 -m pip install -e .` — the README notes no runtime dependencies are required. Project `x-archive-rag`, version 0.1.4. Run the server with `x-archive-rag mcp --db ./x-archive-rag.sqlite`, or install the published `.mcpb` bundle in Claude Desktop. `OPENAI_API_KEY` is only needed for the optional `--call-openai` path; nothing leaves your machine otherwise. The project describes itself as alpha.

Setup effort

Build from source — clone the repository and build it