Readwise MCP Server

January 17, 2025 ยท View on GitHub

A Model Context Protocol (MCP) server that provides tools for interacting with the Readwise Reader API.

Installation

Install dependencies:

npm install

Build the server:

npm run build

Configuration

The server requires the following environment variables:

  • READWISE_API_TOKEN: Your Readwise API access token. You can find this in your Readwise settings.

Available Tools

list_documents

Lists documents from Readwise Reader.

Parameters:

  • updateAfter (optional): Fetch only documents updated after this date (ISO 8601 format)
  • location (optional): The document's location (one of: new, later, shortlist, archive, feed)
  • category (optional): The document's category (one of: article, email, rss, highlight, tweet)
  • pageCursor (optional): String returned by a previous request for pagination if there are too many documents for one request
  • withHtmlContent (optional): Include the html_content field in each document's data (true/false). Note: enabling this may increase request processing time

Response format:

{
  "content": [
    {
      "type": "text",
      "text": "..." // JSON string containing the documents data
    }
  ]
}

get_document

Get a specific document by ID.

Parameters:

  • id (required): The document's unique ID

Response format:

{
  "content": [
    {
      "type": "text",
      "text": "..." // JSON string containing the document data
    }
  ]
}

Error handling:

  • Invalid parameters will return an InvalidParams error
  • API errors will return an InternalError with the Readwise API error message
  • Unknown tools will return a MethodNotFound error

Integration with Claude

To use this MCP server with Claude Desktop, add the server configuration:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "readwise": {
      "command": "node",
      "args": ["/path/to/readwise-server/build/index.js"],
      "env": {
        "READWISE_API_TOKEN": "your-api-token"
      }
    }
  }
}

Development

For development with auto-rebuild:

npm run watch

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.