Readwise Library
STDIOMCP server for accessing and interacting with your Readwise library.
MCP server for accessing and interacting with your Readwise library.
A Model Context Protocol (MCP) server for accessing and interacting with your Readwise library.
This repository is organized into the following key directories:
smart-mcp-test.sh
: Main testing script for both stdio and SSE transportsrun-simple-server.sh
: Script to run a simple MCP servertest-scripts/README.md
for complete documentationexamples/mcp-implementations/
: Basic MCP server implementationsexamples/test-clients/
: Client-side test scriptsexamples/README.md
for complete documentation# Install from npm npm install -g readwise-mcp # Or clone the repository and install dependencies git clone https://github.com/your-username/readwise-mcp.git cd readwise-mcp npm install npm run build
Before using the server, you need to configure your Readwise API key:
# Run the setup wizard npm run setup # Or start with the API key directly readwise-mcp --api-key YOUR_API_KEY
You can get your API key from https://readwise.io/access_token.
# Start with stdio transport (default, for Claude Desktop) readwise-mcp # Start with SSE transport (for web-based integrations) readwise-mcp --transport sse --port 3000 # Enable debug logging readwise-mcp --debug
import { ReadwiseMCPServer } from 'readwise-mcp'; const server = new ReadwiseMCPServer( 'YOUR_API_KEY', 3000, // port logger, 'sse' // transport ); await server.start();
The project includes built-in support for testing with the MCP Inspector. You can use either the TypeScript script or the shell script to run the inspector.
Run the automated test suite that verifies all tools and prompts:
# Run automated inspector tests npm run test-inspector # Run in CI mode (exits with status code) npm run test-inspector:ci
The test suite verifies:
Each test provides detailed output and a summary of passed/failed cases.
# Test with stdio transport (default) ./scripts/inspector.sh # Test with SSE transport ./scripts/inspector.sh -t sse -p 3001 # Enable debug mode ./scripts/inspector.sh -d # Full options ./scripts/inspector.sh --transport sse --port 3001 --debug
# Test with stdio transport (default) npm run inspector # Test with SSE transport npm run inspector -- -t sse -p 3001 # Enable debug mode npm run inspector -- -d # Full options npm run inspector -- --transport sse --port 3001 --debug
-t, --transport <type>
: Transport type (stdio or sse), default: stdio-p, --port <number>
: Port number for SSE transport, default: 3001-d, --debug
: Enable debug modeTest a specific tool:
./scripts/inspector.sh > tool get-highlights --parameters '{"page": 1, "page_size": 10}'
Test a prompt:
./scripts/inspector.sh > prompt search-highlights --parameters '{"query": "python"}'
List available tools and prompts:
./scripts/inspector.sh > list tools > list prompts
If you don't have a Readwise API key or don't want to use your real API key for testing, you can use the mock testing functionality:
npm run test-mock
This runs a test script that:
The mock implementation includes:
readwise_highlight: Process highlights from Readwise
readwise_search: Search and process highlights from Readwise
# Build the project npm run build # Run tests npm test # Start in development mode with auto-reload npm run dev:watch # Lint code npm run lint
MIT