@pipeworx/mcp-librivox 0.1.0
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/LICENSE +21 -0
- package/README.md +59 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +113 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# mcp-librivox
|
|
2
|
+
|
|
3
|
+
LibriVox public-domain audiobooks (~17000 titles in dozens of languages)
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 250+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `audiobooks` | Search audiobooks. |
|
|
12
|
+
| `audiobook` | Single audiobook by id. |
|
|
13
|
+
| `authors` | Search authors. |
|
|
14
|
+
| `tracks` | List tracks for an audiobook. |
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"librivox": {
|
|
24
|
+
"url": "https://gateway.pipeworx.io/librivox/mcp"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or connect to the full Pipeworx gateway for access to all 250+ data sources:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"pipeworx": {
|
|
36
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Using with ask_pipeworx
|
|
43
|
+
|
|
44
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
ask_pipeworx({ question: "your question about Librivox data" })
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
51
|
+
|
|
52
|
+
## More
|
|
53
|
+
|
|
54
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
55
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-librivox",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "LibriVox public-domain audiobooks (~17000 titles in dozens of languages)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "librivox"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-librivox"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/librivox",
|
|
4
|
+
"title": "Librivox",
|
|
5
|
+
"description": "LibriVox public-domain audiobooks (~17000 titles in dozens of languages)",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/librivox",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-librivox",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/librivox/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* LibriVox MCP.
|
|
21
|
+
*
|
|
22
|
+
* Auth: none. Docs: https://librivox.org/api/info
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const BASE = 'https://librivox.org/api/feed';
|
|
27
|
+
const UA = 'pipeworx-mcp-librivox/1.0 (+https://pipeworx.io)';
|
|
28
|
+
|
|
29
|
+
const tools: McpToolExport['tools'] = [
|
|
30
|
+
{
|
|
31
|
+
name: 'audiobooks',
|
|
32
|
+
description: 'Search audiobooks.',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
query: { type: 'string', description: 'Title keyword filter.' },
|
|
37
|
+
author: { type: 'string' },
|
|
38
|
+
title: { type: 'string' },
|
|
39
|
+
since: { type: 'string', description: 'YYYY-MM-DD' },
|
|
40
|
+
limit: { type: 'number' },
|
|
41
|
+
offset: { type: 'number' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'audiobook',
|
|
47
|
+
description: 'Single audiobook by id.',
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: { id: { type: 'number' } },
|
|
51
|
+
required: ['id'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'authors',
|
|
56
|
+
description: 'Search authors.',
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
query: { type: 'string' },
|
|
61
|
+
last_name: { type: 'string' },
|
|
62
|
+
limit: { type: 'number' },
|
|
63
|
+
offset: { type: 'number' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'tracks',
|
|
69
|
+
description: 'List tracks for an audiobook.',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: { project_id: { type: 'number' } },
|
|
73
|
+
required: ['project_id'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
79
|
+
switch (name) {
|
|
80
|
+
case 'audiobooks': {
|
|
81
|
+
const params = new URLSearchParams({ format: 'json' });
|
|
82
|
+
if (args.title) params.set('title', String(args.title));
|
|
83
|
+
if (args.author) params.set('author', String(args.author));
|
|
84
|
+
if (args.since) params.set('since', String(args.since));
|
|
85
|
+
if (args.limit) params.set('limit', String(args.limit));
|
|
86
|
+
if (args.offset) params.set('offset', String(args.offset));
|
|
87
|
+
if (args.query) params.set('title', String(args.query));
|
|
88
|
+
return lvGet(`/audiobooks/?${params}`);
|
|
89
|
+
}
|
|
90
|
+
case 'audiobook':
|
|
91
|
+
return lvGet(`/audiobooks/?id=${(args.id as number) | 0}&format=json`);
|
|
92
|
+
case 'authors': {
|
|
93
|
+
const params = new URLSearchParams({ format: 'json' });
|
|
94
|
+
if (args.query) params.set('last_name', String(args.query));
|
|
95
|
+
if (args.last_name) params.set('last_name', String(args.last_name));
|
|
96
|
+
if (args.limit) params.set('limit', String(args.limit));
|
|
97
|
+
if (args.offset) params.set('offset', String(args.offset));
|
|
98
|
+
return lvGet(`/authors/?${params}`);
|
|
99
|
+
}
|
|
100
|
+
case 'tracks':
|
|
101
|
+
return lvGet(`/audiotracks/?project_id=${(args.project_id as number) | 0}&format=json`);
|
|
102
|
+
default:
|
|
103
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async function lvGet(path: string): Promise<unknown> {
|
|
108
|
+
const res = await fetch(`${BASE}${path}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
109
|
+
if (!res.ok) throw new Error(`LibriVox: ${res.status}`);
|
|
110
|
+
return res.json();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|