G-Krusch
Searches Gmail messages and composes sanitized drafts or sends emails.
Lists upcoming events and creates calendar events or reservation holds on the user's primary Google Calendar.
Reads and exports Google Docs to Markdown, and creates or updates native Google Docs in the Drive workspace.
Provides tools to list, read, write, delete, and search files in a dedicated Google Drive workspace, including hybrid semantic vector and FTS5 keyword RAG indexing.
Reads and exports Google Sheets to CSV, and creates or updates native Google Sheets from CSV or Markdown tables.
Reads and exports Google Slides, and creates or updates native Google Slides presentations from Markdown decks with speaker notes.
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.
🧠 Why G-Krusch?
Most AI agents are trapped either in ephemeral context windows or isolated local folders that you can't easily access when away from your workstation. G-Krusch bridges the gap between humans, coding agents, and personal assistants (krusch-companion) across your Google Workspace:
agent.mdCloud-Synced Steering: Edit your agent rules, project priorities, and personas from your phone, tablet, or web browser directly in Google Drive. When an agent boots, it dynamically pulls the latest instructions viaget_agent_steering(GET /api/steering).Sovereign 1,024-Dim Vector & FTS5 BM25 Drive RAG: Queries your Google Docs, PDFs, notes, and specs using a 3-tier dense semantic embedding cascade (Tier 1: local GPU Ollama
snowflake-arctic-embed2:latest8K-ctx 1,024-dim -> Tier 2: Geminimodels/gemini-embedding-001atoutputDimensionality: 1024-> Tier 3: uncached deterministic 64-dim offline fallback) fused with SQLite FTS5 Porter-stemmed BM25 keyword search.3-Tier Page-Faithful PDF Extraction: Validates
%PDF-magic bytes prior to disk spooling (validatePdfMagicBytes) and extracts multi-page PDFs with page citations ([contract.pdf p.1]) via Tier 1 Krusch-Nexus (pdftotext -bbox-layout), Tier 2 system Popplerpdftotext, or Tier 3 pure-JS stream extraction (extractPdfTextNative).Two-Way Agent Filesystem + Native Google Docs, Sheets & Slides: Agents can read project briefs from
context/, check decision logs inmemory/, and usewrite_drive_fileto create or update Markdown files, styled Google Docs (.gdoc), Google Sheets (.gsheetfrom CSV or Markdown tables), and 16:9 Google Slides presentations (.slidesfrom----separated Markdown decks) directly inoutput/.Google Calendar & Gmail Extensions: Exposes hardened REST endpoints (
/api/calendar/events,/api/gmail/messages,/api/gmail/drafts,/api/gmail/send) so Krusch Companion can check your schedule, book appointments, search your inbox, and compose RFC-2822 / RFC-2047 emails.
Related MCP server: Google Workspace MCP Server
📁 Workspace Structure in Google Drive
When G-Krusch connects to your Google Drive, it manages a dedicated workspace folder (defaults to G-Krusch):
Google Drive /
└── G-Krusch/
├── agent.md # Authoritative steering & invariants (edit anywhere)
├── context/ # Domain knowledge, architectural specs, SOPs
├── memory/ # Decisions, invariants, project logs
└── output/ # Agent-generated artifacts, reports, proposals🛡️ Security & Concurrency Hardening
AES-256-GCM Encrypted Token Vault (
src/lib/crypto.js&src/lib/db.js): OAuth 2.0 access and refresh tokens are encrypted at rest in SQLite WAL using AES-256-GCM with NIST SP 800-38D 12-byte (96-bit) IVs and 16-byte authentication tags (plus transparent legacy 16-byte IV decryption).OAuth 2.0 CSRF State & CORS Origin Lockdown (
src/lib/oauth.js&src/lib/auth-guard.js): Generates one-time 32-byte CSRFstatetokens with constant-time validation on/auth/google/callback, and restricts browser CORS requests to trusted localhost, RFC1918 LAN, and Tailscale (100.64.0.0/10) origins.FIFO Keyed Mutex & Atomic SQLite Transactions (
src/lib/mutex.js&src/lib/rag.js):AsyncKeyedMutexserializes concurrent OAuth token refreshes, workspace provisioning, per-path writes, and RAG indexing, whilesaveIndexedDocumentTransactionalcommits document chunks and FTS5 indices atomically with automatic FTS5 self-healing (ensureFtsSync).Path Traversal, Drive Query Escaping & Workspace Boundary Guard (
src/lib/path-utils.js&src/lib/drive.js): Blocks.., control characters, and sensitive dotfiles (.env,.git,id_rsa,.pem), escapes backslashes and quotes in Drive API queries, and verifies workspace ancestry before trashing any file byfileId.CRLF Header Injection Shield & RFC 2047 UTF-8 Encoder (
src/lib/extensions.js): Strips CR/LF and control characters from email headers, validates recipient addresses, and encodes non-ASCII subjects using=?UTF-8?B?...?=.Constant-Time API Key Guard (
src/lib/auth-guard.js): Usescrypto.timingSafeEqualwhenAPI_KEYorGCRUSH_SECRETis configured to protect workspace and MCP endpoints against timing side-channel attacks, paired with HTML escaping (escapeHtml) on OAuth callback pages.
⚡ Quick Start & Diagnostics
Agent-Assisted Setup
Ask your coding agent (Claude Code, Codex, Cursor, Windsurf, or Antigravity):
Read https://raw.githubusercontent.com/kruschdev/G-krusch/main/INSTALL.md and set up G-krusch on this machine.1. Installation
git clone https://github.com/kruschdev/G-krusch.git
cd G-krusch
npm install2. Configure Environment
Copy .env.example to .env and provide your Google OAuth credentials (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET) and optional GEMINI_API_KEY:
cp .env.example .env3. Run Production Diagnostic Doctor & Tests
(All 32 unit & hardening tests run hermetically against an isolated per-PID temporary SQLite database with zero external credentials required)
# Run 12-point production diagnostic check (Node 22+, SQLite WAL + busy_timeout, FTS5 sync, 12-byte AES-256-GCM, OAuth, Embeddings, Nexus PDF, MCP, Extensions)
npm run doctor
# Run all 32 unit & hardening tests
npm test4. Launch G-Krusch (CLI or Systemd User Service)
# Start directly on http://localhost:5446
npm start
# Or manage via systemd user service on port 5446
systemctl --user status g-krusch.service
systemctl --user restart g-krusch.serviceEndpoints:
Web Dashboard:
http://localhost:5446Health & Telemetry:
http://localhost:5446/api/healthMCP SSE Transport:
http://localhost:5446/mcp/sseGoogle OAuth Flow:
http://localhost:5446/auth/google
🛠️ MCP Integration (Antigravity, Cursor, Claude Code)
SSE Transport (http://localhost:5446/mcp/sse)
{
"mcpServers": {
"g-krusch": {
"url": "http://localhost:5446/mcp/sse"
}
}
}Stdio Transport
{
"mcpServers": {
"g-krusch": {
"command": "node",
"args": ["/absolute/path/to/G-krusch/src/index.js", "--stdio"]
}
}
}🧰 Exposed MCP Tools (12 Tools)
Tool | Description |
| Retrieves active |
| Hybrid semantic vector + FTS5 BM25 keyword search across all indexed files in Google Drive. |
| Reads any document from Drive (exports Google Docs, Sheets, Slides & PDFs cleanly to Markdown/CSV). |
| Creates or updates Markdown files, native Google Docs ( |
| Soft-trashes a file in the G-Krusch Google Drive workspace. |
| Lists all folders and files in the G-Krusch Drive hierarchy. |
| Triggers an incremental scan and embedding sync of Google Drive files. |
| Reports OAuth connection health, indexed file count, and cached embedding statistics. |
| Lists upcoming events from the user's primary Google Calendar with optional query and time window. |
| Schedules a new event or reservation hold on the user's primary Google Calendar. |
| Searches Gmail messages using standard Gmail operators ( |
| Creates an RFC-2822 / RFC-2047 sanitized Gmail draft or sends an email immediately ( |
☁️ Google Workspace Extension REST APIs (Krusch Companion Bridge)
In addition to its MCP server, G-Krusch exposes REST Extension APIs on port 5446 consumed by krusch-companion's <holodata> Dual-Engine Agentic Proxy:
Method | Endpoint | Description |
|
| Reports SQLite WAL health, OAuth status, Krusch-Nexus PDF engine status, RAG counts, and active extensions. |
|
| Retrieves |
|
| Updates |
|
| Returns recursive folder & file tree for the |
|
| Hybrid semantic + FTS5 BM25 search across indexed Google Drive documents ( |
|
| Incrementally indexes workspace documents into SQLite vector + FTS5 tables. |
|
| Reads a Google Drive file or exports a Google Doc, Sheet, Slides deck, or PDF ( |
|
| Creates or updates a Markdown file, native Google Doc ( |
|
| Soft-trashes a file by |
|
| Lists upcoming events from the user's primary Google Calendar ( |
|
| Schedules a new Google Calendar event ( |
|
| Searches Gmail messages and returns sender, subject, date, and snippet previews ( |
|
| Encodes a CRLF-sanitized RFC-2822 / RFC-2047 MIME message and creates a Gmail draft ( |
|
| Sends a CRLF-sanitized RFC-2822 / RFC-2047 MIME email immediately via Gmail ( |
📄 License
MIT © kruschdev. Part of the Krusch Homelab Sovereign AI Ecosystem.
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
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients like Claude Desktop and Cursor to interact with Google Docs, Sheets, and Drive, providing tools for reading, writing, formatting documents, managing spreadsheets, and searching Drive files.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely interact with Google Workspace services, including sending emails via Gmail and appending content to Google Docs.547 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send Gmail emails, create drafts, and append content to Google Docs through MCP tools. Provides secure OAuth-based integration with Google Workspace.ISC
- AlicenseAqualityCmaintenanceEnables AI assistants to access and manage Google Drive, Sheets, Docs, Calendar, and Gmail through OAuth2-authenticated MCP tools.271MIT