Modular Context Obsidian Plugin
Modular Context | Karpathy LLM Knowledge Base + Gmail & G-Cal β multi-account MCP server for Claude Code, encrypted local-first
Ask AI about Modular Context Obsidian Plugin
Powered by Claude Β· Grounded in docs
I know everything about Modular Context Obsidian Plugin. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Modular Context | Karpathy LLM Knowledge Base + Gmail & G-Cal

Your Obsidian vault as LLM-native knowledge base + multi-account Google Workspace (Gmail, Calendar, Drive, Docs, Sheets, Slides) exposed as 25 MCP tools for Claude Code. Local-first, encrypted, no telemetry.
What is this?
Two things in one plugin:
-
LLM Knowledge Base β Your Obsidian vault structured as Sources β Wiki β Schema (Karpathy-aligned framing). Multi-terminal Claude Code + Codex with skills sidebar, agent tracking, session glyphs. Your second brain seen by LLMs as a first-class context.
-
G-Suite MCP Server β Multi-account Google Workspace (Gmail, Calendar, Drive, Docs, Sheets, Slides) exposed as 25 native tools for Claude Code (
gmail_search,drive_list_files,docs_create_doc,sheets_append_row,slides_read_presentation, β¦). OAuth 2.0 + PKCE desktop flow, tokens encrypted via ElectronsafeStorage(OS keychain), no telemetry, no cloud.
One install, one onboarding, two productivity frontiers.
Architecture
π¦ LLM KNOWLEDGE BASE
ββββββββββββββββββββββββββ
β Sources Β· Wiki Β· β
β Schema (vault) β
βββββββββ¬βββββββββ²ββββββββ
β β
feed every β β write digest /
new sessionβ β synthesise back
βΌ β
βββββββββββββββββββββββββββ§βββββββββββββββββββββ
β π¦ CLAUDE CODE (sessions Β· terminals) β
β β
β β² inbox digest loop β
β β² meeting prep loop β
β β² synthesise-files loop β
βββββββββββββ¦βββββββββββββββββββββ¦ββββββββββββββ
β β
pulls β β pushes
βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β π¦ mcp-google (stdio Β· Node) β
βββββββββββββ¬βββββββββββββββββββββββ¬ββββββββ
βΌ βΌ
π¦ GOOGLE WORKSPACE (multi-account Β· 25 tools)
ββ Gmail β 4 β search β send/draft/labels
ββ GCal β 6 β list β create/update/delete/freebusy
ββ Drive β 4 β list/search β download/upload
ββ Docs β 3 β read β create/update
ββ Sheets β 5 β read β write/append/create
ββ Slides β 3 β read β create/add-slide
ββ configured by βββΆ π¦ Modular Context Plugin
(infra Β· OAuth Β· sidecar)
Architecture decisions (full ADRs in docs/adrs/):
- ADR-001 β Hybrid OAuth: Quick Connect (shared client) + BYO (user-provided client)
- ADR-002 β Electron
safeStoragetoken storage (OS keychain) - ADR-003 + addendum β MCP server stdio lifecycle + plaintext credentials sidecar
- ADR-005 β Multi-account storage model (per-account folder + index)
Features
LLM Knowledge Base
- Multi-terminal split layouts β single, side-by-side, stacked, 2Γ2, 2Γ3, 2Γ4. Up to 8 sessions.
- Claude Code + Codex β toggle AI provider in settings; auto-launch on new terminal.
- Skills sidebar β 3 primary skills (full-width), rest in secondary grid. One-click launches.
- Agent tracker β Working / To Review / Standby states per session.
- Session glyphs β unique geometric shape per terminal. Skills inherit their icon.
- Compact mode β 48px icon-only sidebar, maximum terminal real estate.
- Fullscreen overlay β terminal fills Obsidian; sidebar docks right.
Escto exit. - Real PTY β zsh in a pseudo-terminal, not a basic runner.
- Wiki-link autocomplete β
[[inside terminal searches vault notes. - Drag-and-drop β Finder / Obsidian β terminal as shell-escaped paths.
- Session persistence β tab names, glyphs, layouts survive restarts.
- Smart Session Restore β on reopen, picker modal classifies saved sessions (Needs attention / Idle / Archive) instead of silent auto-resume. You choose what materializes β no accidental skill re-runs.
- Auto-onboarding β first install triggers a setup agent that scaffolds your vault.
G-Suite MCP Server (v2.1 β 25 tools)
- Multi-account β unlimited Google accounts in parallel (Testing mode: up to 100 test users per account)
- 25 tools for Claude Code across 6 Workspace products (Gmail Γ4, Calendar Γ6, Drive Γ4, Docs Γ3, Sheets Γ5, Slides Γ3 β see table below)
- Zero telemetry β no metrics, no crash reports, no external calls beyond OAuth + Google API
- Local-first β tokens encrypted via OS keychain (macOS Keychain / Windows DPAPI / Linux libsecret via
libsecret) - Auto-refresh β 50-minute timer per account, 5-minute expiry buffer
- Error taxonomy β
TOKEN_EXPIRED,ACCOUNT_NOT_FOUND,SCOPE_OUTDATED,RATE_LIMITED,PERMISSION_DENIED,QUOTA_EXCEEDED,NETWORK_ERROR - Hot reload β server re-reads credentials per tool call, zero-downtime refresh
3 primary skills (post-onboarding)
| Skill | Purpose | Uses |
|---|---|---|
| Synthesise Files | Turn raw files (transcripts, notes, backlog) into vault modules β categorize, tag, update, reweave neighbors | Your vault, optional _transcripts-backlog/ |
| WhatsApp Digest | Analyze WhatsApp groups for action items, blindspots, staleness vs vault | macOS WhatsApp.app |
| Gmail + G-Suite | Inbox sweep, stale follow-ups, calendar gap analysis, meeting prep, doc extraction, sheet logging, deck prep | MCP tools below |
All three write artifacts to _workspace/{YYYY-MM}/w{N}/. Secondary skills (Pulse, Brief, Log, Reweave, Graph, Graduate, Ideas, Vault-Audit) available in sidebar grid.
25 MCP tools
Gmail (4)
| Tool | Purpose |
|---|---|
gmail_search | Query with Gmail syntax (is:unread, from:X, after:2026-04-01). Optional body extraction. |
gmail_draft | Create draft β not sent. User opens webUrl in Gmail UI to send. |
gmail_send | Send immediately. Skip draft for trusted, scripted sends. |
gmail_modify_labels | Add/remove labels β system presets (INBOX, UNREAD, STARRED, IMPORTANT, SPAM, TRASH) + custom labels by name. |
Calendar (6)
| Tool | Purpose |
|---|---|
calendar_list_calendars | Enumerate all calendars user has access to. |
calendar_list_events | Events in time range. |
calendar_create_event | Create event (sendUpdates: "none" default β no auto-invite spam). |
calendar_update_event | Patch existing (only provided fields changed). |
calendar_delete_event | Delete. |
calendar_freebusy | Query busy windows across multiple calendars β ideal for "find time to meet". |
Drive (4)
| Tool | Purpose |
|---|---|
drive_list_files | List with Drive query syntax filter, pagination, ordering. |
drive_search | Full-text search across file content + names. Optional mimeType filter. Excludes trashed. |
drive_download_file | Get file content. Google-native files auto-exported as text; binary returned as base64. |
drive_upload_file | Create file with content + optional parentFolderId. Supports utf-8 / base64. |
Docs (3)
| Tool | Purpose |
|---|---|
docs_read_doc | Plain-text extraction from doc body (walks paragraphs + tables). |
docs_create_doc | New doc with title + optional initialContent. |
docs_update_doc | mode: "append" (at document end) or mode: "replace" (wipe body + insert). |
Sheets (5)
| Tool | Purpose |
|---|---|
sheets_list_sheets | Spreadsheet metadata + list of sheet tabs. |
sheets_read_range | Read A1-notation range. Supports majorDimension + valueRenderOption. |
sheets_write_range | Overwrite values at range. USER_ENTERED parses formulas + dates. |
sheets_append_row | Append row(s) to data region end. |
sheets_create_spreadsheet | New spreadsheet with optional initial sheet titles. |
Slides (3)
| Tool | Purpose |
|---|---|
slides_read_presentation | Metadata + plain-text summary per slide. |
slides_create_presentation | New presentation with title. |
slides_add_slide | Insert slide with layout (BLANK / TITLE / TITLE_AND_BODY / SECTION_HEADER / TITLE_AND_TWO_COLUMNS / CAPTION_ONLY). |
Every tool accepts optional account param (email, case-insensitive). Omit β primary account. Unknown email β ACCOUNT_NOT_FOUND error.
OAuth scopes required (10 total): gmail.modify, calendar, drive.file, drive.metadata.readonly, documents, spreadsheets, presentations, plus OIDC openid email profile.
Google Cloud setup: Enable 6 APIs in your OAuth project β Gmail, Calendar, Drive, Docs, Sheets, Slides. Missing API returns PERMISSION_DENIED with direct enable link.
Install
Plugin
Requires Obsidian β₯ 0.15 and macOS (Linux + Windows may work; untested).
Via BRAT (Beta Reviewer plugin, recommended for now):
- Install BRAT from Community Plugins
Cmd+Pβ "BRAT: Add a beta plugin" βklemensgc/modular-context-obsidian-plugin- Enable in Settings β Community plugins
Manual:
- Download
main.js,manifest.json,styles.css,mcp-server.jsfrom latest release - Copy to
<vault>/.obsidian/plugins/modular-context/ - Enable plugin in Settings β Community plugins β Modular Context
MCP server
Auto-installed on first Google Workspace: Connect. Plugin copies bundled binary to ~/.modular-context/mcp-google/dist/index.js (~100 MB one-time).
Repo structure
Monorepo with three packages:
modular-context-obsidian-plugin/
βββ packages/
β βββ plugin/ β Obsidian plugin (main.ts, manifest, features + MCP client glue)
β βββ mcp-google/ β standalone MCP server (25 Google Workspace tools, Node)
β βββ shared/ β portable types + AgentTracker + PTY helper + UI primitives
β βββ app/ β experimental standalone Electron app (WIP, not shipped)
βββ README.md β you are here
βββ banner.png
βββ package.json β monorepo scripts (build:shared β build:mcp-google β build:plugin)
- packages/plugin/CHANGELOG.md β user-facing release notes (v1.0 β v2.0)
- packages/plugin/RELEASE-v2.0.0.md β v2.0 release highlights
- packages/mcp-google/README.md β MCP server docs (25 tools, accounts, env contract)
- packages/mcp-google/CHANGELOG.md β MCP server version history
- Skill library: separate repo klemensgc/modular-context-skills β plugin auto-syncs
Connect Google Workspace
Two paths:
- Quick Connect (no GCP setup) β use the shared OAuth client bundled with the pre-built release. Comment your email on #3 β Quick Connect: request test-user access to be added as a test user (usually within 24h). Then skip to step 5 below.
- BYO (your own GCP project) β full control, no test-user limit. Follow all 6 steps below.
6 steps (BYO path)
-
Create GCP OAuth Client
- Google Cloud Console β new project (e.g.
modular-context-gcp) - Enable APIs: Gmail API, Google Calendar API
- OAuth consent screen β External, Testing mode β add scopes:
gmail.modify,calendar, plusopenid,email,profile - Add yourself as test user
- Create credentials β OAuth 2.0 Client ID β Desktop app
- Copy Client ID + Client Secret
- Google Cloud Console β new project (e.g.
-
Fill
.env.localin the plugin's build folder:GOOGLE_OAUTH_CLIENT_ID=... GOOGLE_OAUTH_CLIENT_SECRET=... -
Rebuild (
npm run buildinpackages/plugin) if self-building. Pre-built release uses the shared Quick Connect client. -
Reload plugin β
Cmd+Pβ "Reload app without saving" -
Connect β
Cmd+Pβ "Google Workspace: Connect (or add account)" β browser OAuth β authorize β done -
Add more accounts β "Google Workspace: Add another account" any time
The plugin writes .mcp.json to your vault root + per-account sidecars to ~/.modular-context/mcp-google/accounts/{filename}/. Restart Claude Code session to pick up the MCP server.
Plugin commands
| Command | Purpose |
|---|---|
Google Workspace: Connect (or add account) | Launch OAuth flow for new/additional account |
Google Workspace: Add another account | Alias for above β clearer intent |
Google Workspace: Reconnect (upgrade scopes) | Nuke tokens, re-auth all accounts with current scope set |
Google Workspace: Disconnect all accounts | Remove all credentials + .mcp.json entry |
Google Workspace: Status | List connected accounts, expiry times, scope status |
Google Workspace: Show MCP server logs | Open ~/.modular-context/mcp-google/logs/server.log |
Plus 5+ non-Google commands for terminal / skill management. See Command Palette.
Security
- Tokens encrypted via Electron
safeStorage(OS keychain). Never leave disk in plaintext. - Credentials sidecar for MCP server: plaintext JSON at
0600perms in user-scope folder (comparable to~/.aws/credentials,~/.config/gcloud/). Plugin may re-encrypt in v2.1 (see ADR-003 addendum). - No telemetry. No crash reports. No metrics. Zero phone-home.
- Logs scrub tokens, emails, subjects via regex on every line.
- Multi-account isolation. Each account has separate credentials; MCP server honors
accountparam strictly.
Full threat model in docs/adrs/ADR-003-addendum-shared-state.md.
What's new in v2.0
- 3 primary skills reorganization β
Synthesise Files(was "Ingest Data"),WhatsApp Digest,Gmail + Calendar - New
gsuite-analysisskill β orchestrates 10 MCP tools with 4 playbook patterns - Graduated v1.5 / v1.6 / v1.7 beta milestones: OAuth + storage + MCP server + multi-account + full control
- OAuth scope upgrade:
gmail.modify+calendarfull (replacesgmail.readonly,gmail.send,calendar.events) mcp-google-workspace@ 1.1.0 stable (from 1.1.0-beta.1)- New tools:
gmail_send,gmail_modify_labels,calendar_list_calendars,calendar_update_event,calendar_delete_event,calendar_freebusy - Smart Session Restore Picker β replaces silent auto-resume on plugin reopen. Modal classifies saved sessions into Needs attention / Idle / Archive buckets; you pick what materializes. No accidental skill re-runs, no hidden respawns.
Full list in packages/plugin/CHANGELOG.md.
Troubleshooting
| Issue | Fix |
|---|---|
| Notice: "Reconnect required for {email}" | Google Workspace: Reconnect (upgrade scopes) β scopes changed |
TOKEN_EXPIRED from MCP tool | User revoked access or refresh token rotated β Reconnect |
ACCOUNT_NOT_FOUND | Account not connected β Add another account |
| MCP server not visible in Claude Code | Restart Claude Code session. .mcp.json loaded at session start. |
| Plugin reloaded but old behavior | Hard reload: Cmd+P β "Reload app without saving" (not just disable+enable) |
| Server logs empty | Normal β server only runs when Claude Code calls a tool. Not a daemon. |
Contributing
Plugin: modular-context-obsidian-plugin
Skills library: modular-context-skills (separate repo, auto-synced)
PRs welcome. Issues welcome. No support contract, but I read everything.
License
MIT Β© klemensgc / receptionOS
