@openread/mcp 0.0.1-test.5 → 0.0.1-test.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -227,5 +227,5 @@ ${m||" (No matches found)"}`}).join(`
227
227
  ===
228
228
 
229
229
  `)}`,g=await _s({content:p,systemPrompt:pF,maxTokens:2048});if(g)return{queries:i,booksSearched:l,samplingUsed:!0,comparison:g}}return{queries:i,booksSearched:l,samplingUsed:!1,results:c}}function s_(){ke("compare_across_books","Compare how different books discuss the same topics. Provide 1-5 queries and optionally limit to specific books. With sampling: returns AI-synthesized comparison. Without sampling: returns match counts and top passages per query per book.",gF,bF)}var vF=/^orsk-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Me(r){process.stderr.write(`[openread-mcp] ${r}
230
- `)}function wF(){Me(""),Me("ERROR: OPENREAD_API_KEY environment variable is not set."),Me(""),Me("To get your API key:"),Me(" 1. Open Openread (app.openread.ai)"),Me(" 2. Go to Settings > API Keys"),Me(' 3. Click "Create API Key"'),Me(" 4. Copy the orsk-... key"),Me(""),Me("Then set it in your AI client config:"),Me(" {"),Me(' "mcpServers": {'),Me(' "openread": {'),Me(' "command": "npx",'),Me(' "args": ["-y", "@openread/mcp"],'),Me(' "env": { "OPENREAD_API_KEY": "orsk-..." }'),Me(" }"),Me(" }"),Me(" }"),Me("")}function xF(){let r=process.env.OPENREAD_API_KEY;return r||(wF(),process.exit(1)),vF.test(r)||(Me(`ERROR: Invalid API key format. Expected "orsk-{uuid}", got a ${r.length}-character string starting with "${r.slice(0,5)}..."`),process.exit(1)),r}function SF(){kT(),IT(),RT(),LT(),NT(),UT(),GT(),KT(),XT(),YT(),QT(),ZT(),t_(),n_(),s_()}async function EF(){(process.argv.includes("--version")||process.argv.includes("-v"))&&(process.stdout.write(`0.0.1-test.5
230
+ `)}function wF(){Me(""),Me("ERROR: OPENREAD_API_KEY environment variable is not set."),Me(""),Me("To get your API key:"),Me(" 1. Open Openread (app.openread.ai)"),Me(" 2. Go to Settings > API Keys"),Me(' 3. Click "Create API Key"'),Me(" 4. Copy the orsk-... key"),Me(""),Me("Then set it in your AI client config:"),Me(" {"),Me(' "mcpServers": {'),Me(' "openread": {'),Me(' "command": "npx",'),Me(' "args": ["-y", "@openread/mcp"],'),Me(' "env": { "OPENREAD_API_KEY": "orsk-..." }'),Me(" }"),Me(" }"),Me(" }"),Me("")}function xF(){let r=process.env.OPENREAD_API_KEY;return r||(wF(),process.exit(1)),vF.test(r)||(Me(`ERROR: Invalid API key format. Expected "orsk-{uuid}", got a ${r.length}-character string starting with "${r.slice(0,5)}..."`),process.exit(1)),r}function SF(){kT(),IT(),RT(),LT(),NT(),UT(),GT(),KT(),XT(),YT(),QT(),ZT(),t_(),n_(),s_()}async function EF(){(process.argv.includes("--version")||process.argv.includes("-v"))&&(process.stdout.write(`0.0.1-test.6
231
231
  `),process.exit(0));let r=xF();Me("Starting OpenRead MCP server..."),Me("Authenticating...");let e=new Wo(r);try{await e.initialize(),Me(`Authenticated as ${e.getUserId()}`)}catch(o){o instanceof Error&&Me(`Authentication failed: ${o.message}`),process.exit(1)}let t=new uh,n=new ch(e,t),i=new hh(e.getSupabaseClient());eb({userId:e.getUserId(),bookData:i,loadBook:(o,u,l)=>n.loadBook(o,l??"epub"),requestId:"cli"}),SF();let s=gi(),a=new yF;await s.connect(a),ET({authManager:e,diskCache:t,transport:a}),Me("MCP server ready. Waiting for requests...")}var AF=typeof process<"u"&&!process.env.VITEST;AF&&EF().catch(r=>{Me(`Fatal error: ${r instanceof Error?r.message:String(r)}`),process.exit(1)});export{vF as API_KEY_PATTERN,Me as log,EF as main,wF as printSetupInstructions,SF as registerAllTools,xF as validateApiKey};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openread/mcp",
3
- "version": "0.0.1-test.5",
3
+ "version": "0.0.1-test.6",
4
4
  "private": false,
5
5
  "description": "MCP server for Openread - access your book library from AI assistants",
6
6
  "keywords": ["mcp", "openread", "books", "ebook", "ai", "claude", "cursor"],
@@ -8,7 +8,7 @@
8
8
  "author": "Openread Contributors",
9
9
  "type": "module",
10
10
  "bin": {
11
- "mcp": "./dist/cli.mjs"
11
+ "openread-mcp": "./dist/cli.mjs"
12
12
  },
13
13
  "files": ["dist/cli.mjs"],
14
14
  "engines": {