Skip to main content
Glama
pulkit-guglani

keep-mcp

README.md
# Google Keep MCP Server

An MCP (Model Context Protocol) server that provides tools for interacting with Google Keep notes.

## Features

- **Create Notes**: Create new notes in Google Keep with title and content
- **Search Notes**: Search for existing notes using queries
- **Get Notes by Time**: Retrieve notes from a specific time period (e.g., last 7 days, last year)

## Prerequisites

1. Node.js 18+ installed
2. Google Cloud Project with Keep API enabled
3. OAuth2 credentials from Google Cloud Console

## Setup Instructions

### 1. Google Cloud Setup

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select an existing one
3. Enable the Google Keep API:

   - Go to "APIs & Services" > "Library"
   - Search for "Google Keep API"
   - Click on it and click "Enable"

4. Create OAuth2 credentials:
   - Go to "APIs & Services" > "Credentials"
   - Click "Create Credentials" > "OAuth client ID"
   - Choose "Desktop app" as Application type
   - Give it a name (e.g., "Google Keep MCP")
   - Copy the Client ID and Client Secret
   - Note the redirect URI (usually `http://localhost` for desktop apps)

### 2. Installation

```bash
# Clone the repository
cd google_notes_mcp/mcp

# Install dependencies
npm install

# Build the TypeScript code
npm run build

# Copy the .env.example to .env
cp .env.example .env

# Edit .env and add your Google OAuth2 credentials:
# - GOOGLE_CLIENT_ID
# - GOOGLE_CLIENT_SECRET
# - GOOGLE_REDIRECT_URI (optional, defaults to http://localhost)
```

### 3. First-time Authentication

When you run the server for the first time, it will:

1. Print an authorization URL to the console
2. Open this URL in your browser
3. Sign in with your Google account
4. Grant permissions for Google Keep access
5. Copy the authorization code from the browser
6. Paste it back in the terminal

This will save a `token.json` file for future use.

### 4. MCP Configuration

Add this server to your MCP client configuration (e.g., for Claude Desktop):

#### For Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "google-keep": {
      "command": "node",
      "args": [
        "C:/Users/your-username/Desktop/google_notes_mcp/mcp/dist/index.js"
      ],
      "env": {
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-client-secret",
        "GOOGLE_REDIRECT_URI": "http://localhost"
      }
    }
  }
}
```

Or if you've installed it globally:

```json
{
  "mcpServers": {
    "google-keep": {
      "command": "google-keep-mcp",
      "env": {
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-client-secret",
        "GOOGLE_REDIRECT_URI": "http://localhost"
      }
    }
  }
}
```

## Available Tools

### 1. create_note

Create a new note in Google Keep.

Parameters:

- `title` (optional): Title of the note
- `text` (required): Content of the note

Example:

```json
{
  "title": "Shopping List",
  "text": "Milk\nBread\nEggs\nButter"
}
```

### 2. search_notes

Search for notes in Google Keep.

Parameters:

- `query` (required): Search query to find notes

Example:

```json
{
  "query": "shopping"
}
```

### 3. get_notes_by_time

Get notes from a specific time period.

Parameters:

- `days` (optional): Number of days to look back (default: 7, use 365 for past year)

Example:

```json
{
  "days": 30
}
```

## Development

```bash
# Run in development mode
npm run dev

# Build for production
npm run build

# Run built version
npm start
```

## Troubleshooting

### Authentication Issues

- Make sure your credentials.json file is valid
- Delete token.json and re-authenticate if you're having permission issues
- Ensure the Google Keep API is enabled in your Google Cloud project

### API Limitations

- Google Keep API has rate limits
- Some features may require additional scopes or permissions

## Security Notes

- **Never commit** `.env` or `token.json` to version control
- Keep your OAuth2 credentials (Client ID and Client Secret) secure
- Always use environment variables for sensitive configuration
- The Client Secret should be kept confidential

## License

ISC