Skip to content

junkyard22/goose-google-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Goose Google Connector

A Goose extension that integrates with Google Calendar using OAuth2 device flow authentication.

Works with Goose Desktop (STDIO) and Goose CLI (HTTP).

Features

  • βœ… Google Calendar - List and create events
  • πŸ” Device Flow Auth - Simple browser-based authentication
  • πŸ’Ύ Token Persistence - Auto-refresh, stays logged in
  • πŸ–₯️ Windows Compatible - Tested on Windows with Goose Desktop

Current Limitations

Due to Google's device flow OAuth restrictions, only Calendar scope works. Gmail and Tasks scopes return invalid_scope errors with device flow authentication. A future update may add localhost redirect flow to support these APIs.

Quick Start

1. Clone and Install

git clone https://github.com/YOUR_USERNAME/goose-google-connector.git
cd goose-google-connector
npm install

2. Set Up Google Cloud OAuth

  1. Go to Google Cloud Console
  2. Create a new project (or select existing)
  3. Enable the Google Calendar API:
    • Go to APIs & Services β†’ Library
    • Search for "Google Calendar API" and click Enable
  4. Configure OAuth consent screen:
    • Go to APIs & Services β†’ OAuth consent screen
    • Choose External, fill in app name and email
    • Add your email as a test user
  5. Create OAuth credentials:
    • Go to APIs & Services β†’ Credentials
    • Click Create Credentials β†’ OAuth client ID
    • Application type: TVs and Limited Input devices
    • Name: "Goose Google Connector"
  6. Copy the Client ID and Client Secret

3. Configure Credentials

Edit googleAuth.js and replace the placeholders:

const OAUTH_CONFIG = {
  clientId: "YOUR_CLIENT_ID.apps.googleusercontent.com",
  clientSecret: "YOUR_CLIENT_SECRET",
  // ...
};

Or use environment variables:

# Windows
set GOOGLE_CLIENT_ID=your_client_id
set GOOGLE_CLIENT_SECRET=your_client_secret

# Linux/Mac
export GOOGLE_CLIENT_ID=your_client_id
export GOOGLE_CLIENT_SECRET=your_client_secret

4. Add to Goose Desktop

  1. Open Goose Desktop β†’ Settings β†’ Extensions
  2. Click Add custom extension
  3. Configure:
    • Name: Google Connector
    • Type: Standard IO (STDIO)
    • Command: C:\Program Files\nodejs\node.exe (or your Node.js path)
    • Arguments: C:\path\to\goose-google-connector\stdio-server.js
  4. Save and enable the extension

5. Authenticate

In Goose, say:

"Check my Google auth status"

Follow the instructions to complete authentication in your browser.

Available Commands

Command Description
google_auth_status Check authentication or start login flow
google_logout Clear saved credentials
google_list_events List upcoming calendar events (next 7 days)
google_create_event Create a new calendar event

Example Usage

"Show my upcoming calendar events"
"Create a meeting called Team Standup tomorrow at 9am"
"Add a calendar event called Dentist Appointment on Friday at 2pm for 30 minutes"
"Log out of Google"

File Structure

goose-google-connector/
β”œβ”€β”€ stdio-server.js      # ⭐ Main entry point for Goose Desktop (STDIO)
β”œβ”€β”€ mcp-http-server.js   # HTTP server for Goose CLI or testing
β”œβ”€β”€ googleAuth.js        # OAuth2 device flow authentication
β”œβ”€β”€ package.json         # Dependencies
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

Development

Testing with HTTP Server

For development/testing without Goose:

node mcp-http-server.js

Then test with curl:

# Health check
curl http://localhost:3847/health

# Initialize
curl -X POST http://localhost:3847/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"1","method":"initialize","params":{}}'

# List tools
curl -X POST http://localhost:3847/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"2","method":"tools/list","params":{}}'

# Check auth
curl -X POST http://localhost:3847/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"3","method":"tools/call","params":{"name":"google_auth_status","arguments":{}}}'

Windows PATH Issues

If you get process quit before initialization: stderr = error in Goose Desktop:

  1. Use absolute paths for both Node.js and the script
  2. Find your Node.js path: where node
  3. The stdio-server.js includes process.chdir() fix for module resolution

Troubleshooting

Error Solution
invalid_client Check Client ID/Secret are correct and from "TVs and Limited Input devices" type
invalid_scope Gmail/Tasks don't work with device flow - only Calendar is supported
process quit before initialization Use absolute paths in Goose Desktop config
Token refresh fails Run google_logout then google_auth_status

Technical Notes

Why Device Flow?

Device flow is ideal for CLI/desktop apps because:

  • No need to run a local web server
  • Works on headless systems
  • Simple user experience (just enter a code)

Why Not Gmail/Tasks?

Google restricts which OAuth scopes work with device flow. Calendar works, but Gmail (gmail.readonly) and Tasks (tasks) return invalid_scope. Supporting these would require switching to localhost redirect flow.

MCP Protocol

This extension implements the Model Context Protocol (MCP) for communication with Goose. It supports both:

  • STDIO - For Goose Desktop (spawns as subprocess)
  • HTTP - For Goose CLI or direct testing

Contributing

Contributions welcome! Some ideas:

  • Add localhost redirect flow for Gmail/Tasks support
  • Add more Calendar features (update, delete events)
  • Add Google Drive integration
  • Improve natural language date parsing

License

MIT License - see LICENSE

Credits

About

MCP extension for Google Calendar integration with Goose Desktop.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors