Wave-notes-MCP

wavedigital-ai/Wave-notes-MCP

3.2

If you are the rightful owner of Wave-notes-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

AutoRAG Notes MCP Server is a sophisticated note-taking platform that leverages AI for enhanced search and image generation, with secure Google OAuth authentication.

Tools
  1. createNote

    Create a new note with title and content.

  2. searchNotes

    Search through all your notes.

  3. searchNotesByDate

    Find notes within a date range.

  4. sync_autorag

    Manually trigger AutoRAG sync to scan for changes.

  5. debugStorage

    View R2 storage information.

AutoRAG Notes MCP Server

A Model Context Protocol (MCP) server that provides intelligent note-taking capabilities with AI-powered search, image generation, and Google OAuth authentication. Built on Cloudflare Workers with R2 storage.

πŸš€ Features

  • πŸ“ Smart Note Management: Create, search, and organize notes with metadata
  • πŸ” AI-Powered Search: Semantic search across your notes using vector embeddings
  • 🎨 Image Generation: Generate images using Cloudflare's AI models (Flux-1-Schnell)
  • πŸ”’ Google OAuth: Secure authentication with Google Workspace domain restriction
  • ☁️ Cloud Storage: Notes stored in Cloudflare R2 with automatic organization
  • πŸ”„ Real-time Sync: Server-sent events for live updates

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude AI     │───▢│  AutoRAG Notes   │───▢│  Cloudflare R2  β”‚
β”‚                 β”‚    β”‚   MCP Server     β”‚    β”‚   (Storage)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚  Google OAuth    β”‚
                       β”‚  Authentication  β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Prerequisites

  • Cloudflare Account with Workers and R2 enabled
  • Google Cloud Console project with OAuth 2.0 credentials
  • Claude AI account for MCP integration
  • Node.js 18+ and npm for local development

βš™οΈ Setup Instructions

1. Clone and Install Dependencies

git clone <your-repo-url>
cd autorag-notes-mcp
npm install

2. Configure Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable the Google+ API and OAuth 2.0
  4. Create OAuth 2.0 Client ID credentials:
    • Application type: Web application
    • Authorized redirect URIs:
      • https://your-worker-domain.workers.dev/callback
      • https://your-custom-domain.com/callback (if using custom domain)
  5. Note your Client ID and Client Secret

3. Set Environment Variables

Configure the following secrets in Cloudflare Workers:

# Google OAuth Configuration
wrangler secret put GOOGLE_CLIENT_ID
# Enter your Google OAuth Client ID

wrangler secret put GOOGLE_CLIENT_SECRET
# Enter your Google OAuth Client Secret

wrangler secret put GOOGLE_HOSTED_DOMAIN
# Enter your domain (e.g., wavedigital.ai) to restrict access

# Cookie Encryption
wrangler secret put COOKIE_ENCRYPTION_KEY
# Enter a strong random key for cookie encryption

# AutoRAG Sync (Optional)
wrangler secret put CLOUDFLARE_ACCOUNT_ID
# Enter your Cloudflare Account ID for sync functionality

wrangler secret put CLOUDFLARE_API_TOKEN
# Enter API token with 'AutoRAG Write' permission

wrangler secret put AUTORAG_ID
# Enter your AutoRAG instance ID

4. Configure Cloudflare Resources

Update wrangler.toml with your Cloudflare account details:

[[kv_namespaces]]
binding = "OAUTH_KV"
id = "your-kv-namespace-id"

[[r2_buckets]]
binding = "NOTES"
bucket_name = "your-r2-bucket-name"

[ai]
binding = "AI"

5. Deploy to Cloudflare Workers

npm run deploy

6. Configure Custom Domain (Optional)

  1. In Cloudflare Dashboard: Workers & Pages β†’ autorag-notes-mcp
  2. Go to Settings β†’ Triggers β†’ Custom Domains
  3. Add your custom domain (e.g., notes.yourdomain.com)
  4. Update Google OAuth redirect URIs to include your custom domain

πŸ”§ Required Environment Variables

VariableDescriptionExample
GOOGLE_CLIENT_IDGoogle OAuth 2.0 Client ID123456789-abc.apps.googleusercontent.com
GOOGLE_CLIENT_SECRETGoogle OAuth 2.0 Client SecretGOCSPX-abcdefghijklmnopqrstuv
GOOGLE_HOSTED_DOMAINRestrict access to specific domainwavedigital.ai
COOKIE_ENCRYPTION_KEYKey for encrypting OAuth cookiesyour-random-256-bit-key
CLOUDFLARE_ACCOUNT_IDYour Cloudflare Account ID (optional)a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
CLOUDFLARE_API_TOKENAPI token with 'AutoRAG Write' permission (optional)your-api-token-here
AUTORAG_IDYour AutoRAG instance ID (optional)your-autorag-instance-id

πŸ“± Usage

Connect to Claude

  1. Open Claude AI
  2. Go to Settings β†’ Feature Preview β†’ Model Context Protocol
  3. Add new MCP server:
    • Name: AutoRAG Notes
    • URL: https://your-domain.com/sse
  4. Authenticate with your Google account

Available Tools

πŸ“ Note Management
  • createNote: Create a new note with title and content
  • searchNotes: Search through all your notes
  • searchNotesByDate: Find notes within a date range
πŸ”„ AutoRAG Sync
  • sync_autorag: Manually trigger AutoRAG sync to scan for changes and index new/updated files
πŸ› Debug Tools
  • debugStorage: View R2 storage information
  • debugProps: View your authentication properties

Example Commands

# Create a note
"Create a note about my meeting with the product team"

# Search notes
"Search my notes for anything about 'product roadmap'"

# Trigger AutoRAG sync after adding new notes
"Sync AutoRAG to index my latest notes"

# Search by date
"Find all notes I created last week"

πŸ“ File Structure

autorag-notes-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts              # Main MCP server class
β”‚   β”œβ”€β”€ google-handler.ts     # Google OAuth handler
β”‚   β”œβ”€β”€ utils.ts              # OAuth utilities
β”‚   β”œβ”€β”€ types.ts              # TypeScript types
β”‚   β”œβ”€β”€ workers-oauth-utils.ts # OAuth UI utilities
β”‚   └── tools/
β”‚       β”œβ”€β”€ note-tools.ts     # Note management tools
β”‚       β”œβ”€β”€ search-tools.ts   # Search functionality
β”‚       β”œβ”€β”€ image-tools.ts    # AI image generation
β”‚       └── debug-tools.ts    # Debug utilities
β”œβ”€β”€ wrangler.toml             # Cloudflare Workers config
β”œβ”€β”€ worker-configuration.d.ts # Environment types
└── package.json              # Dependencies

πŸ”’ Security Features

  • Domain Restriction: Only users from specified Google Workspace domain can access
  • OAuth 2.0: Secure authentication flow with Google
  • Cookie Encryption: Signed cookies for session management
  • User Isolation: Each user's notes are stored in separate R2 folders
  • HTTPS Only: All communications encrypted in transit

πŸ§ͺ Local Development

# Install dependencies
npm install

# Start local development server
npm run dev

# Deploy to Cloudflare
npm run deploy

# View logs
wrangler tail

πŸ“Š Storage Structure

Notes are organized in R2 storage by user email:

R2 Bucket/
β”œβ”€β”€ user1@yourdomain.com/
β”‚   β”œβ”€β”€ note-uuid-1.md
β”‚   β”œβ”€β”€ note-uuid-2.md
β”‚   └── .metadata/
β”‚       β”œβ”€β”€ note-uuid-1.json
β”‚       └── note-uuid-2.json
└── user2@yourdomain.com/
    β”œβ”€β”€ note-uuid-3.md
    └── .metadata/
        └── note-uuid-3.json

πŸ”§ Troubleshooting

Common Issues

  1. OAuth Fails: Check redirect URIs match exactly in Google Console
  2. Permission Denied: Verify GOOGLE_HOSTED_DOMAIN is set correctly
  3. Notes Not Saving: Check R2 bucket permissions and binding
  4. Custom Domain Issues: Ensure DNS is properly configured

Debug Commands

# View deployment logs
wrangler tail

# Check environment variables
wrangler secret list

# Test OAuth endpoints
curl https://your-domain.com/authorize?client_id=test

πŸ“ License

This project is licensed under the MIT License.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ž Support

For issues and questions:

  • Create an issue in this repository
  • Check Cloudflare Workers documentation
  • Review Google OAuth 2.0 documentation