@cyanheads/openlibrary-mcp-server 0.1.1
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 +391 -0
- package/Dockerfile +98 -0
- package/LICENSE +201 -0
- package/README.md +316 -0
- package/changelog/0.1.x/0.1.0.md +22 -0
- package/changelog/0.1.x/0.1.1.md +25 -0
- package/changelog/template.md +119 -0
- package/dist/config/server-config.d.ts +11 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +20 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/openlibrary-author.resource.d.ts +25 -0
- package/dist/mcp-server/resources/definitions/openlibrary-author.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/openlibrary-author.resource.js +48 -0
- package/dist/mcp-server/resources/definitions/openlibrary-author.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/openlibrary-work.resource.d.ts +21 -0
- package/dist/mcp-server/resources/definitions/openlibrary-work.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/openlibrary-work.resource.js +42 -0
- package/dist/mcp-server/resources/definitions/openlibrary-work.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author-works.tool.d.ts +26 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author-works.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author-works.tool.js +68 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author-works.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author.tool.d.ts +31 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author.tool.js +86 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-author.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.d.ts +26 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.js +56 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-cover-url.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-edition.tool.d.ts +45 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-edition.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-edition.tool.js +132 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-edition.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-editions.tool.d.ts +32 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-editions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-editions.tool.js +106 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-editions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.d.ts +29 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.js +82 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-subject.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-work.tool.d.ts +27 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-work.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-work.tool.js +90 -0
- package/dist/mcp-server/tools/definitions/openlibrary-get-work.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.d.ts +31 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.js +105 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-authors.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.d.ts +65 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.js +217 -0
- package/dist/mcp-server/tools/definitions/openlibrary-search-books.tool.js.map +1 -0
- package/dist/services/open-library/open-library-service.d.ts +57 -0
- package/dist/services/open-library/open-library-service.d.ts.map +1 -0
- package/dist/services/open-library/open-library-service.js +347 -0
- package/dist/services/open-library/open-library-service.js.map +1 -0
- package/dist/services/open-library/types.d.ts +129 -0
- package/dist/services/open-library/types.d.ts.map +1 -0
- package/dist/services/open-library/types.js +6 -0
- package/dist/services/open-library/types.js.map +1 -0
- package/package.json +79 -0
- package/server.json +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Casey Hand @cyanheads
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@cyanheads/openlibrary-mcp-server</h1>
|
|
3
|
+
<p><b>Search books and authors, fetch editions, browse subjects, and resolve cover images from Open Library via MCP. STDIO or Streamable HTTP.</b>
|
|
4
|
+
<div>9 Tools • 2 Resources</div>
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
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
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div align="center">
|
|
15
|
+
|
|
16
|
+
[](https://github.com/cyanheads/openlibrary-mcp-server/releases/latest/download/openlibrary-mcp-server.mcpb) [](https://cursor.com/en/install-mcp?name=openlibrary-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvb3BlbmxpYnJhcnktbWNwLXNlcnZlciJdfQ==) [](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22openlibrary-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fopenlibrary-mcp-server%22%5D%7D)
|
|
17
|
+
|
|
18
|
+
[](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
9 tools for working with Open Library's catalog of 20M+ books, editions, authors, and subjects:
|
|
27
|
+
|
|
28
|
+
| Tool | Description |
|
|
29
|
+
|:---|:---|
|
|
30
|
+
| `openlibrary_search_books` | Full-text book search with field filters (title, author, subject, publisher, ISBN, language), sort options, pagination, and optional live reading availability |
|
|
31
|
+
| `openlibrary_get_work` | Fetch a work by Open Library Work ID (OL…W) — title, description, subjects, cover IDs, and author IDs |
|
|
32
|
+
| `openlibrary_get_editions` | List editions of a work — publishers, languages, formats, ISBNs, and print run details |
|
|
33
|
+
| `openlibrary_get_edition` | Fetch a single edition by ISBN-10, ISBN-13, OCLC, LCCN, or Open Library Edition ID (OL…M) |
|
|
34
|
+
| `openlibrary_search_authors` | Search authors by name — returns Author IDs, birth/death dates, top works, and subject associations |
|
|
35
|
+
| `openlibrary_get_author` | Fetch author detail by Open Library Author ID (OL…A) — bio, dates, photo IDs, and linked identifiers from Wikidata, VIAF, ISNI, Goodreads, and LibraryThing |
|
|
36
|
+
| `openlibrary_get_author_works` | List works by an author — titles, cover IDs, and Work OLIDs for drilling into editions or details |
|
|
37
|
+
| `openlibrary_get_subject` | Browse works by subject tag — returns matching works with edition counts and cover IDs plus the total work count |
|
|
38
|
+
| `openlibrary_get_cover_url` | Resolve a cover image URL for a book or author photo in S/M/L size — returns a direct HTTPS URL embeddable in markdown |
|
|
39
|
+
|
|
40
|
+
### `openlibrary_search_books`
|
|
41
|
+
|
|
42
|
+
Full-text book search across Open Library works.
|
|
43
|
+
|
|
44
|
+
- Free-text query with Solr field prefixes: `title:`, `author:`, `subject:`, `publisher:`, `isbn:`, `language:`
|
|
45
|
+
- Dedicated filter parameters for title, author, subject, publisher, ISBN, and language
|
|
46
|
+
- Sort by relevance, newest, oldest, community rating, or edition count
|
|
47
|
+
- Pagination via offset for paging through large result sets
|
|
48
|
+
- Optional live reading availability from Internet Archive (borrow/browse/read status) — adds ~200ms latency; off by default
|
|
49
|
+
- Returns work-level records with edition counts, cover IDs, Internet Archive identifiers, and e-book access status
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### `openlibrary_get_work`
|
|
54
|
+
|
|
55
|
+
Fetch a work by Open Library Work ID (OL…W).
|
|
56
|
+
|
|
57
|
+
- Title, description, subjects, cover IDs, and linked author IDs
|
|
58
|
+
- Works represent the abstract book concept independent of any specific edition
|
|
59
|
+
- Author names are not included — use `openlibrary_get_author` or `openlibrary_search_books` for names
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### `openlibrary_get_editions`
|
|
64
|
+
|
|
65
|
+
List editions of a work — different publishers, languages, formats, and print runs.
|
|
66
|
+
|
|
67
|
+
- Returns ISBNs, publisher, language, page count, and edition OLIDs
|
|
68
|
+
- Pagination via offset
|
|
69
|
+
- Use after `openlibrary_get_work` or `openlibrary_search_books` to find a specific printing
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### `openlibrary_get_edition`
|
|
74
|
+
|
|
75
|
+
Fetch a single edition by identifier.
|
|
76
|
+
|
|
77
|
+
- Accepts ISBN-10, ISBN-13, OCLC, LCCN, or Open Library Edition ID (OL…M)
|
|
78
|
+
- Pass `id_type "isbn"` for both ISBN-10 and ISBN-13
|
|
79
|
+
- Returns full edition metadata: authors, publisher, language, all identifier types, and the parent work ID
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### `openlibrary_search_authors`
|
|
84
|
+
|
|
85
|
+
Search Open Library authors by name.
|
|
86
|
+
|
|
87
|
+
- Partial names and alternate names work
|
|
88
|
+
- Returns Open Library Author IDs, names, birth/death dates, top works, and subject associations
|
|
89
|
+
- Use author IDs for `openlibrary_get_author` (bio, remote IDs) or `openlibrary_get_author_works` (list of works)
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### `openlibrary_get_author`
|
|
94
|
+
|
|
95
|
+
Fetch author detail by Open Library Author ID (OL…A).
|
|
96
|
+
|
|
97
|
+
- Bio, birth/death dates, photo IDs
|
|
98
|
+
- Linked external identifiers: Wikidata, VIAF, ISNI, Goodreads, and LibraryThing
|
|
99
|
+
- Use `openlibrary_search_authors` to find an author ID first
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### `openlibrary_get_author_works`
|
|
104
|
+
|
|
105
|
+
List works by an author.
|
|
106
|
+
|
|
107
|
+
- Returns titles, cover IDs, and Work OLIDs for drilling into editions or details
|
|
108
|
+
- Use `openlibrary_get_author` for author bio and details, or `openlibrary_get_editions` to explore specific printings
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### `openlibrary_get_subject`
|
|
113
|
+
|
|
114
|
+
Browse works by subject tag.
|
|
115
|
+
|
|
116
|
+
- Returns matching works with edition counts and cover IDs, plus the total work count for the subject
|
|
117
|
+
- Subjects are user-contributed and may be inconsistent ("science fiction", "Science fiction", "SF" are separate tags)
|
|
118
|
+
- Try lowercase forms first
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### `openlibrary_get_cover_url`
|
|
123
|
+
|
|
124
|
+
Resolve a cover image URL for a book or author photo.
|
|
125
|
+
|
|
126
|
+
- Returns a direct HTTPS URL in the requested size (S/M/L)
|
|
127
|
+
- URLs can be embedded in markdown as ``
|
|
128
|
+
- The Covers API always returns HTTP 200 — missing covers return a 1×1 placeholder GIF, not a 404
|
|
129
|
+
|
|
130
|
+
## Resources
|
|
131
|
+
|
|
132
|
+
| Type | Name | Description |
|
|
133
|
+
|:---|:---|:---|
|
|
134
|
+
| Resource | `openlibrary://works/{work_id}` | Work detail by Open Library Work ID — title, description, subjects, cover IDs, and author IDs as injectable context |
|
|
135
|
+
| Resource | `openlibrary://authors/{author_id}` | Author detail by Open Library Author ID — name, bio, dates, photo IDs, and linked external identifiers as injectable context |
|
|
136
|
+
|
|
137
|
+
## Features
|
|
138
|
+
|
|
139
|
+
Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
|
|
140
|
+
|
|
141
|
+
- Declarative tool definitions — single file per tool, framework handles registration and validation
|
|
142
|
+
- Unified error handling across all tools
|
|
143
|
+
- Pluggable auth (`none`, `jwt`, `oauth`)
|
|
144
|
+
- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
|
|
145
|
+
- Structured logging with optional OpenTelemetry tracing
|
|
146
|
+
- Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase
|
|
147
|
+
|
|
148
|
+
Open Library-specific:
|
|
149
|
+
|
|
150
|
+
- Complete Open Library REST API integration — Search API, Books API, Authors API, Subjects API, Covers API
|
|
151
|
+
- Configurable `User-Agent` header for well-behaved bot identification per community convention
|
|
152
|
+
- Work → editions → edition drill-down pattern with explicit linking between OLIDs across tools
|
|
153
|
+
- Internet Archive availability lookup (opt-in) for borrow/read status on search results
|
|
154
|
+
|
|
155
|
+
Agent-friendly output:
|
|
156
|
+
|
|
157
|
+
- Explicit recovery hints on empty results — echoes search criteria and suggests how to broaden
|
|
158
|
+
- All OLID cross-links surfaced in responses so agents can chain tool calls without re-searching
|
|
159
|
+
- Cover URLs rendered as embeddable markdown image syntax
|
|
160
|
+
|
|
161
|
+
## Getting started
|
|
162
|
+
|
|
163
|
+
### Self-Hosted / Local
|
|
164
|
+
|
|
165
|
+
Add the following to your MCP client configuration file.
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"openlibrary": {
|
|
171
|
+
"type": "stdio",
|
|
172
|
+
"command": "bunx",
|
|
173
|
+
"args": ["@cyanheads/openlibrary-mcp-server@latest"],
|
|
174
|
+
"env": {
|
|
175
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
176
|
+
"MCP_LOG_LEVEL": "info"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Or with npx (no Bun required):
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"mcpServers": {
|
|
188
|
+
"openlibrary": {
|
|
189
|
+
"type": "stdio",
|
|
190
|
+
"command": "npx",
|
|
191
|
+
"args": ["-y", "@cyanheads/openlibrary-mcp-server@latest"],
|
|
192
|
+
"env": {
|
|
193
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
194
|
+
"MCP_LOG_LEVEL": "info"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Or with Docker:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"mcpServers": {
|
|
206
|
+
"openlibrary": {
|
|
207
|
+
"type": "stdio",
|
|
208
|
+
"command": "docker",
|
|
209
|
+
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/openlibrary-mcp-server:latest"]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
For Streamable HTTP, set the transport and start the server:
|
|
216
|
+
|
|
217
|
+
```sh
|
|
218
|
+
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
|
|
219
|
+
# Server listens at http://localhost:3010/mcp
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Prerequisites
|
|
223
|
+
|
|
224
|
+
- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js ≥ 24.0.0).
|
|
225
|
+
- No API key required — Open Library is a free, public API.
|
|
226
|
+
|
|
227
|
+
### Installation
|
|
228
|
+
|
|
229
|
+
1. **Clone the repository:**
|
|
230
|
+
|
|
231
|
+
```sh
|
|
232
|
+
git clone https://github.com/cyanheads/openlibrary-mcp-server.git
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
2. **Navigate into the directory:**
|
|
236
|
+
|
|
237
|
+
```sh
|
|
238
|
+
cd openlibrary-mcp-server
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
3. **Install dependencies:**
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
bun install
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Configuration
|
|
248
|
+
|
|
249
|
+
All configuration is validated at startup via Zod schemas in `src/config/server-config.ts`. Key environment variables:
|
|
250
|
+
|
|
251
|
+
| Variable | Description | Default |
|
|
252
|
+
|:---|:---|:---|
|
|
253
|
+
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |
|
|
254
|
+
| `MCP_HTTP_PORT` | HTTP server port | `3010` |
|
|
255
|
+
| `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path where the MCP server is mounted | `/mcp` |
|
|
256
|
+
| `MCP_PUBLIC_URL` | Public origin override for TLS-terminating reverse-proxy deployments | none |
|
|
257
|
+
| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |
|
|
258
|
+
| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |
|
|
259
|
+
| `MCP_GC_PRESSURE_INTERVAL_MS` | Opt-in Bun-only forced-GC pressure loop (ms). Recommended starting point if heap growth is observed: `60000`. | `0` (disabled) |
|
|
260
|
+
| `LOGS_DIR` | Directory for log files (Node.js only) | `<project-root>/logs` |
|
|
261
|
+
| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` | `in-memory` |
|
|
262
|
+
| `OPENLIBRARY_USER_AGENT` | User-Agent sent with all Open Library API requests. Include a contact email per community convention. | `openlibrary-mcp-server/1.0 (openlibrary@archive.org)` |
|
|
263
|
+
| `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
|
|
264
|
+
|
|
265
|
+
## Running the server
|
|
266
|
+
|
|
267
|
+
### Local development
|
|
268
|
+
|
|
269
|
+
- **Build and run the production version**:
|
|
270
|
+
|
|
271
|
+
```sh
|
|
272
|
+
# One-time build
|
|
273
|
+
bun run rebuild
|
|
274
|
+
|
|
275
|
+
# Run the built server
|
|
276
|
+
bun run start:http
|
|
277
|
+
# or
|
|
278
|
+
bun run start:stdio
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
- **Run checks and tests**:
|
|
282
|
+
```sh
|
|
283
|
+
bun run devcheck # Lints, formats, type-checks, and more
|
|
284
|
+
bun run test # Runs the test suite
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Project structure
|
|
288
|
+
|
|
289
|
+
| Directory | Purpose |
|
|
290
|
+
|:---|:---|
|
|
291
|
+
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Nine tools across Search, Books, Authors, Subjects, and Covers. |
|
|
292
|
+
| `src/mcp-server/resources` | Resource definitions. Work and Author resources. |
|
|
293
|
+
| `src/services/open-library` | Open Library service layer — API client and domain types. |
|
|
294
|
+
| `src/config` | Server-specific environment variable parsing and validation with Zod. |
|
|
295
|
+
| `tests/` | Unit and integration tests, mirroring the `src/` structure. |
|
|
296
|
+
|
|
297
|
+
## Development guide
|
|
298
|
+
|
|
299
|
+
See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
|
|
300
|
+
|
|
301
|
+
- Handlers throw, framework catches — no `try/catch` in tool logic
|
|
302
|
+
- Use `ctx.log` for logging, `ctx.state` for storage
|
|
303
|
+
- Register new tools and resources in the `createApp()` arrays
|
|
304
|
+
|
|
305
|
+
## Contributing
|
|
306
|
+
|
|
307
|
+
Issues and pull requests are welcome. Run checks and tests before submitting:
|
|
308
|
+
|
|
309
|
+
```sh
|
|
310
|
+
bun run devcheck
|
|
311
|
+
bun run test
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## License
|
|
315
|
+
|
|
316
|
+
This project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Initial release — 9 tools and 2 resources for Open Library book search, editions, authors, subjects, and cover images"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.1.0 — 2026-05-23
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`openlibrary_search_books`** — full-text book search with field filters (title, author, subject, publisher, ISBN, language), sort options, pagination, and optional live Internet Archive reading availability
|
|
12
|
+
- **`openlibrary_get_work`** — fetch work detail by Open Library Work ID (OL…W): title, description, subjects, cover IDs, and author IDs
|
|
13
|
+
- **`openlibrary_get_editions`** — list editions of a work with ISBNs, publisher, language, page count, and edition OLIDs
|
|
14
|
+
- **`openlibrary_get_edition`** — fetch a single edition by ISBN-10, ISBN-13, OCLC, LCCN, or Open Library Edition ID
|
|
15
|
+
- **`openlibrary_search_authors`** — search authors by name; returns Author IDs, birth/death dates, top works, and subject associations
|
|
16
|
+
- **`openlibrary_get_author`** — fetch author detail by Open Library Author ID (OL…A): bio, dates, photo IDs, and linked Wikidata/VIAF/ISNI/Goodreads/LibraryThing identifiers
|
|
17
|
+
- **`openlibrary_get_author_works`** — list works by an author with titles, cover IDs, and Work OLIDs
|
|
18
|
+
- **`openlibrary_get_subject`** — browse works by subject tag with edition counts, cover IDs, and total work count
|
|
19
|
+
- **`openlibrary_get_cover_url`** — resolve a cover image URL for a book or author photo in S/M/L size
|
|
20
|
+
- **`openlibrary://works/{work_id}`** resource — work detail as injectable conversation context
|
|
21
|
+
- **`openlibrary://authors/{author_id}`** resource — author detail as injectable conversation context
|
|
22
|
+
- `OPENLIBRARY_USER_AGENT` env var for configuring the User-Agent header sent with all Open Library API requests
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Post-launch patch — full Open Library implementation: 9 tools, 2 resources, 11 test files, agent-facing docs and audit"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.1.1 — 2026-05-23
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`openlibrary_search_books`** — full-text book search with field filters, sort options, pagination, and optional Internet Archive reading-availability lookup
|
|
12
|
+
- **`openlibrary_get_work`** — fetch work detail by Open Library Work ID (OL…W)
|
|
13
|
+
- **`openlibrary_get_editions`** — list editions of a work with ISBNs, publisher, language, and page count
|
|
14
|
+
- **`openlibrary_get_edition`** — fetch a single edition by ISBN-10, ISBN-13, OCLC, LCCN, or Open Library Edition ID (OL…M)
|
|
15
|
+
- **`openlibrary_search_authors`** — search authors by name; returns Author IDs, birth/death dates, top works, and subject associations
|
|
16
|
+
- **`openlibrary_get_author`** — fetch author detail by Open Library Author ID (OL…A) with bio, dates, photo IDs, and external identifiers (Wikidata, VIAF, ISNI, Goodreads, LibraryThing)
|
|
17
|
+
- **`openlibrary_get_author_works`** — list works by an author with titles, cover IDs, and Work OLIDs
|
|
18
|
+
- **`openlibrary_get_subject`** — browse works by subject tag with edition counts, cover IDs, and total work count
|
|
19
|
+
- **`openlibrary_get_cover_url`** — resolve a cover image URL for a book or author photo in S/M/L size
|
|
20
|
+
- **`openlibrary://works/{work_id}`** resource — work detail as injectable conversation context
|
|
21
|
+
- **`openlibrary://authors/{author_id}`** resource — author detail as injectable conversation context
|
|
22
|
+
- **`OPENLIBRARY_USER_AGENT`** env var for configuring the User-Agent header sent with all Open Library API requests
|
|
23
|
+
- Full test suite — 11 test files covering all tools and resources
|
|
24
|
+
- `manifest.json` for MCPB bundle support (Claude Desktop one-click install)
|
|
25
|
+
- Install badges for Claude Desktop, Cursor, and VS Code
|