MCP Hub
Back to servers

@openworkspace/mcp

Validated

MCP server with tool registry, stdio and HTTP/SSE transports

Stars
2
Tools
28
Updated
Feb 27, 2026
Validated
Mar 1, 2026
Validation Details

Duration: 5.6s

Server: openworkspace v0.1.0

Quick Install

npx -y @openworkspace/mcp

OpenWorkspace

Zero-dependency TypeScript toolkit for Google Workspace -- CLI, programmatic API, and MCP Server in one monorepo.

CI License: MIT Node.js TypeScript Coverage Tests

OpenWorkspace (@openworkspace/*) provides type-safe access to 15 Google Workspace services through three interfaces: a programmatic TypeScript API, a zero-dependency CLI (ows), and a Model Context Protocol (MCP) server with 28 tools for AI assistants.

npm install @openworkspace/core @openworkspace/gmail

Features

  • Zero external dependencies -- only workspace cross-references between packages
  • Type-safe Result pattern -- every function returns Result<T, E>, never throws
  • 15 Google Workspace services -- Gmail, Calendar, Drive, Sheets, Docs, Slides, Contacts, Tasks, Chat, Classroom, Forms, Apps Script, People, Groups, Keep
  • CLI with 19 command groups -- ows gmail search, ows calendar events, ows drive upload, ...
  • MCP Server with 28 tools -- connect to Claude Desktop, Cursor, or any MCP-compatible client
  • YAML pipeline engine -- orchestrate multi-step workflows with expressions, forEach, parallel, and retries
  • Micro-kernel plugin architecture -- each service is a standalone, independently installable package
  • ESM-only, TypeScript strict mode -- modern, tree-shakeable modules
  • Node.js >= 22 -- leverages native fetch, crypto, and other built-in APIs
  • 2,356 tests, 100% statement coverage -- across all 19 packages

Quick Start

Install

# Install individual packages as needed
npm install @openworkspace/core @openworkspace/gmail

# Or install the CLI globally
npm install -g @openworkspace/cli

Programmatic API

import { createHttpClient } from '@openworkspace/core';
import { searchMessages } from '@openworkspace/gmail';

const http = createHttpClient({
  baseUrl: 'https://www.googleapis.com',
  auth: { accessToken: 'your-token' },
});

const result = await searchMessages(http, { query: 'from:boss' });

if (result.ok) {
  console.log(result.value.messages);
} else {
  console.error(result.error.message);
}

CLI

# Authenticate
ows auth add ersin@example.com

# Gmail
ows gmail search "from:boss"
ows gmail send --to alice@example.com --subject "Hello"

# Calendar
ows calendar events --today
ows calendar create "Team Standup" --date 2026-03-15 --time 09:00

# Drive
ows drive search "quarterly report"
ows drive upload ./report.pdf

# Start MCP server
ows mcp serve --stdio

MCP Server (Claude Desktop)

Add to your Claude Desktop configuration:

// ~/.config/claude/claude_desktop_config.json
{
  "mcpServers": {
    "openworkspace": {
      "command": "npx",
      "args": ["@openworkspace/mcp", "serve", "--stdio"]
    }
  }
}

Once configured, Claude can search your email, create calendar events, upload files to Drive, and more -- all through natural language.

Pipeline

Define multi-step workflows in YAML:

name: Daily Backup
steps:
  - id: search
    action: gmail.search
    with:
      query: "has:attachment newer_than:1d"

  - id: upload
    action: drive.upload
    forEach: ${{ steps.search.result }}
    with:
      folderId: "backup-folder-id"

Pipelines support ${{ expr }} expressions, forEach iteration, parallel execution, and automatic retries.


Packages

PackageDescription
@openworkspace/coreKernel, Result type, errors, events, logger, HTTP client, auth (OAuth2, service accounts), config
@openworkspace/cliZero-dep CLI parser with 19 command groups, output formatters, shell completions
@openworkspace/mcpMCP server -- JSON-RPC 2.0, 28 tools, stdio + HTTP/SSE transports
@openworkspace/pipelineYAML workflow engine -- expression evaluator, forEach, parallel, retries
@openworkspace/gmailGmail -- search, read, send, labels, threads, drafts
@openworkspace/calendarCalendar -- events, create, free/busy, calendar list
@openworkspace/driveDrive -- search, upload, download, folders, permissions
@openworkspace/sheetsSheets -- read, write, append, format, structure
@openworkspace/docsDocs -- get, create, batch update, export
@openworkspace/slidesSlides -- presentations, slide ops, speaker notes, export
@openworkspace/contactsContacts -- search, list, create, directory
@openworkspace/tasksTasks -- task lists, tasks CRUD
@openworkspace/chatChat -- spaces, messages, direct messages
@openworkspace/classroomClassroom -- courses, coursework, roster, submissions
@openworkspace/formsForms -- get, create, responses
@openworkspace/appscriptApps Script -- run scripts, manage projects
@openworkspace/peoplePeople -- profiles, manager/reports relations
@openworkspace/groupsGroups -- list, members, settings
@openworkspace/keepKeep -- notes, attachments

Architecture

                        +-------------------+
                        |   @openworkspace  |
                        |      /core        |
                        |  (micro-kernel)   |
                        +--------+----------+
                                 |
            +--------------------+--------------------+
            |                    |                    |
   +--------v--------+  +-------v--------+  +--------v--------+
   |   @openworkspace |  | @openworkspace |  | @openworkspace  |
   |      /cli        |  |     /mcp       |  |   /pipeline     |
   |  (19 commands)   |  | (28 tools)     |  | (YAML engine)   |
   +--------+---------+  +-------+--------+  +--------+--------+
            |                     |                    |
            +--------------------+--------------------+
            |         Service Plugins (15)             |
            +------------------------------------------+
            | gmail | calendar | drive | sheets | docs |
            | slides | contacts | tasks | chat | ...  |
            +------------------------------------------+

Core Concepts

Result Pattern -- All functions return Result<T, E> instead of throwing:

type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };

Plugin Architecture -- Each service registers as a plugin with the kernel. Install only what you need.

HttpClient -- Authenticated HTTP with request/response/error interceptors, built on native fetch.

MCP Tools

The MCP server exposes 28 tools to AI assistants:

ToolDescription
gmail_searchSearch messages by query
gmail_readRead a specific message
gmail_sendSend an email
gmail_labelsList Gmail labels
calendar_eventsList calendar events
calendar_createCreate a calendar event
calendar_freebusyCheck free/busy status
drive_searchSearch files in Drive
drive_readRead file content or metadata
drive_uploadUpload a file to Drive
sheets_readRead spreadsheet data
sheets_writeWrite spreadsheet data
tasks_listList task lists and tasks
tasks_createCreate a new task
tasks_completeMark a task as complete
contacts_searchSearch contacts
docs_getGet document content
docs_createCreate a new document
slides_getGet presentation content
slides_createCreate a new presentation
classroom_coursesList courses
forms_getGet form and responses
chat_sendSend a chat message
keep_listList notes
appscript_runRun an Apps Script function
people_meGet current user profile
groups_listList groups
workspace_searchSearch across all services

Development

Prerequisites

  • Node.js >= 22
  • pnpm >= 10

Setup

git clone https://github.com/ersinkoc/openworkspace.git
cd openworkspace
pnpm install

Build

pnpm build          # Build all packages (topological order via Turbo)

Testing

pnpm test           # Run all 2,356 tests
pnpm test:coverage  # Run tests with coverage (100% statement coverage)
pnpm typecheck      # TypeScript strict mode check

Manual Testing with Real Google Account

pnpm quickstart     # Interactive setup wizard for Google OAuth
pnpm smoke-test     # Run CLI commands against a real Google account
pnpm test:mcp       # Test MCP server via stdio JSON-RPC
pnpm test:e2e       # Full E2E test across all 15 services

See scripts/README.md for prerequisites and detailed setup instructions.

Project Structure

openworkspace/
  packages/
    core/          # Kernel, Result, errors, events, logger, HTTP, auth, config
    cli/           # CLI parser and command handlers
    mcp/           # MCP server, JSON-RPC 2.0, tool registry, transports
    pipeline/      # YAML workflow engine, expression evaluator
    gmail/         # Gmail service plugin
    calendar/      # Calendar service plugin
    drive/         # Drive service plugin
    sheets/        # Sheets service plugin
    docs/          # Docs service plugin
    slides/        # Slides service plugin
    contacts/      # Contacts service plugin
    tasks/         # Tasks service plugin
    chat/          # Chat service plugin
    classroom/     # Classroom service plugin
    forms/         # Forms service plugin
    appscript/     # Apps Script service plugin
    people/        # People service plugin
    groups/        # Groups service plugin
    keep/          # Keep service plugin
  scripts/         # Quickstart, smoke test, MCP test scripts
  docs/            # Architecture, specification, roadmap
  turbo.json
  pnpm-workspace.yaml
  tsconfig.json

Authentication

OpenWorkspace supports two authentication methods:

OAuth 2.0 (User Accounts)

# Browser flow (default -- opens browser for consent)
ows auth add ersin@example.com

# Headless flow (for servers -- paste the authorization code)
ows auth add ersin@example.com --headless

# Device code flow (for constrained devices)
ows auth add ersin@example.com --device

# Limit scopes to specific services
ows auth add ersin@example.com --scopes gmail,calendar,drive

Tokens are encrypted and stored locally. Auto-refresh is handled transparently.

Service Accounts

import { createServiceAccountAuth, loadServiceAccountKey } from '@openworkspace/core';

const key = await loadServiceAccountKey('./service-account.json');
const auth = createServiceAccountAuth(key);

Documentation


Links

License

MIT -- Ersin Koc

Reviews

No reviews yet

Sign in to write a review