@pipeworx/mcp-listen-notes 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 +57 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +115 -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,57 @@
|
|
|
1
|
+
# mcp-listen-notes
|
|
2
|
+
|
|
3
|
+
Podcast directory search + best podcasts + recommendations via Listen Notes. Free key required.
|
|
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
|
+
| `search` | Search podcasts/episodes/curated/people. |
|
|
12
|
+
| `best_podcasts` | Top podcasts. |
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"mcpServers": {
|
|
21
|
+
"listen-notes": {
|
|
22
|
+
"url": "https://gateway.pipeworx.io/listen-notes/mcp"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or connect to the full Pipeworx gateway for access to all 250+ data sources:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"pipeworx": {
|
|
34
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Using with ask_pipeworx
|
|
41
|
+
|
|
42
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
ask_pipeworx({ question: "your question about Listen Notes data" })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
49
|
+
|
|
50
|
+
## More
|
|
51
|
+
|
|
52
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
53
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-listen-notes",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Podcast directory search + best podcasts + recommendations via Listen Notes. Free key required.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "listen-notes"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-listen-notes"
|
|
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/listen-notes",
|
|
4
|
+
"title": "Listen Notes",
|
|
5
|
+
"description": "Podcast directory search + best podcasts + recommendations via Listen Notes. Free key required.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/listen-notes",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-listen-notes",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/listen-notes/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
* Listen Notes MCP.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const BASE = 'https://listen-api.listennotes.com/api/v2';
|
|
25
|
+
const UA = 'pipeworx-mcp-listen-notes/1.0 (+https://pipeworx.io)';
|
|
26
|
+
|
|
27
|
+
const tools: McpToolExport['tools'] = [
|
|
28
|
+
{
|
|
29
|
+
name: 'search',
|
|
30
|
+
description: 'Search podcasts/episodes/curated/people.',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
query: { type: 'string' },
|
|
35
|
+
type: { type: 'string', description: 'podcast | episode | curated | person' },
|
|
36
|
+
sort_by_date: { type: 'number', description: '0 (relevance, default) | 1 (date desc)' },
|
|
37
|
+
language: { type: 'string' },
|
|
38
|
+
len_min: { type: 'number' },
|
|
39
|
+
len_max: { type: 'number' },
|
|
40
|
+
genre_ids: { type: 'string', description: 'Comma-sep ids.' },
|
|
41
|
+
offset: { type: 'number' },
|
|
42
|
+
},
|
|
43
|
+
required: ['query'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{ name: 'podcast', description: 'Single podcast.', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
|
|
47
|
+
{ name: 'episode', description: 'Single episode.', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
|
|
48
|
+
{ name: 'genres', description: 'List genres.', inputSchema: { type: 'object', properties: {} } },
|
|
49
|
+
{
|
|
50
|
+
name: 'best_podcasts',
|
|
51
|
+
description: 'Top podcasts.',
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
genre_id: { type: 'number' },
|
|
56
|
+
region: { type: 'string' },
|
|
57
|
+
sort: { type: 'string' },
|
|
58
|
+
page: { type: 'number' },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{ name: 'recommendations_for_podcast', description: 'Similar podcasts.', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
|
|
63
|
+
{ name: 'recommendations_for_episode', description: 'Similar episodes.', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
67
|
+
const apiKey = (args._apiKey as string | undefined)?.trim();
|
|
68
|
+
if (!apiKey) throw new Error('Listen Notes requires an API key. Set PLATFORM_LISTENNOTES_KEY or pass ?_apiKey=… (free at https://www.listennotes.com/api/dashboard/).');
|
|
69
|
+
const get = async (path: string, params?: URLSearchParams) => {
|
|
70
|
+
const qs = params ? `?${params}` : '';
|
|
71
|
+
const res = await fetch(`${BASE}${path}${qs}`, {
|
|
72
|
+
headers: { Accept: 'application/json', 'User-Agent': UA, 'X-ListenAPI-Key': apiKey },
|
|
73
|
+
});
|
|
74
|
+
if (res.status === 401) throw new Error('Listen Notes: invalid API key.');
|
|
75
|
+
if (res.status === 429) throw new Error('Listen Notes: 429 rate-limit (300/mo free tier).');
|
|
76
|
+
if (!res.ok) throw new Error(`Listen Notes: ${res.status}`);
|
|
77
|
+
return res.json();
|
|
78
|
+
};
|
|
79
|
+
switch (name) {
|
|
80
|
+
case 'search': {
|
|
81
|
+
const p = new URLSearchParams({ q: reqStr(args, 'query', '"AI podcast"') });
|
|
82
|
+
for (const k of ['type', 'language', 'genre_ids'] as const) if (args[k]) p.set(k, String(args[k]));
|
|
83
|
+
for (const k of ['sort_by_date', 'len_min', 'len_max', 'offset'] as const) if (args[k] != null) p.set(k, String(args[k]));
|
|
84
|
+
return get('/search', p);
|
|
85
|
+
}
|
|
86
|
+
case 'podcast':
|
|
87
|
+
return get(`/podcasts/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}`);
|
|
88
|
+
case 'episode':
|
|
89
|
+
return get(`/episodes/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}`);
|
|
90
|
+
case 'genres':
|
|
91
|
+
return get('/genres');
|
|
92
|
+
case 'best_podcasts': {
|
|
93
|
+
const p = new URLSearchParams();
|
|
94
|
+
if (args.genre_id != null) p.set('genre_id', String(args.genre_id));
|
|
95
|
+
if (args.region) p.set('region', String(args.region));
|
|
96
|
+
if (args.sort) p.set('sort', String(args.sort));
|
|
97
|
+
if (args.page) p.set('page', String(args.page));
|
|
98
|
+
return get('/best_podcasts', p);
|
|
99
|
+
}
|
|
100
|
+
case 'recommendations_for_podcast':
|
|
101
|
+
return get(`/podcasts/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}/recommendations`);
|
|
102
|
+
case 'recommendations_for_episode':
|
|
103
|
+
return get(`/episodes/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}/recommendations`);
|
|
104
|
+
default:
|
|
105
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function reqStr(args: Record<string, unknown>, key: string, example: string): string {
|
|
110
|
+
const v = args[key];
|
|
111
|
+
if (typeof v !== 'string' || !v.trim()) throw new Error(`Required argument "${key}" is missing. Pass a string like ${example}.`);
|
|
112
|
+
return v;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
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
|
+
}
|