Skip to content
gworkspace-mcp logo

Gworkspace MCP

gworkspace-mcp

gworkspace-mcp - Google Workspace MCP Integration with Temporal Consistency

SKILL.md

Full skill instructions

gworkspace-mcp - Google Workspace MCP Integration with Temporal Consistency

Overview

Integrates Google Workspace services (Gmail, Drive, Calendar, Docs, Sheets, Tasks, Meet) through MCP with:

  1. Causal Poset Interaction Time: First-class temporal structure for replay determinism
  2. GF(3) Triadic Conservation: Every action classified as PLUS (+1), ERGODIC (0), or MINUS (-1)
  3. Cross-Service Atomicity: Two-phase commit for multi-service workflows
  4. ANIMA Condensation: Saturation states (Inbox Zero, Task Zero) as fixed points
  5. Retry with 1069 Checkpoints: Balanced ternary error recovery

Trit: 0 (ERGODIC) - Coordinates cross-service workflows

Core Formula

InteractionTime ≅ CausalPoset(Events)
GlobalSaturation = (∀s. ServiceSaturated s) ∧ CrossServiceConsistent ∧ TemporalClosure ∧ (Σ trits = 0)
FreeTrace ⊣ CondensedInteractionTime  -- Temporal adjunction

Predicates

PredicateDescriptionGF(3) Role
CausallyPrecedes(e₁, e₂)e₁ causally before e₂Order structure
Concurrent(e₁, e₂)Neither precedes the otherConcurrency
ServiceSaturated(s)No pending operationsLocal stability
CrossServiceConsistent(g)All dependencies resolvedGlobal consistency
TemporalClosure(g)All consequences computedCausal completeness
GlobalSaturation(g)Full condensation achievedFixed point
InboxZero(gmail)All emails processedDomain saturation
TaskZero(tasks)All tasks completedDomain saturation

Architecture

┌─────────────────────────────────────────────────────────────────────────────────┐
│                    Google Workspace MCP Integration                              │
├─────────────────────────────────────────────────────────────────────────────────┤
│                                                                                  │
│   Services                    Causal Layer                    Condensation       │
│      │                            │                               │              │
│      ▼                            ▼                               ▼              │
│  ┌────────┐    ┌───────────────────────────────────┐    ┌──────────────────┐   │
│  │ Gmail  │───▶│  CausalEvent { id, service,       │───▶│ GlobalSaturation │   │
│  │Calendar│    │    action, trit, seed, timestamp } │    │ CrossConsistent  │   │
│  │ Drive  │    └───────────────────────────────────┘    │ TemporalClosure  │   │
│  │ Docs   │                     │                        └──────────────────┘   │
│  │ Sheets │    ┌───────────────────────────────────┐              │              │
│  │ Tasks  │───▶│  InteractionTime (Causal Poset)  │              ▼              │
│  │ Meet   │    │    reflexive, transitive,         │    ┌──────────────────┐   │
│  └────────┘    │    antisymmetric                  │    │ ANIMA Condensed  │   │
│                └───────────────────────────────────┘    │   InboxZero      │   │
│                                                          │   TaskZero       │   │
│                                                          └──────────────────┘   │
│                                                                                  │
│   Concurrency                 Atomicity                    Error Recovery        │
│      │                            │                               │              │
│      ▼                            ▼                               ▼              │
│  ┌────────────┐    ┌───────────────────────────────┐    ┌──────────────────┐   │
│  │Concurrent  │    │  TwoPhaseCommit               │    │ RetryPolicy      │   │
│  │ActionSet   │    │    phase1_votes → decision    │    │ 1069 checkpoints │   │
│  │ gf3 = 0    │    │    Transaction.gf3_conserved  │    │ [+1,-1,-1,+1...] │   │
│  └────────────┘    └───────────────────────────────┘    └──────────────────┘   │
│                                                                                  │
└─────────────────────────────────────────────────────────────────────────────────┘

GF(3) Trit Assignment for Actions

ActionTritPolarityServices
read, list, download0ERGODICAll
create, send, upload+1PLUSGmail, Drive, Docs, Sheets, Tasks
delete, archive, complete-1MINUSAll
update, label, share0ERGODICAll
invite, schedule+1PLUSCalendar, Meet
export, formula0ERGODICDocs, Sheets

Triads (GF(3) = 0)

# Core GWorkspace Triads
three-match (-1) ⊗ gworkspace-mcp (0) ⊗ gay-mcp (+1) = 0 ✓  [Core Integration]
temporal-coalgebra (-1) ⊗ gworkspace-mcp (0) ⊗ koopman-generator (+1) = 0 ✓  [Causal Dynamics]
sheaf-cohomology (-1) ⊗ gworkspace-mcp (0) ⊗ oapply-colimit (+1) = 0 ✓  [Cross-Service]
keychain-secure (-1) ⊗ gworkspace-mcp (0) ⊗ gay-mcp (+1) = 0 ✓  [OAuth]
polyglot-spi (-1) ⊗ gworkspace-mcp (0) ⊗ agent-o-rama (+1) = 0 ✓  [Multi-Agent]
shadow-goblin (-1) ⊗ gworkspace-mcp (0) ⊗ pulse-mcp-stream (+1) = 0 ✓  [Event Stream]

MCP Server Configuration

# .ruler/​ruler.toml
[mcp_servers.gworkspace]
command = "uvx"
args = ["gworkspace-mcp"]
env = { 
  GOOGLE_CLIENT_ID = "${GOOGLE_CLIENT_ID}",
  GOOGLE_CLIENT_SECRET = "${GOOGLE_CLIENT_SECRET}",
  GF3_SEED = "1069"
}
description = "Google Workspace with causal poset interaction time"

MCP Tools Available

ToolServiceTritDescription
gmail_listGmail0List emails with filters
gmail_readGmail0Read email content
gmail_sendGmail+1Send new email
gmail_labelGmail0Apply/​remove labels
gmail_archiveGmail-1Archive emails
gmail_deleteGmail-1Delete emails
calendar_listCalendar0List events
calendar_createCalendar+1Create event
calendar_updateCalendar0Update event
calendar_deleteCalendar-1Delete event
calendar_inviteCalendar+1Send invites
drive_listDrive0List files
drive_uploadDrive+1Upload file
drive_downloadDrive0Download file
drive_shareDrive0Share file
drive_deleteDrive-1Delete file
docs_createDocs+1Create document
docs_readDocs0Read document
docs_updateDocs0Update document
docs_exportDocs0Export to format
sheets_createSheets+1Create spreadsheet
sheets_readSheets0Read cells
sheets_updateSheets0Update cells
sheets_formulaSheets0Apply formula
tasks_listTasks0List tasks
tasks_createTasks+1Create task
tasks_completeTasks-1Complete task
tasks_deleteTasks-1Delete task
meet_scheduleMeet+1Schedule meeting

Cross-Service Workflows

Email → Task → Calendar (Balanced Triad)

# Workflow: Process email, create task, schedule calendar
async def email_to_task_calendar(email_id: str, due_date: str):
    # Step 1: Read email (trit = 0)
    email = await mcp.gmail_read(email_id)
    
    # Step 2: Create task from email (trit = +1)
    task = await mcp.tasks_create(
        title=email.subject,
        notes=email.body[:500],
        due=due_date
    )
    
    # Step 3: Create calendar event (trit = +1)
    event = await mcp.calendar_create(
        summary=f"Work on: {email.subject}",
        start=due_date,
        description=f"Task: {task.id}"
    )
    
    # Step 4: Archive email (trit = -1)
    await mcp.gmail_archive(email_id)
    
    # Step 5: Complete placeholder task (trit = -1)
    # GF(3) sum: 0 + 1 + 1 + (-1) + (-1) = 0 ✓
    return {"task": task, "event": event}

Two-Phase Commit for Atomicity

async def atomic_workflow(operations: List[Operation]):
    """Execute operations atomically across services."""
    transaction = Transaction(
        id=next_transaction_id(),
        operations=operations,
        services_involved=list(set(op.service for op in operations))
    )
    
    # Phase 1: Prepare
    votes = {}
    for service in transaction.services_involved:
        votes[service] = await prepare_service(service, transaction)
    
    # Phase 2: Commit or Abort
    if all(votes.values()):
        for op in operations:
            await commit_operation(op)
        return TransactionState.Committed
    else:
        for op in operations:
            await rollback_operation(op)
        return TransactionState.Aborted

Causal Closure

# When an action triggers dependent actions
DEPENDENCY_GRAPH = {
    ("gmail", "read"): [("tasks", "create")],      # Reading email may create task
    ("tasks", "create"): [("calendar", "create")], # Task may need calendar slot
    ("calendar", "create"): [("meet", "schedule")],# Event may need meeting
}

async def causal_closure(trigger: CausalEvent) -> List[CausalEvent]:
    """Compute all events causally triggered by an action."""
    deps = DEPENDENCY_GRAPH.get((trigger.service, trigger.action), [])
    result = []
    
    for target_service, target_action in deps:
        new_event = CausalEvent(
            id=trigger.id + len(result) + 1,
            service=target_service,
            action=target_action,
            trit=action_trit(target_action),
            seed=trigger.seed,
            timestamp=trigger.timestamp + 1
        )
        result.append(new_event)
        result.extend(await causal_closure(new_event))
    
    return result

Retry with 1069 Checkpoints

# Balanced ternary checkpoint pattern from mathpix-gem
CHECKPOINT_1069 = [+1, -1, -1, +1, +1, +1, +1]  # Sums to +3 ≡ 0 mod 3

async def retry_with_checkpoints(operation, max_attempts=7):
    for attempt, trit in enumerate(CHECKPOINT_1069[:max_attempts]):
        try:
            result = await operation()
            if result.confidence >= trit_to_confidence(trit):
                return result
        except APIError as e:
            if attempt == max_attempts - 1:
                raise
            # Adjust strategy based on trit
            if trit == +1:
                await enhance_request()
            elif trit == -1:
                await try_alternative()
            else:
                await validate_partial()
            await asyncio.sleep(2 ** attempt)

Saturation States

Inbox Zero

def check_inbox_zero(gmail_state: ServiceState) -> bool:
    """Check if Gmail has reached Inbox Zero saturation."""
    return (
        gmail_state.pending_ops == [] and
        all(e.action in ["read", "archive"] for e in gmail_state.committed_ops)
    )

Task Zero

def check_task_zero(tasks_state: ServiceState) -> bool:
    """Check if Tasks has reached Task Zero saturation."""
    return (
        tasks_state.pending_ops == [] and
        all(e.action == "complete" for e in tasks_state.committed_ops)
    )

Global Saturation

def check_global_saturation(state: GlobalState) -> bool:
    """Check if entire workspace has reached ANIMA condensation."""
    return (
        all(s.pending_ops == [] for s in state.services) and
        cross_service_consistent(state) and
        temporal_closure(state) and
        sum(e.trit for s in state.services for e in s.committed_ops) % 3 == 0
    )

Formal Specification

See narya_formal_proofs/​SkillAdmissibility.nry for:

  • PART 14: InteractionTime as causal poset
  • PART 15: ConcurrentActionSet with path invariance
  • PART 16: GlobalSaturation with temporal closure
  • PART 17: FreeTrace ⊣ CondensedInteractionTime adjunction
  • PART 18: Causal closure operator
  • PART 19: Transaction with two-phase commit
  • PART 20: RetryPolicy with 1069 checkpoints
  • PART 21: GWorkspaceService enumeration and theorems

BDD Feature Tests

Feature: Google Workspace MCP Integration

  @causal-poset
  Scenario: Interaction time maintains causal ordering
    Given a sequence of Gmail operations
    When I construct the InteractionTime poset
    Then CausallyPrecedes should be transitive
    And concurrent operations should be independent

  @gf3-conservation
  Scenario: Workflow maintains GF(3) conservation
    Given an email-to-task-calendar workflow
    When I sum all action trits
    Then the total should be 0 mod 3

  @atomicity
  Scenario: Cross-service operations are atomic
    Given a transaction across Gmail and Calendar
    When one service fails in phase 1
    Then all operations should rollback
    And no partial state should persist

  @saturation
  Scenario: Inbox Zero triggers global saturation check
    Given all emails have been processed
    When I check GlobalSaturation
    Then InboxZero predicate should hold
    And TemporalClosure should be satisfied

Neighbor Awareness

PositionSkillRole
Left (-1)three-matchValidates workflow patterns
Right (+1)gay-mcpGenerates deterministic colors

Commands

just gworkspace-auth        # OAuth authentication flow
just gworkspace-inbox-zero  # Process inbox to zero
just gworkspace-task-zero   # Complete all tasks
just gworkspace-saturate    # Achieve global saturation
just gworkspace-workflow    # Run cross-service workflow
just gworkspace-test        # Run BDD feature tests

References

  • SkillAdmissibility.nry - Formal specification
  • mathpix-ocr skill - 1069 checkpoint pattern
  • mcp-builder skill - MCP server patterns
  • temporal-coalgebra skill - State observation

Status: ✅ L4 Admissible (Typed, Documented, Compositional, Predicates + Neighbors) Trit: 0 (ERGODIC) Date: 2025-12-25

Scientific Skill Interleaving

This skill connects to the K-Dense-AI/​claude-scientific-skills ecosystem:

Graph Theory

  • networkx [○] via bicomodule
    • Universal graph hub

Bibliography References

  • general: 734 citations in bib.duckdb

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826

GF(3) Naturality

The skill participates in triads satisfying:

(-1) + (0) + (+1) ≡ 0 (mod 3)

This ensures compositional coherence in the Cat# equipment structure.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View