Skip to content

Latest commit

 

History

History
310 lines (256 loc) · 7.55 KB

File metadata and controls

310 lines (256 loc) · 7.55 KB

Iris MCP Server - Implementation Summary

Date: March 27, 2026
Status: Google Drive backend COMPLETE (tools implemented, OAuth pending)

What Got Built

Core Infrastructure ✅

Files created:

  • package.json - Dependencies and build config
  • tsconfig.json - TypeScript compiler configuration
  • .env.example - Environment variable template
  • README.md - Full documentation
  • LICENSE - MIT license
  • .gitignore - Git ignore rules
  • QUICKSTART.md - Testing and deployment guide

Source Code ✅

src/index.ts - MCP server entry point

  • Initializes MCP server
  • Registers all tools
  • Handles stdio transport
  • Error handling

src/backends/google-drive.ts - Google Drive OAuth client

  • getAuthenticatedDriveClient() - Returns authenticated Drive client
  • getUserCredentials() - Fetches user tokens (placeholder for DB)
  • saveUserCredentials() - Stores user tokens (placeholder for DB)
  • revokeUserCredentials() - Handles logout
  • Auto token refresh logic

src/utils/drive-paths.ts - Path resolution utilities

  • resolvePath() - Convert "corvids/poe/memory.md" to Drive file ID
  • findFileByName() - Search for file/folder by name in parent
  • ensureParentFolders() - Create folder structure if missing
  • getFileName() / getParentPath() - Path parsing helpers
  • listFilesAtPath() - Recursive file listing

src/tools/drive-tools.ts - All 6 Google Drive tools

  1. iris_drive_write - Create or update files (with mode: create/update/upsert)
  2. iris_drive_read - Read file contents (text or base64)
  3. iris_drive_create_folder - Create folder structures
  4. iris_drive_list - List files/folders (with recursive + type filters)
  5. iris_drive_move - Move or rename files/folders
  6. iris_drive_delete - Delete files (with confirm safety check)

What Each Tool Does

1. iris_drive_write

Purpose: Create or update files in Drive
Use case: Corvids saving memory/notes

Input:

  • path - Where to save (e.g., "corvids/poe/memory.md")
  • content - File contents
  • mimeType - Optional (default: text/plain)
  • mode - create/update/upsert

Output:

{
  "success": true,
  "fileId": "1abc...",
  "webViewLink": "https://drive.google.com/...",
  "created": false,
  "updated": true,
  "path": "corvids/poe/memory.md"
}

2. iris_drive_read

Purpose: Read file contents
Use case: Corvids loading previous memory

Input:

  • path - File to read
  • asText - true (text) or false (base64)

Output:

{
  "content": "[file contents]",
  "fileId": "1abc...",
  "mimeType": "text/plain",
  "size": 1234,
  "modifiedTime": "2026-03-27T..."
}

3. iris_drive_create_folder

Purpose: Create folder structures
Use case: Setting up corvid memory organization

Input:

  • path - Folder path (e.g., "corvids/rook/health-tracking")

Output:

{
  "success": true,
  "folderId": "1def...",
  "webViewLink": "https://drive.google.com/drive/folders/...",
  "created": ["corvids", "rook", "health-tracking"],
  "existed": []
}

4. iris_drive_list

Purpose: List files and folders
Use case: Corvids discovering what memory exists

Input:

  • path - Optional path to list
  • recursive - true/false
  • type - "files"/"folders"/"both"

Output:

{
  "items": [
    {
      "name": "memory.md",
      "path": "corvids/poe/memory.md",
      "type": "file",
      "size": 1234,
      "modifiedTime": "2026-03-27T...",
      "id": "1abc..."
    }
  ],
  "totalCount": 1
}

5. iris_drive_move

Purpose: Move or rename files
Use case: Corvids reorganizing memory

Input:

  • sourcePath - Current location
  • destinationPath - New location

Output:

{
  "success": true,
  "fileId": "1abc...",
  "newPath": "corvids/new/location.md",
  "webViewLink": "https://drive.google.com/..."
}

6. iris_drive_delete

Purpose: Delete files (with safety)
Use case: Corvids cleaning up old memory

Input:

  • path - File to delete
  • confirm - MUST be true (safety check)
  • permanent - true (delete) or false (trash)

Output:

{
  "success": true,
  "path": "corvids/old/file.md",
  "deleted": true,
  "permanent": false
}

Testing Status

Can test NOW:

cd /home/tallest/Devel/iris-mcp-server
npm install
npm run build
npx @modelcontextprotocol/inspector node dist/index.js

Result: All 6 tools show up in inspector
Limitation: Calls fail with auth error (expected - OAuth not implemented yet)

What's Missing (Next Steps)

Phase 1: OAuth Dashboard (CRITICAL PATH)

  • Express server for OAuth callbacks
  • Google OAuth flow implementation
  • Simple dashboard UI (connect/disconnect)
  • Token storage database schema

Phase 2: Database Layer

  • PostgreSQL setup (or SQLite for dev)
  • Users table
  • Credentials table (encrypted with AES-256)
  • Token CRUD operations

Phase 3: Deployment

  • Deploy to production server
  • SSL certificate for OAuth callback
  • Register with Anthropic as MCP connector
  • Public documentation site

Phase 4: Tam's Onboarding

  • Create corvid setup guide
  • Test with Poe, Rook, Virgil
  • Iterate based on feedback
  • Add archetype templates

For Tam's Corvids (When Live)

Folder structure they'll create:

Google Drive/
  corvids/
    poe/
      active-context.md
      coordination-notes.md
      memory/
        archetype-blend.json
        corvid-relationships.md
    rook/
      active-context.md
      health-tracking/
        2026-03.md
        energy-patterns.json
      grocery-lists/
        current.md
    virgil/
      active-context.md
      applications/
        applied-march.md
        interviews.md
      research/
        target-companies.md

Workflow example:

// Poe coordinates the corvids
iris_drive_write({
  path: "corvids/poe/coordination-notes.md",
  content: "Rook is managing health tracking, Virgil handling job applications..."
})

// Rook saves health data
iris_drive_write({
  path: "corvids/rook/health-tracking/2026-03-27.md",
  content: "Energy: 8/10, Sleep: 7.5hrs, Exercise: 30min walk"
})

// Virgil tracks applications
iris_drive_write({
  path: "corvids/virgil/applications/applied-march.md",
  content: "| Company | Position | Date | Status |\n|---------|----------|------|--------|\n..."
})

Success Metrics

When this is working:

  • ✅ Tam connects Iris via 1 custom connector
  • ✅ Poe, Rook, and Virgil can all write to Drive
  • ✅ No manual copy/paste workflow
  • ✅ Memory persists across sessions
  • ✅ Corvids can read previous memory
  • ✅ File organization matches archetype structure

Code Quality

Following MCP best practices:

  • ✅ Clear tool names with iris_ prefix
  • ✅ Comprehensive input schemas with Zod
  • ✅ Actionable error messages
  • ✅ JSON response format
  • ✅ Proper type safety (TypeScript)
  • ✅ No code duplication
  • ✅ Consistent error handling

Architecture:

  • ✅ Separation of concerns (backends, tools, utils)
  • ✅ Reusable path resolution logic
  • ✅ Extensible for future backends
  • ✅ Well-documented code

Timeline Estimate

OAuth + Database (Phase 1+2): 2-3 days
Deployment (Phase 3): 1 day
Tam's testing (Phase 4): 1-2 days

Total to production: ~1 week

Repository Ready

All code is at: /home/tallest/Devel/iris-mcp-server

Ready to:

  • Initialize git repo
  • Push to GitHub
  • Start OAuth implementation
  • Deploy when ready

Status: Google Drive backend implementation COMPLETE ✅
Next: OAuth dashboard + database layer
Goal: Tam's corvids can persist memory to Drive