@cyanheads/openlibrary-mcp-server 0.1.9 → 0.1.11
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.
- package/CLAUDE.md +7 -3
- package/README.md +4 -4
- package/dist/mcp-server/tools/definitions/openlibrary-get-author-works.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-author-works.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-author.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-author.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-edition.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-edition.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-editions.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-editions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.d.ts +3 -2
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.js +11 -9
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-work.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-get-work.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.d.ts +3 -8
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.js +8 -21
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.d.ts +4 -8
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.js +33 -33
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.js.map +1 -1
- package/package.json +6 -4
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** openlibrary-mcp-server
|
|
4
|
-
**Version:** 0.1.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.
|
|
4
|
+
**Version:** 0.1.11
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.21`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
@@ -264,6 +264,7 @@ Available skills:
|
|
|
264
264
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
265
265
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
266
266
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
267
|
+
| `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
|
|
267
268
|
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
268
269
|
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
269
270
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
@@ -278,6 +279,7 @@ Available skills:
|
|
|
278
279
|
| `api-testing` | createMockContext, test patterns |
|
|
279
280
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
280
281
|
| `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
|
|
282
|
+
| `api-mirror` | MirrorService API — persistent self-refreshing SQLite mirror of a bulk upstream dataset |
|
|
281
283
|
| `api-workers` | Cloudflare Workers runtime |
|
|
282
284
|
|
|
283
285
|
When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
|
|
@@ -296,10 +298,12 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
296
298
|
| `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
297
299
|
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
298
300
|
| `npm run tree` | Generate directory structure doc |
|
|
299
|
-
| `npm run format` | Auto-fix formatting |
|
|
301
|
+
| `npm run format` | Auto-fix formatting (safe fixes only) |
|
|
302
|
+
| `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
300
303
|
| `npm test` | Run tests |
|
|
301
304
|
| `npm run start:stdio` | Production mode (stdio) |
|
|
302
305
|
| `npm run start:http` | Production mode (HTTP) |
|
|
306
|
+
| `npm run release:github` | Create GitHub Release from the current tag (title + notes-from-tag) |
|
|
303
307
|
| `npm run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
|
|
304
308
|
| `npm run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
305
309
|
| `npm run bundle` | Build and pack as `.mcpb` for one-click Claude Desktop install |
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/openlibrary-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/openlibrary-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -169,7 +169,7 @@ Add the following to your MCP client configuration file.
|
|
|
169
169
|
```json
|
|
170
170
|
{
|
|
171
171
|
"mcpServers": {
|
|
172
|
-
"openlibrary": {
|
|
172
|
+
"openlibrary-mcp-server": {
|
|
173
173
|
"type": "stdio",
|
|
174
174
|
"command": "bunx",
|
|
175
175
|
"args": ["@cyanheads/openlibrary-mcp-server@latest"],
|
|
@@ -187,7 +187,7 @@ Or with npx (no Bun required):
|
|
|
187
187
|
```json
|
|
188
188
|
{
|
|
189
189
|
"mcpServers": {
|
|
190
|
-
"openlibrary": {
|
|
190
|
+
"openlibrary-mcp-server": {
|
|
191
191
|
"type": "stdio",
|
|
192
192
|
"command": "npx",
|
|
193
193
|
"args": ["-y", "@cyanheads/openlibrary-mcp-server@latest"],
|
|
@@ -205,7 +205,7 @@ Or with Docker:
|
|
|
205
205
|
```json
|
|
206
206
|
{
|
|
207
207
|
"mcpServers": {
|
|
208
|
-
"openlibrary": {
|
|
208
|
+
"openlibrary-mcp-server": {
|
|
209
209
|
"type": "stdio",
|
|
210
210
|
"command": "docker",
|
|
211
211
|
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/openlibrary-mcp-server:latest"]
|
|
@@ -22,5 +22,5 @@ export declare const openlibraryGetAuthorWorks: import("@cyanheads/mcp-ts-core")
|
|
|
22
22
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
23
23
|
readonly when: "Author ID does not exist on Open Library.";
|
|
24
24
|
readonly recovery: "Verify the OLID format (e.g., \"OL24638A\") or use openlibrary_search_authors to find the correct ID.";
|
|
25
|
-
}]>;
|
|
25
|
+
}], undefined>;
|
|
26
26
|
//# sourceMappingURL=openlibrary-get-author-works.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-author-works.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-author-works.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"openlibrary-get-author-works.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-author-works.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;cAuEpC,CAAC"}
|
|
@@ -27,5 +27,5 @@ export declare const openlibraryGetAuthor: import("@cyanheads/mcp-ts-core").Tool
|
|
|
27
27
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
28
28
|
readonly when: "Author ID does not exist on Open Library.";
|
|
29
29
|
readonly recovery: "Verify the OLID format (e.g., \"OL24638A\") or use openlibrary_search_authors to find the correct ID.";
|
|
30
|
-
}]>;
|
|
30
|
+
}], undefined>;
|
|
31
31
|
//# sourceMappingURL=openlibrary-get-author.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-author.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-author.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"openlibrary-get-author.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-author.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;cA8E/B,CAAC"}
|
|
@@ -22,5 +22,5 @@ export declare const openlibraryGetCoverUrl: import("@cyanheads/mcp-ts-core").To
|
|
|
22
22
|
}, z.core.$strip>, z.ZodObject<{
|
|
23
23
|
url: z.ZodString;
|
|
24
24
|
note: z.ZodString;
|
|
25
|
-
}, z.core.$strip>, undefined>;
|
|
25
|
+
}, z.core.$strip>, undefined, undefined>;
|
|
26
26
|
//# sourceMappingURL=openlibrary-get-cover-url.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-cover-url.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"openlibrary-get-cover-url.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;wCA+DjC,CAAC"}
|
|
@@ -41,5 +41,5 @@ export declare const openlibraryGetEdition: import("@cyanheads/mcp-ts-core").Too
|
|
|
41
41
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
42
42
|
readonly when: "Identifier format is invalid for the specified id_type.";
|
|
43
43
|
readonly recovery: "Check the identifier format: ISBNs are 10 or 13 digits; OLIDs end in M (e.g., OL7353617M).";
|
|
44
|
-
}]>;
|
|
44
|
+
}], undefined>;
|
|
45
45
|
//# sourceMappingURL=openlibrary-get-edition.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-edition.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-edition.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"openlibrary-get-edition.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-edition.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuIhC,CAAC"}
|
|
@@ -28,5 +28,5 @@ export declare const openlibraryGetEditions: import("@cyanheads/mcp-ts-core").To
|
|
|
28
28
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
29
29
|
readonly when: "Work ID does not exist on Open Library.";
|
|
30
30
|
readonly recovery: "Verify the Work ID format (e.g., \"OL45804W\") or use openlibrary_search_books first.";
|
|
31
|
-
}]>;
|
|
31
|
+
}], undefined>;
|
|
32
32
|
//# sourceMappingURL=openlibrary-get-editions.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-editions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-editions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"openlibrary-get-editions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-editions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;cAsGjC,CAAC"}
|
|
@@ -19,11 +19,12 @@ export declare const openlibraryGetSubject: import("@cyanheads/mcp-ts-core").Too
|
|
|
19
19
|
edition_count: z.ZodNumber;
|
|
20
20
|
cover_id: z.ZodOptional<z.ZodNumber>;
|
|
21
21
|
}, z.core.$strip>>;
|
|
22
|
-
message: z.ZodOptional<z.ZodString>;
|
|
23
22
|
}, z.core.$strip>, readonly [{
|
|
24
23
|
readonly reason: "not_found";
|
|
25
24
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
26
25
|
readonly when: "Subject not found or has no works.";
|
|
27
26
|
readonly recovery: "Try a broader or alternate subject term (e.g., \"fiction\" instead of a specific subgenre).";
|
|
28
|
-
}]
|
|
27
|
+
}], {
|
|
28
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}>;
|
|
29
30
|
//# sourceMappingURL=openlibrary-get-subject.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-subject.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-subject.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"openlibrary-get-subject.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-subject.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;EAwGhC,CAAC"}
|
|
@@ -40,11 +40,14 @@ export const openlibraryGetSubject = tool('openlibrary_get_subject', {
|
|
|
40
40
|
})
|
|
41
41
|
.describe('A work under this subject.'))
|
|
42
42
|
.describe('Works under this subject, up to limit.'),
|
|
43
|
-
|
|
43
|
+
}),
|
|
44
|
+
/** Agent-facing context: empty-result notice when the subject has no works. */
|
|
45
|
+
enrichment: {
|
|
46
|
+
notice: z
|
|
44
47
|
.string()
|
|
45
48
|
.optional()
|
|
46
|
-
.describe('Recovery
|
|
47
|
-
}
|
|
49
|
+
.describe('Recovery guidance when work_count is 0 — echoes the subject and suggests alternatives. Absent when works are found.'),
|
|
50
|
+
},
|
|
48
51
|
errors: [
|
|
49
52
|
{
|
|
50
53
|
reason: 'not_found',
|
|
@@ -62,9 +65,12 @@ export const openlibraryGetSubject = tool('openlibrary_get_subject', {
|
|
|
62
65
|
const svc = getOpenLibraryService();
|
|
63
66
|
const result = await svc.getSubject(input.subject, input.limit, input.offset, ctx);
|
|
64
67
|
if (result.work_count === 0) {
|
|
68
|
+
ctx.enrich.notice(`No works found for subject "${input.subject}". Subjects on Open Library are user-contributed and case-sensitive — try lowercase (e.g., "science fiction"), an alternate form, or a broader term.`);
|
|
65
69
|
return {
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
subject_name: result.subject_name,
|
|
71
|
+
subject_key: result.subject_key,
|
|
72
|
+
work_count: 0,
|
|
73
|
+
works: [],
|
|
68
74
|
};
|
|
69
75
|
}
|
|
70
76
|
return result;
|
|
@@ -73,10 +79,6 @@ export const openlibraryGetSubject = tool('openlibrary_get_subject', {
|
|
|
73
79
|
const lines = [];
|
|
74
80
|
lines.push(`## Subject: ${result.subject_name}`);
|
|
75
81
|
lines.push(`**Key:** ${result.subject_key} | **Total works:** ${result.work_count} | **Returned:** ${result.works.length}`);
|
|
76
|
-
if (result.message) {
|
|
77
|
-
lines.push('');
|
|
78
|
-
lines.push(`> ${result.message}`);
|
|
79
|
-
}
|
|
80
82
|
for (const work of result.works) {
|
|
81
83
|
lines.push('');
|
|
82
84
|
lines.push(`### ${work.title}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-subject.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-subject.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IACnE,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,gRAAgR;IAClR,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,6IAA6I,CAC9I;QACH,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,G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E,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -23,5 +23,5 @@ export declare const openlibraryGetWork: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
23
23
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
24
24
|
readonly when: "Work ID does not exist on Open Library.";
|
|
25
25
|
readonly recovery: "Verify the OLID format (e.g., \"OL45804W\") or use openlibrary_search_books to find the correct ID.";
|
|
26
|
-
}]>;
|
|
26
|
+
}], undefined>;
|
|
27
27
|
//# sourceMappingURL=openlibrary-get-work.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-get-work.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-work.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"openlibrary-get-work.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-get-work.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;cAqF7B,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/openlibrary-search-authors.tool
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
6
|
export declare const openlibrarySearchAuthors: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
7
|
query: z.ZodString;
|
|
9
8
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
@@ -21,11 +20,7 @@ export declare const openlibrarySearchAuthors: import("@cyanheads/mcp-ts-core").
|
|
|
21
20
|
top_subjects: z.ZodArray<z.ZodString>;
|
|
22
21
|
ratings_average: z.ZodOptional<z.ZodNumber>;
|
|
23
22
|
}, z.core.$strip>>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly code: JsonRpcErrorCode.NotFound;
|
|
28
|
-
readonly when: "Query matched no authors.";
|
|
29
|
-
readonly recovery: "Check the spelling, try a partial name, or use an alternate name form.";
|
|
30
|
-
}]>;
|
|
23
|
+
}, z.core.$strip>, undefined, {
|
|
24
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}>;
|
|
31
26
|
//# sourceMappingURL=openlibrary-search-authors.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-search-authors.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-authors.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"openlibrary-search-authors.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-authors.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EA+FnC,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/openlibrary-search-authors.tool
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
6
|
import { getOpenLibraryService } from '../../../services/open-library/open-library-service.js';
|
|
8
7
|
export const openlibrarySearchAuthors = tool('openlibrary_search_authors', {
|
|
9
8
|
title: 'Search Authors',
|
|
@@ -45,39 +44,27 @@ export const openlibrarySearchAuthors = tool('openlibrary_search_authors', {
|
|
|
45
44
|
})
|
|
46
45
|
.describe('A matching author record.'))
|
|
47
46
|
.describe('Matching authors, up to limit.'),
|
|
48
|
-
|
|
47
|
+
}),
|
|
48
|
+
/** Agent-facing context: empty-result notice when no authors match. */
|
|
49
|
+
enrichment: {
|
|
50
|
+
notice: z
|
|
49
51
|
.string()
|
|
50
52
|
.optional()
|
|
51
|
-
.describe('Recovery
|
|
52
|
-
}
|
|
53
|
-
errors: [
|
|
54
|
-
{
|
|
55
|
-
reason: 'no_results',
|
|
56
|
-
code: JsonRpcErrorCode.NotFound,
|
|
57
|
-
when: 'Query matched no authors.',
|
|
58
|
-
recovery: 'Check the spelling, try a partial name, or use an alternate name form.',
|
|
59
|
-
},
|
|
60
|
-
],
|
|
53
|
+
.describe('Recovery guidance when no authors match — echoes the query and suggests alternatives. Absent when results are found.'),
|
|
54
|
+
},
|
|
61
55
|
async handler(input, ctx) {
|
|
62
56
|
ctx.log.info('Searching authors', { query: input.query, limit: input.limit });
|
|
63
57
|
const svc = getOpenLibraryService();
|
|
64
58
|
const result = await svc.searchAuthors(input.query, input.limit, input.offset, ctx);
|
|
65
59
|
if (result.authors.length === 0) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
authors: [],
|
|
69
|
-
message: `No authors matched "${input.query}". Try a partial name, check spelling, or use an alternate name form.`,
|
|
70
|
-
};
|
|
60
|
+
ctx.enrich.notice(`No authors matched "${input.query}". Try a partial name, check spelling, or use an alternate name form.`);
|
|
61
|
+
return { total: 0, authors: [] };
|
|
71
62
|
}
|
|
72
63
|
return result;
|
|
73
64
|
},
|
|
74
65
|
format: (result) => {
|
|
75
66
|
const lines = [];
|
|
76
67
|
lines.push(`**Total:** ${result.total} | **Returned:** ${result.authors.length}`);
|
|
77
|
-
if (result.message) {
|
|
78
|
-
lines.push('');
|
|
79
|
-
lines.push(`> ${result.message}`);
|
|
80
|
-
}
|
|
81
68
|
for (const author of result.authors) {
|
|
82
69
|
lines.push('');
|
|
83
70
|
lines.push(`## ${author.name}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-search-authors.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-authors.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openlibrary-search-authors.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-authors.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IACzE,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,mPAAmP;IACrP,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mEAAmE,CAAC;QAC/F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACtF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC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{ z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
6
|
export declare const openlibrarySearchBooks: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
7
|
query: z.ZodOptional<z.ZodString>;
|
|
9
8
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -55,11 +54,8 @@ export declare const openlibrarySearchBooks: import("@cyanheads/mcp-ts-core").To
|
|
|
55
54
|
}, z.core.$strip>>>;
|
|
56
55
|
ia_identifiers: z.ZodArray<z.ZodString>;
|
|
57
56
|
}, z.core.$strip>>;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
readonly
|
|
61
|
-
|
|
62
|
-
readonly when: "Query matched no works.";
|
|
63
|
-
readonly recovery: "Broaden the query, check spelling, or try different search terms.";
|
|
64
|
-
}]>;
|
|
57
|
+
}, z.core.$strip>, undefined, {
|
|
58
|
+
readonly queryEcho: z.ZodOptional<z.ZodString>;
|
|
59
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}>;
|
|
65
61
|
//# sourceMappingURL=openlibrary-search-books.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-search-books.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-books.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"openlibrary-search-books.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-books.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyOjC,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/openlibrary-search-books.tool
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
6
|
import { getOpenLibraryService } from '../../../services/open-library/open-library-service.js';
|
|
8
7
|
export const openlibrarySearchBooks = tool('openlibrary_search_books', {
|
|
9
8
|
title: 'Search Books',
|
|
@@ -115,19 +114,18 @@ export const openlibrarySearchBooks = tool('openlibrary_search_books', {
|
|
|
115
114
|
})
|
|
116
115
|
.describe('A work-level result from the search.'))
|
|
117
116
|
.describe('Matching works, up to limit.'),
|
|
118
|
-
|
|
117
|
+
}),
|
|
118
|
+
/** Agent-facing context: the parsed query echo and empty-result notice. */
|
|
119
|
+
enrichment: {
|
|
120
|
+
queryEcho: z
|
|
119
121
|
.string()
|
|
120
122
|
.optional()
|
|
121
|
-
.describe('
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
when: 'Query matched no works.',
|
|
128
|
-
recovery: 'Broaden the query, check spelling, or try different search terms.',
|
|
129
|
-
},
|
|
130
|
-
],
|
|
123
|
+
.describe('The effective search criteria as the server interpreted them — query string plus any active field filters. Absent when only a bare query is used.'),
|
|
124
|
+
notice: z
|
|
125
|
+
.string()
|
|
126
|
+
.optional()
|
|
127
|
+
.describe('Recovery guidance when results are empty — echoes the search criteria and suggests how to broaden. Absent when results are found.'),
|
|
128
|
+
},
|
|
131
129
|
async handler(input, ctx) {
|
|
132
130
|
ctx.log.info('Searching books', {
|
|
133
131
|
query: input.query,
|
|
@@ -139,35 +137,37 @@ export const openlibrarySearchBooks = tool('openlibrary_search_books', {
|
|
|
139
137
|
});
|
|
140
138
|
const svc = getOpenLibraryService();
|
|
141
139
|
const result = await svc.searchBooks(input, ctx);
|
|
140
|
+
// Build queryEcho from active filters for agent context
|
|
141
|
+
const filters = [];
|
|
142
|
+
if (input.query)
|
|
143
|
+
filters.push(`query "${input.query}"`);
|
|
144
|
+
if (input.title)
|
|
145
|
+
filters.push(`title "${input.title}"`);
|
|
146
|
+
if (input.author)
|
|
147
|
+
filters.push(`author "${input.author}"`);
|
|
148
|
+
if (input.subject)
|
|
149
|
+
filters.push(`subject "${input.subject}"`);
|
|
150
|
+
if (input.publisher)
|
|
151
|
+
filters.push(`publisher "${input.publisher}"`);
|
|
152
|
+
if (input.isbn)
|
|
153
|
+
filters.push(`isbn "${input.isbn}"`);
|
|
154
|
+
if (input.language)
|
|
155
|
+
filters.push(`language "${input.language}"`);
|
|
156
|
+
const queryEcho = filters.length > 1 ? filters.join(', ') : undefined;
|
|
142
157
|
if (result.works.length === 0) {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
terms.push(`query "${input.query}"`);
|
|
146
|
-
if (input.title)
|
|
147
|
-
terms.push(`title "${input.title}"`);
|
|
148
|
-
if (input.author)
|
|
149
|
-
terms.push(`author "${input.author}"`);
|
|
150
|
-
if (input.subject)
|
|
151
|
-
terms.push(`subject "${input.subject}"`);
|
|
152
|
-
const hint = terms.length
|
|
153
|
-
? `No works matched ${terms.join(', ')}. Try broader or different terms.`
|
|
158
|
+
const hint = filters.length
|
|
159
|
+
? `No works matched ${filters.join(', ')}. Try broader or different terms.`
|
|
154
160
|
: 'No works matched your search. Try different filters or a general query.';
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
works: [],
|
|
159
|
-
message: hint,
|
|
160
|
-
};
|
|
161
|
+
ctx.enrich({ queryEcho });
|
|
162
|
+
ctx.enrich.notice(hint);
|
|
163
|
+
return { total: 0, offset: result.offset, works: [] };
|
|
161
164
|
}
|
|
165
|
+
ctx.enrich({ queryEcho });
|
|
162
166
|
return { total: result.total, offset: result.offset, works: result.works };
|
|
163
167
|
},
|
|
164
168
|
format: (result) => {
|
|
165
169
|
const lines = [];
|
|
166
170
|
lines.push(`**Total results:** ${result.total} | **Offset:** ${result.offset} | **Returned:** ${result.works.length}`);
|
|
167
|
-
if (result.message) {
|
|
168
|
-
lines.push('');
|
|
169
|
-
lines.push(`> ${result.message}`);
|
|
170
|
-
}
|
|
171
171
|
for (const work of result.works) {
|
|
172
172
|
lines.push('');
|
|
173
173
|
lines.push(`## ${work.title}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openlibrary-search-books.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-books.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openlibrary-search-books.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/openlibrary-search-books.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IACrE,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,iWAAiW;IACnW,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,2JAA2J,CAC5J;QACH,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qEAAqE,CAAC;QAClF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;QACpF,OAAO,EAAE,CAAC;aACP,MAAM,EAA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C9B,MAAM,OAAO,GAAG;oBACd,WAAW,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;oBACrC,WAAW,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE;oBAClD,WAAW,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE;oBAClD,aAAa,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE;oBACtD,SAAS,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;oBACxC,SAAS,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;oBACxC,YAAY,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE;oBAC9C,eAAe,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE;iBACjD,CAAC;gBACF,IAAI,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;oBAC1C,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC,CAAC;gBACpE,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,qBAAqB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzD,CAAC;iBAAM,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;gBACtC,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/openlibrary-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"mcpName": "io.github.cyanheads/openlibrary-mcp-server",
|
|
5
5
|
"description": "Search books and authors, fetch editions, browse subjects, and resolve cover images from Open Library via MCP. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"clean": "bun run scripts/clean.ts",
|
|
17
17
|
"devcheck": "bun run scripts/devcheck.ts",
|
|
18
18
|
"tree": "bun run scripts/tree.ts",
|
|
19
|
-
"format": "biome check --write
|
|
19
|
+
"format": "biome check --write .",
|
|
20
|
+
"format:unsafe": "biome check --write --unsafe .",
|
|
20
21
|
"test": "bunx vitest run",
|
|
21
22
|
"audit:refresh": "rm -f bun.lock && bun install && bun audit",
|
|
22
23
|
"list-skills": "bun run scripts/list-skills.ts",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"bundle": "bun run build && npx -y @anthropic-ai/mcpb pack . dist/openlibrary-mcp-server.mcpb",
|
|
26
27
|
"changelog:build": "bun run scripts/build-changelog.ts",
|
|
27
28
|
"changelog:check": "bun run scripts/build-changelog.ts --check",
|
|
29
|
+
"release:github": "tsx scripts/release-github.ts",
|
|
28
30
|
"publish-mcp": "mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish",
|
|
29
31
|
"start:stdio": "MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js",
|
|
30
32
|
"start:http": "MCP_TRANSPORT_TYPE=http bun ./dist/index.js"
|
|
@@ -75,7 +77,7 @@
|
|
|
75
77
|
"access": "public"
|
|
76
78
|
},
|
|
77
79
|
"dependencies": {
|
|
78
|
-
"@cyanheads/mcp-ts-core": "^0.9.
|
|
80
|
+
"@cyanheads/mcp-ts-core": "^0.9.21",
|
|
79
81
|
"pino-pretty": "^13.1.3",
|
|
80
82
|
"zod": "^4.4.3"
|
|
81
83
|
},
|
|
@@ -86,6 +88,6 @@
|
|
|
86
88
|
"ignore": "^7.0.5",
|
|
87
89
|
"tsc-alias": "^1.8.17",
|
|
88
90
|
"typescript": "^6.0.3",
|
|
89
|
-
"vitest": "^4.1.
|
|
91
|
+
"vitest": "^4.1.8"
|
|
90
92
|
}
|
|
91
93
|
}
|
package/server.json
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"url": "https://openlibrary.caseyjhand.com/mcp"
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
|
-
"version": "0.1.
|
|
15
|
+
"version": "0.1.11",
|
|
16
16
|
"packages": [
|
|
17
17
|
{
|
|
18
18
|
"registryType": "npm",
|
|
19
19
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
20
20
|
"identifier": "@cyanheads/openlibrary-mcp-server",
|
|
21
21
|
"runtimeHint": "bun",
|
|
22
|
-
"version": "0.1.
|
|
22
|
+
"version": "0.1.11",
|
|
23
23
|
"packageArguments": [
|
|
24
24
|
{
|
|
25
25
|
"type": "positional",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
49
49
|
"identifier": "@cyanheads/openlibrary-mcp-server",
|
|
50
50
|
"runtimeHint": "bun",
|
|
51
|
-
"version": "0.1.
|
|
51
|
+
"version": "0.1.11",
|
|
52
52
|
"packageArguments": [
|
|
53
53
|
{
|
|
54
54
|
"type": "positional",
|