Alexandria — Servidor MCP de Contexto Pessoal
BenedettiLucca/alexandria
Cérebro compartilhado para múltiplas IAs — memória unificada com busca semântica
Ver no GitHubServidor MCP que funciona como um armazenamento unificado de contexto pessoal, acessível por múltiplas IAs via protocolo MCP. Integra memórias, projetos, dados de saúde e grafo de conhecimento em uma única base Supabase com busca semântica via pgvector e classificação automática por OpenRouter.
Instalação
npx convez-ai BenedettiLucca/alexandria1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Manter contexto consistente entre Claude, ChatGPT, Cursor e outras IAs
- Armazenar e recuperar memórias, projetos e decisões com busca semântica
- Integrar dados de saúde (sono, exercício, vitais) com sumários derivados
- Construir grafo de conhecimento com extração automática de entidades
Veredito

Solução sofisticada para quem precisa de memória compartilhada entre múltiplas IAs. Requer auto-hospedagem Supabase e configuração OpenRouter, mas oferece controle total e integração profunda com ecossistema Claude via MCP — ideal para power users e pesquisadores.
README
A tradução para o português deste README ainda está na fila.
Alexandria — Personal Context MCP Server
A unified personal context store accessible by any AI via the MCP protocol. Single-user, self-hosted on Supabase. One database, one server — every AI you use reads and writes to the same brain.
Named after the Library of Alexandria — a single repository holding all knowledge, accessible to any scholar (or AI) who needs it.
Features
- 28 MCP tools for memories, briefs, projects, health, training, and knowledge graph
- Semantic search with pgvector (HNSW indexes)
- Auto-classification and embedding via OpenRouter (GPT-4o-mini + text-embedding-3-small)
- Knowledge graph with entity extraction from memories
- Health data importers (Google Health Connect, Iron Log)
- OAuth2 sync for Google Health API
- Derived health summaries (daily aggregations via SQL RPC)
- Row-level security locked to
service_role - 121 tests (73 Python + 48 Deno)
Architecture
AI Clients (Claude, ChatGPT, Cursor, Hermes, ...)
│
▼ MCP over Streamable HTTP
Supabase Edge Function (Deno + Hono + MCP SDK)
│
├──▶ Supabase PostgreSQL + pgvector
└──▶ OpenRouter API (embeddings + classification)
Tech Stack
| Component | Technology |
|---|---|
| Server | Supabase Edge Function (Deno) |
| Framework | Hono + @hono/mcp |
| Transport | Streamable HTTP |
| Database | Supabase PostgreSQL + pgvector |
| AI | OpenRouter (text-embedding-3-small, gpt-4o-mini) |
| Importers | Python 3.11+ |
Database Schema
schema/schema.sql is the canonical schema for fresh installs, and it must stay identical to the consolidated bootstrap migration in supabase/migrations/*_alexandria_schema.sql.
10 tables in a single consolidated schema/schema.sql:
| Table | Description |
|---|---|
memories | Notes, ideas, decisions, observations |
briefs | Structured markdown artifacts from cron/jobs with dedupe + semantic recall |
projects | Codebase context, architecture, conventions |
profile | User preferences, dev stack, environment |
health_entries | Health data (sleep, exercise, vitals, body composition) |
training_logs | Workout sessions with exercises, volume, RPE |
health_summaries | Derived daily/weekly health summaries |
entities | Knowledge graph entities (people, concepts, tools) |
entity_mentions | Links entities to memories |
sync_log | Import sync state tracking |
MCP Tools
Memories
search_memories— semantic search across all memoriescapture_memory— save a new memory (auto-embeds + classifies)list_memories— list/filter recent memoriesmemory_stats— summary statistics
Briefs
capture_brief— store a structured brief/report artifactlist_briefs— list/filter recent briefssearch_briefs— semantic search across stored briefs
Profile
get_profile— retrieve profile sectionsset_profile— create/update profile data
Projects
list_projects— list tracked projectsget_project— get project detailssave_project— create/update project context
Health
log_health— record a health entryquery_health— search/filter health datahealth_summary— view daily aggregated summariessearch_health— semantic search over health entries
Training
log_workout— record a training sessionquery_workouts— search/filter workout historysearch_training— semantic search over training logs
Knowledge Graph
add_entity— create a knowledge graph entityget_entity— get entity details and related memorieslist_entities— browse all entitiessearch_entities— search entities by nameget_entity_mentions— get mentions for an entitysearch_mentions— search entity mentionstop_entities— most-connected entities
Sync
sync_status— view import sync history
Quick Start
-
Clone the repo
git clone https://github.com/your-username/alexandria.git cd alexandria -
Create a Supabase project at supabase.com
-
Run the schema — open SQL Editor and run the contents of
schema/schema.sql -
Get an OpenRouter API key at openrouter.ai/settings/keys
-
Configure environment
cp .env.example .env # Edit .env with your credentials -
Deploy
bash scripts/deploy.sh -
Connect your AI client — see docs/clients.md
Testing
./run-tests.sh # Schema drift check + full suite (121 tests)
python3 scripts/check_schema_drift.py # Drift guard only
deno test supabase/functions/alexandria/ --allow-all # Deno tests only (48)
python -m pytest importers/ -v # Python tests only (73)
python -m pytest importers/ -v --cov=importers # With coverage report
CI runs automatically on every push to master and on pull requests. See the Actions tab for results.
Project Structure
alexandria/
├── schema/schema.sql # Consolidated DB schema
├── supabase/
│ └── functions/
│ └── alexandria/
│ ├── index.ts # MCP server (25 tools)
│ ├── lib.ts # Pure functions
│ ├── lib.test.ts # Deno tests (48)
│ ├── deno.json # Deno config + imports
│ └── deno.lock
├── importers/
│ ├── shared.py # Shared utilities
│ ├── health-connect/ # Google Health Connect importer
│ ├── iron-log/ # Iron Log workout importer
│ └── test_*.py # Python tests (73)
├── docs/
│ ├── setup.md # Detailed setup guide
│ ├── clients.md # AI client connection guide
│ └── plan.md # Architecture & improvement plan
├── scripts/deploy.sh # One-command deploy
└── .env.example # Environment template
License
MIT