@pipeworx/mcp-lobsters 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 +38 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +200 -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,38 @@
|
|
|
1
|
+
# mcp-lobsters
|
|
2
|
+
|
|
3
|
+
Lobsters MCP — stories and discussions from lobste.rs
|
|
4
|
+
|
|
5
|
+
Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `get_hottest` | Get the hottest (front page) stories on Lobsters. |
|
|
12
|
+
| `get_newest` | Get the newest stories on Lobsters. |
|
|
13
|
+
| `get_story` | Get a single Lobsters story and its comments by short ID. |
|
|
14
|
+
| `get_tag` | Get stories for a specific Lobsters tag (e.g. "rust", "programming", "security"). |
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
Add to your MCP client config:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"lobsters": {
|
|
24
|
+
"url": "https://gateway.pipeworx.io/lobsters/mcp"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or use the CLI:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx pipeworx use lobsters
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-lobsters",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lobsters MCP — stories and discussions from lobste.rs",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "lobsters"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-lobsters"
|
|
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/lobsters",
|
|
4
|
+
"title": "lousters",
|
|
5
|
+
"description": "Lobsters MCP — stories and discussions from lobste.rs",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/lobsters",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-lobsters",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/lobsters/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Lobsters MCP — stories and discussions from lobste.rs
|
|
18
|
+
*
|
|
19
|
+
* Tools:
|
|
20
|
+
* - get_hottest: Get the hottest stories on Lobsters
|
|
21
|
+
* - get_newest: Get the newest stories on Lobsters
|
|
22
|
+
* - get_story: Get a single story and its comments by short ID
|
|
23
|
+
* - get_tag: Get stories for a specific tag
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const BASE = 'https://lobste.rs';
|
|
28
|
+
|
|
29
|
+
const tools: McpToolExport['tools'] = [
|
|
30
|
+
{
|
|
31
|
+
name: 'get_hottest',
|
|
32
|
+
description: 'Get the hottest (front page) stories on Lobsters.',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'get_newest',
|
|
40
|
+
description: 'Get the newest stories on Lobsters.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'get_story',
|
|
48
|
+
description: 'Get a single Lobsters story and its comments by short ID.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
short_id: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'The short alphanumeric story ID from the Lobsters URL (e.g. "abcdef")',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ['short_id'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'get_tag',
|
|
62
|
+
description: 'Get stories for a specific Lobsters tag (e.g. "rust", "programming", "security").',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
tag: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
description: 'Tag name (e.g. "rust", "programming", "security")',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ['tag'],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
interface LobstersStory {
|
|
77
|
+
short_id: string;
|
|
78
|
+
short_id_url: string;
|
|
79
|
+
created_at: string;
|
|
80
|
+
title: string;
|
|
81
|
+
url: string;
|
|
82
|
+
score: number;
|
|
83
|
+
upvotes: number;
|
|
84
|
+
downvotes: number;
|
|
85
|
+
comment_count: number;
|
|
86
|
+
description?: string;
|
|
87
|
+
description_plain?: string;
|
|
88
|
+
comments_url: string;
|
|
89
|
+
submitter_user: { username: string };
|
|
90
|
+
tags: string[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface LobstersComment {
|
|
94
|
+
short_id: string;
|
|
95
|
+
created_at: string;
|
|
96
|
+
updated_at: string;
|
|
97
|
+
is_deleted: boolean;
|
|
98
|
+
is_moderated: boolean;
|
|
99
|
+
score: number;
|
|
100
|
+
upvotes: number;
|
|
101
|
+
downvotes: number;
|
|
102
|
+
comment: string;
|
|
103
|
+
comment_plain: string;
|
|
104
|
+
url: string;
|
|
105
|
+
indent_level: number;
|
|
106
|
+
commenting_user: { username: string };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface LobstersStoryWithComments extends LobstersStory {
|
|
110
|
+
comments: LobstersComment[];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function mapStory(s: LobstersStory) {
|
|
114
|
+
return {
|
|
115
|
+
short_id: s.short_id,
|
|
116
|
+
url: s.url,
|
|
117
|
+
comments_url: s.comments_url,
|
|
118
|
+
title: s.title,
|
|
119
|
+
score: s.score,
|
|
120
|
+
upvotes: s.upvotes,
|
|
121
|
+
downvotes: s.downvotes,
|
|
122
|
+
comment_count: s.comment_count,
|
|
123
|
+
created_at: s.created_at,
|
|
124
|
+
submitter: s.submitter_user.username,
|
|
125
|
+
tags: s.tags,
|
|
126
|
+
description: s.description_plain ?? s.description ?? null,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
131
|
+
switch (name) {
|
|
132
|
+
case 'get_hottest': {
|
|
133
|
+
const res = await fetch(`${BASE}/hottest.json`);
|
|
134
|
+
if (!res.ok) throw new Error(`Lobsters hottest error: ${res.status}`);
|
|
135
|
+
|
|
136
|
+
const data = (await res.json()) as LobstersStory[];
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
count: data.length,
|
|
140
|
+
stories: data.map(mapStory),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
case 'get_newest': {
|
|
145
|
+
const res = await fetch(`${BASE}/newest.json`);
|
|
146
|
+
if (!res.ok) throw new Error(`Lobsters newest error: ${res.status}`);
|
|
147
|
+
|
|
148
|
+
const data = (await res.json()) as LobstersStory[];
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
count: data.length,
|
|
152
|
+
stories: data.map(mapStory),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
case 'get_story': {
|
|
157
|
+
const shortId = args.short_id as string;
|
|
158
|
+
|
|
159
|
+
const res = await fetch(`${BASE}/s/${shortId}.json`);
|
|
160
|
+
if (!res.ok) throw new Error(`Lobsters story error: ${res.status}`);
|
|
161
|
+
|
|
162
|
+
const data = (await res.json()) as LobstersStoryWithComments;
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
story: mapStory(data),
|
|
166
|
+
comments: (data.comments ?? []).map((c) => ({
|
|
167
|
+
short_id: c.short_id,
|
|
168
|
+
url: c.url,
|
|
169
|
+
created_at: c.created_at,
|
|
170
|
+
score: c.score,
|
|
171
|
+
indent_level: c.indent_level,
|
|
172
|
+
author: c.commenting_user.username,
|
|
173
|
+
body: c.comment_plain ?? c.comment,
|
|
174
|
+
is_deleted: c.is_deleted,
|
|
175
|
+
is_moderated: c.is_moderated,
|
|
176
|
+
})),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
case 'get_tag': {
|
|
181
|
+
const tag = args.tag as string;
|
|
182
|
+
|
|
183
|
+
const res = await fetch(`${BASE}/t/${tag}.json`);
|
|
184
|
+
if (!res.ok) throw new Error(`Lobsters tag error: ${res.status}`);
|
|
185
|
+
|
|
186
|
+
const data = (await res.json()) as LobstersStory[];
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
tag,
|
|
190
|
+
count: data.length,
|
|
191
|
+
stories: data.map(mapStory),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
default:
|
|
196
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export default { tools, callTool } 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
|
+
}
|