A Python MCP (Model Context Protocol) server that provides seamless integration with the Reflect Notes API. This server enables AI assistants to interact with your Reflect notes, allowing you to create notes, save links, append to daily notes, and manage your knowledge graph programmatically.
- OAuth2 Authentication: Secure authentication flow with automatic token management
- Note Management: Create new notes with Markdown content
- Daily Notes: Append text to daily notes with optional list targeting
- Link Saving: Save web links with titles, descriptions, and highlights
- Graph Operations: List and manage multiple knowledge graphs
- User Management: Get current user information and default graph settings
No need to clone the repository! Simply configure and run:
{
"mcpServers": {
"reflect": {
"command": "uvx",
"args": ["reflect-mcp"],
"env": {
"REFLECT_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}To get your access token:
- Go to Reflect Developer OAuth
- Create credentials if you haven't already
- Generate an access token
- Copy the token and add it to the configuration above
pip install reflect-mcpOr with uv:
uv pip install reflect-mcpThe simplest way to use the server is with a direct access token:
REFLECT_ACCESS_TOKEN=your_access_token_here
REFLECT_DEFAULT_GRAPH_ID=your_default_graph_id # OptionalTo get your access token:
- Go to Reflect Developer OAuth
- Create credentials if you haven't already
- Generate an access token
- Copy the token and add it to your configuration
If you prefer OAuth2 authentication:
REFLECT_CLIENT_ID=your_oauth_client_id
REFLECT_CLIENT_SECRET=your_oauth_client_secret
REFLECT_REDIRECT_URI=http://localhost:8080/callback # Optional
REFLECT_DEFAULT_GRAPH_ID=your_default_graph_id # OptionalAdd the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Using the published package with access token:
{
"mcpServers": {
"reflect": {
"command": "uvx",
"args": ["reflect-mcp"],
"env": {
"REFLECT_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}If running from source:
{
"mcpServers": {
"reflect": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/reflect-mcp",
"run",
"reflect_server.py"
],
"env": {
"REFLECT_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}Alternative OAuth2 configuration (if not using access token):
{
"mcpServers": {
"reflect": {
"command": "uvx",
"args": ["reflect-mcp"],
"env": {
"REFLECT_CLIENT_ID": "your_client_id",
"REFLECT_CLIENT_SECRET": "your_client_secret"
}
}
}
}authenticate- Start OAuth2 authentication flow (opens browser)set_access_token- Complete OAuth2 flow with authorization codeset_token_directly- Set access token manually (useful if you already have one)
list_graphs- Get all accessible graphs with IDs, names, and timestampsget_default_graph- Get the default graph ID from configuration or user profile
create_note- Create a new note with title and Markdown contentappend_daily_note- Append text to daily note (today or specific date)list_books- Get all books in a graphlist_links- Get all links in a graphcreate_link- Save a web link with optional metadata
get_current_user- Get information about the authenticated user
If you've configured the server with REFLECT_ACCESS_TOKEN, you're already authenticated and can start using all tools immediately.
If you're using OAuth2 credentials instead of a direct access token:
-
Start the authentication process:
authenticateThis opens your browser to the Reflect OAuth page.
-
After authorizing, you'll be redirected to a URL containing an authorization code.
-
Complete authentication by providing the code:
set_access_token code="your_authorization_code" -
The server will handle token exchange and refresh automatically.
create_note(
subject="Meeting Notes",
content="## Project Review\n\n- Discussed timeline\n- Set Q2 goals",
pinned=false
)# Append to today's daily note
append_daily_note(
text="Remember to review the project proposal"
)
# Append to a specific list in yesterday's note
append_daily_note(
text="Completed user authentication feature",
date="2024-01-18",
list_name="Done"
)create_link(
url="https://example.com/article",
title="Interesting Article",
description="Key insights about productivity",
highlights=["Important quote from the article", "Another highlight"]
)# Get all accessible graphs
list_graphs()
# Get the default graph ID
get_default_graph()
# List all links in a specific graph
list_links(graph_id="your_graph_id")The server provides these MCP resources for checking status:
- get_auth_status (
reflect://auth/status): Check current authentication status - get_config (
reflect://config): View current configuration (excluding secrets)
Built-in workflow prompts for common tasks:
- create_reading_list: Template for creating organized reading lists in Reflect
- daily_journal_workflow: Structured template for daily journaling
# Clone the repository
git clone https://github.com/yourusername/reflect-mcp
cd reflect-mcp
# Install dependencies
uv sync
# Run in development mode
uv run mcp dev reflect_mcp/server.py# Run with MCP inspector for testing
uv run mcp inspector reflect_mcp/server.py# Build the package
uv build
# Publish to PyPI (requires credentials)
uv publishThe server implements the Reflect API v0.1.0 with the following endpoints:
GET /graphs- List all graphsGET /graphs/{id}/books- List books in a graphGET /graphs/{id}/links- List links in a graphPOST /graphs/{id}/links- Create a new linkPOST /graphs/{id}/notes- Create a new notePUT /graphs/{id}/daily-notes- Append to daily noteGET /users/me- Get current user info
The Reflect API uses OAuth2 with the following flows:
- Authorization URL:
https://reflect.app/oauth - Token URL:
https://reflect.app/api/oauth/token - Scopes:
read:graph- Read access to protected resourceswrite:graph- Write access to protected resources
- Missing credentials: Ensure
REFLECT_CLIENT_IDandREFLECT_CLIENT_SECRETare set - Invalid redirect: Check that your OAuth app's redirect URI matches the server's expected callback
- Token refresh: The server automatically handles token refresh using the
authliblibrary
- Verify your internet connection
- Check if the Reflect API is accessible at
https://api.reflect.app - Review server logs for detailed error messages
- Ensure your OAuth app has the necessary scopes enabled
-
"Server disconnected" error in Claude: Usually means the server couldn't start. Check:
- OAuth credentials are correctly set
- No syntax errors in configuration
- The
reflect_server.pyfile exists (if running from source)
-
"Not authenticated" errors: Run the
authenticatetool first to set up OAuth -
Graph ID errors: Use
list_graphsto find valid graph IDs, or setREFLECT_DEFAULT_GRAPH_ID
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
For issues and feature requests, please use the GitHub issue tracker.