Skip to main content
Glama

Readwise MCP Server

by IAmAlexander
run-fixed-readwise-server.ts2.41 kB
// Test script for the fixed Readwise MCP Server implementation import { FixedReadwiseMCPServer } from './fixed-readwise-server'; import { SafeLogger } from './src/utils/safe-logger.js'; import { LogLevel } from './src/utils/logger-interface.js'; import { getConfig } from './src/utils/config.js'; // Global error handling process.on('unhandledRejection', (error: unknown) => { console.error("UNHANDLED REJECTION:"); if (error instanceof Error) { console.error("Error message:", error.message); console.error("Error stack:", error.stack); } else { console.error("Non-Error object thrown:", error); try { console.error("Stringified error:", JSON.stringify(error, null, 2)); } catch (e) { console.error("Error could not be stringified"); } } process.exit(1); }); async function main() { // Initialize logger const logger = new SafeLogger({ level: LogLevel.DEBUG, transport: console.error, timestamps: true, colors: true }); logger.info("Starting Fixed Readwise MCP Server test"); try { // Load configuration logger.info("Loading configuration..."); const config = getConfig(); // Check for required API key if (!config.readwiseApiKey) { logger.error("Missing Readwise API key in configuration"); process.exit(1); } // Create and start the server logger.info("Creating server..."); const server = new FixedReadwiseMCPServer( config.readwiseApiKey, config.port || 3000, logger, config.transport || 'stdio', config.readwiseApiBaseUrl ); // Start the server logger.info("Starting server..."); await server.start(); logger.info("Server started successfully"); // Handle process termination process.on('SIGINT', async () => { logger.info("Shutting down server..."); await server.stop(); logger.info("Server stopped"); process.exit(0); }); // Keep the process running logger.info("Server is running. Press Ctrl+C to stop"); } catch (error) { logger.error("Error in main", error instanceof Error ? error : new Error(String(error))); process.exit(1); } } // Start the application main().catch(error => { console.error("FATAL ERROR:", error); if (error instanceof Error && error.stack) { console.error("STACK:", error.stack); } process.exit(1); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IAmAlexander/readwise-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server