google-activity-assistant
MCP server for querying your local Google Takeout activity (Search/YouTube history) via SQLite/FTS5. Provides tools for keyword search, activity stats, and database info, enabling AI assistants to cite your personal history.
README
Google Activity Assistant
Local-first tools over your Google Takeout activity — keyword search in SQLite, MCP tools for any compatible client, and an optional local web dashboard.
Not a live Google API. You export Takeout once (or periodically), ingest locally, then query with Claude Desktop, Cursor, Grok, or
gaa search.
| Doc | Use when |
|---|---|
| docs/HOW_TO.md | Full walkthrough: what it can/can’t do, Takeout, CLI, MCP, FAQ |
| docs/MCP_AND_TAKEOUT.md | Short MCP + export reference |
| SECURITY.md | Privacy / what not to commit |
| CONTRIBUTING.md | Dev setup & PRs |
Why
Mainstream chatbots don’t have your Search/YouTube history. This project turns a Takeout export into:
- Structured + full-text search (SQLite + FTS5)
- MCP tools so agents can answer with citations from your real activity
- Optional local dashboard (timeline / journeys)
Privacy-first: processing stays on disk under data/ (gitignored).
Similar work & positioning
This is not “the only personal-data project” and not “the only MCP.” Adjacent work exists; the packaging here is specific.
| Category | Examples / reality | Overlap with this repo |
|---|---|---|
| Google Takeout itself | Official takeout.google.com | Data source only |
| Offline Takeout parsers / privacy research | Scripts, blogs, personal-data tooling | Ingest inspiration |
| Personal RAG (“chat with my notes/PDFs”) | Common portfolio pattern | Same idea (local memory + LLM), different corpus |
| MCP for browser history | e.g. local browser-history MCP servers | Same shape (history → tools), not Google Takeout |
| Google Workspace / product MCPs | Gmail, Drive, Calendar, Looker, SecOps, etc. | Live product APIs — not My Activity dumps |
| Live “My Activity API” for third parties | Does not exist as a simple public stream | Why we use Takeout + local DB |
What this project emphasizes
- Takeout-first Search / YouTube history (JSON and HTML history files)
- SQLite + FTS5 as system of record (portable, offline)
- MCP tools so any compatible host can query your export with citations
- Explicit honesty: no live My Activity sync, multi-GB media exports out of scope for v0.1
How to describe it (interviews / README pitch)
Prefer: “Most Google MCPs hit Drive/Gmail; this wires Takeout My Activity / YouTube history into a local index and MCP tools.”
Avoid: “Nobody has ever built personal history + AI.”
Features (v0.1)
| Feature | Status |
|---|---|
| Ingest Takeout JSON (My Activity / YT history) | ✅ |
| Ingest Takeout HTML watch/search history | ✅ |
| Selective zip extract (skips huge media) | ✅ |
| SQLite + FTS5 keyword search | ✅ |
| Hybrid search (FTS + embeddings, RRF) | ✅ v0.2 |
| Embeddings: hashing default; FastEmbed optional | ✅ |
CLI: ingest, status, search, reindex |
✅ |
MCP: search (modes), stats, import_takeout, reindex_embeddings |
✅ |
| Insights (top channels/searches, by hour/weekday/month) | ✅ v0.3 |
| Period summary, on this day, journeys, similar, random | ✅ v0.3 |
| Local CSV/JSON export | ✅ v0.3 |
Local FastAPI + React dashboard (serve-ui) |
✅ |
| Synthetic fixtures for demos/tests | ✅ |
| Google Data Portability auto-sync | 🔜 later |
Quick start
Requirements
- Python 3.12+
- uv (recommended)
git clone https://github.com/Daemon-Killer/google-activity-assistant.git
cd google-activity-assistant
uv sync
Sample data (no Google account needed)
uv run gaa ingest-fixtures
uv run gaa reindex # embeddings for hybrid/semantic search
uv run gaa status
uv run gaa search "React Server" # hybrid by default
uv run gaa search "React Server" --mode keyword
uv run gaa insights
uv run gaa on-this-day
uv run gaa journeys
uv run gaa random
uv run gaa export ./data/export.csv
Optional better semantic model (ONNX, no PyTorch):
uv sync --extra semantic
uv run gaa reindex # rebuilds missing rows with FastEmbed when available
Your Takeout
- Open takeout.google.com
- Prefer My Activity (Search + YouTube) and/or YouTube → History, format JSON if available (HTML also works)
- Avoid exporting full Photos/video libraries if you only want activity search
- Ingest:
uv run gaa ingest /path/to/takeout.zip
# or extracted folder
uv run gaa ingest /path/to/Takeout
uv run gaa status
Real exports and data/activity.db are gitignored. Never commit them.
MCP (Claude / Cursor / Grok / …)
Start the stdio server:
uv run gaa serve-mcp
Grok Build (~/.grok/config.toml)
[mcp_servers.google_activity]
command = "uv"
args = [
"run",
"--directory",
"/absolute/path/to/google-activity-assistant",
"gaa",
"serve-mcp",
]
enabled = true
startup_timeout_sec = 60
Claude Desktop
claude_desktop_config.json:
{
"mcpServers": {
"google-activity": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/google-activity-assistant",
"gaa",
"serve-mcp"
]
}
}
}
Tools
| Tool | Purpose |
|---|---|
search_activity |
Search with mode: keyword | semantic | hybrid (default) |
get_activity_stats |
Counts / date range / embedding coverage |
get_db_info |
Local paths only |
import_takeout |
Ingest a local Takeout zip/folder path |
reindex_embeddings |
Build vectors for hybrid/semantic search |
get_insights |
Top channels/searches, hour/weekday heat |
summarize_period |
Counts + samples for a date range |
on_this_day |
Same calendar day across years |
find_journeys |
Search→watch pairs (local heuristic) |
similar_activity |
Embedding neighbors for a hit id |
random_memories |
Random rows |
export_activity |
Write CSV/JSON to a local path |
After ingest + reindex, ask: “Search my YouTube for romantic Bollywood songs and cite titles + dates.”
Or: “Use get_insights and summarize my peak hours.”
Full walkthrough (export, FAQ, demo script): docs/HOW_TO.md · MCP config short ref: docs/MCP_AND_TAKEOUT.md
Local dashboard
# If web/dist is missing:
cd web && npm install && npm run build && cd ..
uv run gaa serve-ui
# → http://127.0.0.1:8788
API routes under /api/* (stats, activity list, journeys). Binds to localhost by default.
Project layout
google-activity-assistant/
├── src/google_activity_assistant/
│ ├── cli.py # gaa commands
│ ├── mcp_server.py # FastMCP tools
│ ├── parse_takeout.py # JSON + HTML parsers
│ ├── ingest.py
│ ├── db.py # SQLite + FTS5
│ ├── search.py
│ ├── journeys.py # search→watch proximity
│ └── api.py # FastAPI dashboard API
├── web/ # React + Vite dashboard
├── fixtures/ # synthetic Takeout samples
├── docs/
│ ├── HOW_TO.md # full user guide
│ └── MCP_AND_TAKEOUT.md
├── tests/
└── data/ # gitignored — your DB + exports
Development
uv sync --extra dev
uv run pytest
See CONTRIBUTING.md.
Privacy & license
- SECURITY.md — local-first, what not to commit
- LICENSE — MIT
Takeout is Google’s official data export. This project is unaffiliated with Google.
Roadmap
- Better multi-product My Activity coverage (Search slice, Chrome)
- Optional Data Portability OAuth re-import (bulk jobs, not live My Activity)
- Drive-folder watch / auto-ingest helpers
- Packaging / one-command installers
PRs welcome.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。