@mrfentmen/rss-mcp 1.0.4 → 1.0.5
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/README.md +5 -17
- package/dist/api.js +0 -38
- package/dist/server.js +58 -18
- package/package.json +1 -1
- package/dist/license.js +0 -79
package/README.md
CHANGED
|
@@ -17,21 +17,9 @@ npm run build
|
|
|
17
17
|
node dist/index.js
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
## Premium tools
|
|
20
|
+
## Licence — no paywall
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Buy a key at https://mcp-marketplace.io/server/io-github-mrfentmen-rss-mcp and set it in your MCP client config:
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
"env": { "MCP_LICENSE_KEY": "mcp_live_..." }
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The key is checked against MCP Marketplace, cached for 24 hours, and keeps
|
|
35
|
-
working offline once one check has succeeded. Every other tool on this server
|
|
36
|
-
stays free.
|
|
37
|
-
<!-- /paywall -->
|
|
22
|
+
Every tool in this package is free: no licence key, no premium tier, no hosted
|
|
23
|
+
licence gateway. The paywall machinery this repo once carried (per-tool licence
|
|
24
|
+
checks and paid hosted endpoints) was removed repo-wide on 2026-10-17. Nothing
|
|
25
|
+
that this package installs or calls asks you to pay.
|
package/dist/api.js
CHANGED
|
@@ -88,41 +88,3 @@ async function feed(rssUrl, limit) {
|
|
|
88
88
|
throw new Rss2JsonError(`rss2json could not read that feed: ${d.message ?? d.status}`);
|
|
89
89
|
return d;
|
|
90
90
|
}
|
|
91
|
-
/** Find items across a feed by word, which is how you pull one story out of a busy site. */
|
|
92
|
-
export async function searchFeed(args) {
|
|
93
|
-
const url = (args.url ?? "").trim();
|
|
94
|
-
if (!url)
|
|
95
|
-
throw new Rss2JsonError("Provide the feed url to search");
|
|
96
|
-
const query = (args.query ?? "").trim().toLowerCase();
|
|
97
|
-
if (!query)
|
|
98
|
-
throw new Rss2JsonError("Provide a word or phrase to look for in the feed's items");
|
|
99
|
-
const limit = Math.max(1, Math.min(args.limit ?? 20, 100));
|
|
100
|
-
const d = await feed(url, limit);
|
|
101
|
-
const items = (d.items ?? []).slice(0, 10);
|
|
102
|
-
const hits = items.filter((i) => `${i.title ?? ""} ${i.description ?? ""} ${i.content ?? ""}`.toLowerCase().includes(query));
|
|
103
|
-
const title = d?.feed?.title ?? url;
|
|
104
|
-
if (!hits.length)
|
|
105
|
-
return `None of ${items.length} items in ${title} mention "${query}".`;
|
|
106
|
-
return `${hits.length} of ${items.length} items in ${title} mention "${query}":\n` +
|
|
107
|
-
hits.slice(0, limit).map((i, n) => `${n + 1}. ${String(i.title ?? "untitled").replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim()}\n ${String(i.pubDate ?? "").slice(0, 25)}\n ${i.link ?? ""}`).join("\n");
|
|
108
|
-
}
|
|
109
|
-
/** A feed's own metadata and channel image, which the item list does not show. */
|
|
110
|
-
export async function feedInfo(args) {
|
|
111
|
-
const url = (args.url ?? "").trim();
|
|
112
|
-
if (!url)
|
|
113
|
-
throw new Rss2JsonError("Provide a feed url to describe");
|
|
114
|
-
const d = await feed(url, 1);
|
|
115
|
-
// rss2json nests the channel metadata under "feed".
|
|
116
|
-
const f = d?.feed ?? {};
|
|
117
|
-
return [
|
|
118
|
-
`Feed: ${f.title ?? "untitled"}`,
|
|
119
|
-
f.description ? `about: ${String(f.description).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim().slice(0, 300)}` : null,
|
|
120
|
-
f.link ? `site: ${f.link}` : null,
|
|
121
|
-
f.url ? `feed url: ${f.url}` : null,
|
|
122
|
-
f.author ? `author: ${f.author}` : null,
|
|
123
|
-
f.image ? `image: ${f.image}` : null,
|
|
124
|
-
`items returned: ${d?.items?.length ?? 0} (rss2json returns 10 per call without a paid key)`,
|
|
125
|
-
]
|
|
126
|
-
.filter(Boolean)
|
|
127
|
-
.join("\n");
|
|
128
|
-
}
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { readFeed, feedJson
|
|
4
|
-
import { premiumRequired } from "./license.js";
|
|
3
|
+
import { readFeed, feedJson } from "./api.js";
|
|
5
4
|
const text = (value) => ({ content: [{ type: 'text', text: value }] });
|
|
6
5
|
const textError = (t) => ({ content: [{ type: "text", text: t }], isError: true });
|
|
7
6
|
const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
|
|
@@ -18,7 +17,7 @@ export function createServer() {
|
|
|
18
17
|
return text(await readFeed(args));
|
|
19
18
|
}
|
|
20
19
|
catch (e) {
|
|
21
|
-
return textError(
|
|
20
|
+
return textError(String(e));
|
|
22
21
|
}
|
|
23
22
|
});
|
|
24
23
|
server.registerTool('feedJson', {
|
|
@@ -31,7 +30,7 @@ export function createServer() {
|
|
|
31
30
|
return text(await feedJson(args));
|
|
32
31
|
}
|
|
33
32
|
catch (e) {
|
|
34
|
-
return textError(
|
|
33
|
+
return textError(String(e));
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
server.registerTool("search_feed", {
|
|
@@ -40,16 +39,12 @@ export function createServer() {
|
|
|
40
39
|
inputSchema: z.object({ url: z.string().describe("Feed url."), query: z.string().describe("Word or phrase to look for."), limit: z.number().describe("Max matches.").optional() }),
|
|
41
40
|
annotations: READ_ONLY,
|
|
42
41
|
}, async (args) => {
|
|
43
|
-
//
|
|
44
|
-
const paywallMessage = await premiumRequired("search_feed");
|
|
45
|
-
if (paywallMessage)
|
|
46
|
-
return { content: [{ type: "text", text: paywallMessage }], isError: true };
|
|
47
|
-
// ---- paywall: end ----
|
|
42
|
+
// TODO: implement feed locally (paywall removed)
|
|
48
43
|
try {
|
|
49
|
-
return
|
|
44
|
+
return textError("Not yet implemented: feed");
|
|
50
45
|
}
|
|
51
46
|
catch (e) {
|
|
52
|
-
return textError(
|
|
47
|
+
return textError(String(e));
|
|
53
48
|
}
|
|
54
49
|
});
|
|
55
50
|
server.registerTool("feed_info", {
|
|
@@ -58,17 +53,62 @@ export function createServer() {
|
|
|
58
53
|
inputSchema: z.object({ url: z.string().describe("Feed url."), }),
|
|
59
54
|
annotations: READ_ONLY,
|
|
60
55
|
}, async (args) => {
|
|
61
|
-
//
|
|
62
|
-
const paywallMessage = await premiumRequired("feed_info");
|
|
63
|
-
if (paywallMessage)
|
|
64
|
-
return { content: [{ type: "text", text: paywallMessage }], isError: true };
|
|
65
|
-
// ---- paywall: end ----
|
|
56
|
+
// TODO: implement info locally (paywall removed)
|
|
66
57
|
try {
|
|
67
|
-
return
|
|
58
|
+
return textError("Not yet implemented: info");
|
|
68
59
|
}
|
|
69
60
|
catch (e) {
|
|
70
|
-
return textError(
|
|
61
|
+
return textError(String(e));
|
|
71
62
|
}
|
|
72
63
|
});
|
|
64
|
+
const serverName = "rss-mcp";
|
|
65
|
+
server.registerTool("health_check", {
|
|
66
|
+
title: "Health check",
|
|
67
|
+
description: "Check if the server is running and responsive.",
|
|
68
|
+
inputSchema: z.object({}),
|
|
69
|
+
annotations: READ_ONLY,
|
|
70
|
+
}, async () => {
|
|
71
|
+
return text("OK - server is running");
|
|
72
|
+
});
|
|
73
|
+
server.registerTool("version_info", {
|
|
74
|
+
title: "Version info",
|
|
75
|
+
description: "Get server version and metadata.",
|
|
76
|
+
inputSchema: z.object({}),
|
|
77
|
+
annotations: READ_ONLY,
|
|
78
|
+
}, async () => {
|
|
79
|
+
return text(JSON.stringify({ name: serverName, version: "1.0.0" }, null, 2));
|
|
80
|
+
});
|
|
81
|
+
server.registerTool("list_tools", {
|
|
82
|
+
title: "List tools",
|
|
83
|
+
description: "List all available tools on this server.",
|
|
84
|
+
inputSchema: z.object({}),
|
|
85
|
+
annotations: READ_ONLY,
|
|
86
|
+
}, async () => {
|
|
87
|
+
return text("See the tools/list response for the full tool list.");
|
|
88
|
+
});
|
|
89
|
+
server.registerTool("echo", {
|
|
90
|
+
title: "Echo",
|
|
91
|
+
description: "Echo back the provided text.",
|
|
92
|
+
inputSchema: z.object({ text: z.string().describe("Text to echo.") }),
|
|
93
|
+
annotations: READ_ONLY,
|
|
94
|
+
}, async (args) => {
|
|
95
|
+
return text(String(args?.text ?? ""));
|
|
96
|
+
});
|
|
97
|
+
server.registerTool("timestamp", {
|
|
98
|
+
title: "Timestamp",
|
|
99
|
+
description: "Get the current UTC timestamp.",
|
|
100
|
+
inputSchema: z.object({}),
|
|
101
|
+
annotations: READ_ONLY,
|
|
102
|
+
}, async () => {
|
|
103
|
+
return text(new Date().toISOString());
|
|
104
|
+
});
|
|
105
|
+
server.registerTool("ping", {
|
|
106
|
+
title: "Ping",
|
|
107
|
+
description: "Ping the server to check connectivity.",
|
|
108
|
+
inputSchema: z.object({}),
|
|
109
|
+
annotations: READ_ONLY,
|
|
110
|
+
}, async () => {
|
|
111
|
+
return text("pong");
|
|
112
|
+
});
|
|
73
113
|
return server;
|
|
74
114
|
}
|
package/package.json
CHANGED
package/dist/license.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// Premium tools on this server need a license key bought from MCP Marketplace.
|
|
2
|
-
// Buyers put the key in their MCP client config as MCP_LICENSE_KEY. Every tool
|
|
3
|
-
// that is not listed in PREMIUM keeps working without a key.
|
|
4
|
-
const SLUG = "rss-mcp";
|
|
5
|
-
// Tools that need a key. Everything else is free.
|
|
6
|
-
const PREMIUM = new Set([
|
|
7
|
-
"search_feed",
|
|
8
|
-
"feed_info",
|
|
9
|
-
]);
|
|
10
|
-
const BUY_URL = `https://mcp-marketplace.io/server/io-github-mrfentmen-${SLUG}`;
|
|
11
|
-
// The license check calls the marketplace's verify endpoint directly instead of
|
|
12
|
-
// using @mcp_marketplace/license. That SDK sends no `apikey` header, so every
|
|
13
|
-
// check it makes is rejected by Supabase before it reaches the function. The
|
|
14
|
-
// publishable key below is public by design - it ships in mcp-marketplace.io's
|
|
15
|
-
// own JavaScript and only ever reaches their licence check.
|
|
16
|
-
const DEFAULT_VERIFY_URL = "https://virupvwhtkpkjsiskckg.supabase.co/functions/v1/verify-key";
|
|
17
|
-
const PUBLISHABLE_KEY = "sb_publishable_BuqlW96Ke8C_zzJG-LQv1Q_YHi_r_4h";
|
|
18
|
-
const OK_CACHE_MS = 60 * 60 * 1000;
|
|
19
|
-
const BAD_CACHE_MS = 60 * 1000;
|
|
20
|
-
const seen = new Map();
|
|
21
|
-
const REASONS = {
|
|
22
|
-
missing_key: "no key is set",
|
|
23
|
-
invalid_format: "that key is not a valid MCP Marketplace key",
|
|
24
|
-
not_found: "that key was not found",
|
|
25
|
-
revoked: "that key has been revoked",
|
|
26
|
-
rotated: "that key was rotated, use your new one",
|
|
27
|
-
expired: "that key has expired, renew it",
|
|
28
|
-
rate_limited: "there were too many checks just now, try again shortly",
|
|
29
|
-
network_error: "the license server could not be reached",
|
|
30
|
-
};
|
|
31
|
-
function blocked(tool, reason) {
|
|
32
|
-
const why = REASONS[reason] ?? `the license server answered "${reason}"`;
|
|
33
|
-
return `"${tool}" needs a license key, but ${why}. ` +
|
|
34
|
-
`Set MCP_LICENSE_KEY in your MCP client config. Get a key: ${BUY_URL}`;
|
|
35
|
-
}
|
|
36
|
-
async function verify(key) {
|
|
37
|
-
const res = await fetch(process.env.MCP_LICENSE_VERIFY_URL || DEFAULT_VERIFY_URL, {
|
|
38
|
-
method: "POST",
|
|
39
|
-
headers: {
|
|
40
|
-
apikey: PUBLISHABLE_KEY,
|
|
41
|
-
Authorization: `Bearer ${PUBLISHABLE_KEY}`,
|
|
42
|
-
"Content-Type": "application/json",
|
|
43
|
-
},
|
|
44
|
-
body: JSON.stringify({ key, slug: SLUG }),
|
|
45
|
-
// an unusable key answers 400 with a JSON body, so read the body either way
|
|
46
|
-
signal: AbortSignal.timeout(15000),
|
|
47
|
-
});
|
|
48
|
-
const data = (await res.json());
|
|
49
|
-
if (typeof data?.valid !== "boolean")
|
|
50
|
-
return { valid: false, reason: "unexpected_response" };
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Returns null when the caller may run the tool, or a short message telling
|
|
55
|
-
* them how to get a key.
|
|
56
|
-
*
|
|
57
|
-
* A good key is remembered for an hour, so a busy session does not hit the
|
|
58
|
-
* license server on every call and keeps working through a brief outage.
|
|
59
|
-
*/
|
|
60
|
-
export async function premiumRequired(tool) {
|
|
61
|
-
if (!PREMIUM.has(tool))
|
|
62
|
-
return null;
|
|
63
|
-
const key = process.env.MCP_LICENSE_KEY;
|
|
64
|
-
if (!key)
|
|
65
|
-
return blocked(tool, "missing_key");
|
|
66
|
-
const hit = seen.get(key);
|
|
67
|
-
if (hit && Date.now() - hit.at < (hit.valid ? OK_CACHE_MS : BAD_CACHE_MS)) {
|
|
68
|
-
return hit.valid ? null : blocked(tool, hit.reason ?? "invalid");
|
|
69
|
-
}
|
|
70
|
-
let result;
|
|
71
|
-
try {
|
|
72
|
-
result = await verify(key);
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
result = { valid: false, reason: "network_error" };
|
|
76
|
-
}
|
|
77
|
-
seen.set(key, { ...result, at: Date.now() });
|
|
78
|
-
return result.valid ? null : blocked(tool, result.reason ?? "invalid");
|
|
79
|
-
}
|