11# OAuth Quick Start Guide
22
3- This guide shows how to quickly test OAuth authentication with Basic Memory MCP server.
3+ This guide shows how to test OAuth authentication with Basic Memory MCP server, including how to connect from Claude.ai .
44
55## Local Testing with Built-in Provider
66
@@ -135,6 +135,38 @@ async def test_oauth():
135135asyncio.run(test_oauth())
136136```
137137
138+ ## Connecting from Claude.ai
139+
140+ To connect your Basic Memory MCP server to Claude.ai:
141+
142+ 1 . ** Deploy your MCP server** with OAuth enabled:
143+ ``` bash
144+ # Must use streamable-http transport
145+ FASTMCP_AUTH_ENABLED=true basic-memory mcp --transport streamable-http --host 0.0.0.0
146+ ```
147+
148+ 2 . ** Make server accessible** (for testing):
149+ - Use a tunneling service like ngrok: ` ngrok http 8000 `
150+ - Or deploy to a cloud provider
151+ - Note the public URL (e.g., ` https://xyz.ngrok.io ` )
152+
153+ 3 . ** In Claude.ai** :
154+ - Go to ** Settings** → ** Integrations**
155+ - Click ** Add More**
156+ - Enter your MCP server URL: ` https://your-server.com/mcp `
157+ - Click ** Connect**
158+
159+ 4 . ** OAuth Flow** :
160+ - Claude will redirect you to your MCP server's authorization page
161+ - Login/authorize (depends on your provider)
162+ - You'll be redirected back to Claude
163+ - Claude now has access to your MCP server!
164+
165+ 5 . ** Use in conversation** :
166+ - Click the tools icon (second from bottom left)
167+ - Select your Basic Memory server
168+ - Use commands like "write a note" or "search my notes"
169+
138170## Provider Options
139171
140172- ** basic** : Built-in provider (development only)
@@ -152,4 +184,62 @@ asyncio.run(test_oauth())
152184
153185- [ OAuth Authentication Guide] ( docs/OAuth%20Authentication.md )
154186- [ Supabase OAuth Setup] ( docs/Supabase%20OAuth%20Setup.md )
155- - [ MCP Authorization Spec] ( https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization )
187+ - [ MCP Authorization Spec] ( https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization )
188+
189+
190+ ## CLAUDE OAUTH
191+
192+ ⏺ Summary
193+
194+ Yes! Basic Memory now supports OAuth authentication that works with Claude.ai, just like claude-code. Here's what I've implemented:
195+
196+ 1 . OAuth Flow for Claude.ai
197+
198+ - Claude initiates the OAuth flow when connecting to your MCP server
199+ - The server handles authorization, token exchange, and validation
200+ - Full compliance with MCP OAuth 2.1 specification
201+
202+ 2 . Key Components Added
203+
204+ - OAuth authorization endpoints (/auth/authorize, /auth/token)
205+ - OAuth metadata discovery (/.well-known/oauth-authorization-server)
206+ - Support for PKCE (required by Claude)
207+ - Token refresh and revocation
208+
209+ 3 . How to Connect from Claude.ai
210+
211+ For testing locally:
212+ # 1. Enable OAuth
213+ export FASTMCP_AUTH_ENABLED=true
214+
215+ # 2. Start server
216+ basic-memory mcp --transport streamable-http --host 0.0.0.0
217+
218+ # 3. Make it accessible (use ngrok for testing)
219+ ngrok http 8000
220+
221+ # 4. In Claude.ai:
222+ # Settings → Integrations → Add More
223+ # Enter: https://your-ngrok-url.ngrok.io/mcp
224+ # Click Connect → Authorize
225+
226+ 4 . Production Setup
227+
228+ - Use Supabase provider for production
229+ - Deploy to HTTPS (required for OAuth)
230+ - Claude.ai Enterprise can add for entire organization
231+
232+ 5 . Security Features
233+
234+ - Scoped access (read, write, admin)
235+ - Short-lived tokens
236+ - Secure token storage
237+ - HTTPS required
238+
239+ The implementation follows the same pattern as claude-code, where:
240+ 1 . User adds the MCP server URL in Claude settings
241+ 2 . Claude redirects to your authorization endpoint
242+ 3 . User logs in and authorizes
243+ 4 . Claude receives tokens and can access your MCP tools
244+
245+ This enables persistent memory and knowledge management directly within Claude.ai conversations!
0 commit comments