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 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.
createNote
Create a new note with title and content.
searchNotes
Search through all your notes.
searchNotesByDate
Find notes within a date range.
sync_autorag
Manually trigger AutoRAG sync to scan for changes.
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
- 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/callback
https://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_DOMAIN
is 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