wavedigital-ai/Wave-notes-MCP
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 dayong@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.
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
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the Google+ API and OAuth 2.0
- Create OAuth 2.0 Client ID credentials:
- Application type: Web application
- Authorized redirect URIs:
https://your-worker-domain.workers.dev/callbackhttps://your-custom-domain.com/callback(if using custom domain)
- 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)
- In Cloudflare Dashboard: Workers & Pages → autorag-notes-mcp
- Go to Settings → Triggers → Custom Domains
- Add your custom domain (e.g.,
notes.yourdomain.com) - Update Google OAuth redirect URIs to include your custom domain
🔧 Required Environment Variables
| Variable | Description | Example |
|---|---|---|
GOOGLE_CLIENT_ID | Google OAuth 2.0 Client ID | 123456789-abc.apps.googleusercontent.com |
GOOGLE_CLIENT_SECRET | Google OAuth 2.0 Client Secret | GOCSPX-abcdefghijklmnopqrstuv |
GOOGLE_HOSTED_DOMAIN | Restrict access to specific domain | wavedigital.ai |
COOKIE_ENCRYPTION_KEY | Key for encrypting OAuth cookies | your-random-256-bit-key |
CLOUDFLARE_ACCOUNT_ID | Your Cloudflare Account ID (optional) | a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 |
CLOUDFLARE_API_TOKEN | API token with 'AutoRAG Write' permission (optional) | your-api-token-here |
AUTORAG_ID | Your AutoRAG instance ID (optional) | your-autorag-instance-id |
📱 Usage
Connect to Claude
- Open Claude AI
- Go to Settings → Feature Preview → Model Context Protocol
- Add new MCP server:
- Name: AutoRAG Notes
- URL:
https://your-domain.com/sse
- Authenticate with your Google account
Available Tools
📝 Note Management
createNote: Create a new note with title and contentsearchNotes: Search through all your notessearchNotesByDate: 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 informationdebugProps: 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
- OAuth Fails: Check redirect URIs match exactly in Google Console
- Permission Denied: Verify
GOOGLE_HOSTED_DOMAINis set correctly - Notes Not Saving: Check R2 bucket permissions and binding
- 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
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- 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