@gonzih/meatbag-mcp 1.0.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/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +200 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* meatbag-mcp — Human-in-the-loop MCP server via Telegram
|
|
4
|
+
*
|
|
5
|
+
* Exposes a single MCP tool: request_human_input
|
|
6
|
+
* When called, sends a Telegram message and waits for the next reply.
|
|
7
|
+
* Uses a FIFO queue: the oldest pending request gets the next reply.
|
|
8
|
+
*
|
|
9
|
+
* Uses Node 18+ built-in fetch to call the Telegram Bot API directly —
|
|
10
|
+
* no third-party Telegram library needed, zero extra dependency attack surface.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* meatbag-mcp — Human-in-the-loop MCP server via Telegram
|
|
5
|
+
*
|
|
6
|
+
* Exposes a single MCP tool: request_human_input
|
|
7
|
+
* When called, sends a Telegram message and waits for the next reply.
|
|
8
|
+
* Uses a FIFO queue: the oldest pending request gets the next reply.
|
|
9
|
+
*
|
|
10
|
+
* Uses Node 18+ built-in fetch to call the Telegram Bot API directly —
|
|
11
|
+
* no third-party Telegram library needed, zero extra dependency attack surface.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
15
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
16
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
17
|
+
// ── Config ──────────────────────────────────────────────────────────────────
|
|
18
|
+
const BOT_TOKEN = process.env.MEATBAG_BOT_TOKEN;
|
|
19
|
+
const CHAT_ID = process.env.MEATBAG_CHAT_ID;
|
|
20
|
+
const DEFAULT_TIMEOUT = parseInt(process.env.MEATBAG_TIMEOUT_SECONDS ?? "120", 10);
|
|
21
|
+
if (!BOT_TOKEN) {
|
|
22
|
+
process.stderr.write("[meatbag-mcp] MEATBAG_BOT_TOKEN env var is required\n");
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
if (!CHAT_ID) {
|
|
26
|
+
process.stderr.write("[meatbag-mcp] MEATBAG_CHAT_ID env var is required\n");
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
const TG_API = `https://api.telegram.org/bot${BOT_TOKEN}`;
|
|
30
|
+
async function tgSendMessage(chatId, text) {
|
|
31
|
+
const res = await fetch(`${TG_API}/sendMessage`, {
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers: { "Content-Type": "application/json" },
|
|
34
|
+
body: JSON.stringify({ chat_id: chatId, text }),
|
|
35
|
+
});
|
|
36
|
+
if (!res.ok) {
|
|
37
|
+
const body = await res.text();
|
|
38
|
+
throw new Error(`Telegram sendMessage failed: ${res.status} ${body}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function tgGetUpdates(offset, timeoutSecs) {
|
|
42
|
+
const res = await fetch(`${TG_API}/getUpdates`, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: { "Content-Type": "application/json" },
|
|
45
|
+
body: JSON.stringify({ offset, timeout: timeoutSecs, allowed_updates: ["message"] }),
|
|
46
|
+
signal: AbortSignal.timeout((timeoutSecs + 5) * 1000),
|
|
47
|
+
});
|
|
48
|
+
if (!res.ok) {
|
|
49
|
+
const body = await res.text();
|
|
50
|
+
throw new Error(`Telegram getUpdates failed: ${res.status} ${body}`);
|
|
51
|
+
}
|
|
52
|
+
const data = (await res.json());
|
|
53
|
+
return data.result ?? [];
|
|
54
|
+
}
|
|
55
|
+
const pendingQueue = [];
|
|
56
|
+
// ── Long-poll loop ───────────────────────────────────────────────────────────
|
|
57
|
+
let pollingOffset = 0;
|
|
58
|
+
let pollingActive = false;
|
|
59
|
+
/**
|
|
60
|
+
* Start background long-polling loop.
|
|
61
|
+
* Runs only when there are pending requests; stops itself when the queue empties.
|
|
62
|
+
*/
|
|
63
|
+
function ensurePolling() {
|
|
64
|
+
if (pollingActive)
|
|
65
|
+
return;
|
|
66
|
+
pollingActive = true;
|
|
67
|
+
void pollLoop();
|
|
68
|
+
}
|
|
69
|
+
async function pollLoop() {
|
|
70
|
+
while (pendingQueue.length > 0) {
|
|
71
|
+
try {
|
|
72
|
+
const updates = await tgGetUpdates(pollingOffset, 30);
|
|
73
|
+
for (const update of updates) {
|
|
74
|
+
pollingOffset = update.update_id + 1;
|
|
75
|
+
const msg = update.message;
|
|
76
|
+
if (!msg)
|
|
77
|
+
continue;
|
|
78
|
+
if (String(msg.chat.id) !== CHAT_ID)
|
|
79
|
+
continue;
|
|
80
|
+
const text = msg.text ?? msg.caption ?? "";
|
|
81
|
+
if (!text)
|
|
82
|
+
continue;
|
|
83
|
+
const pending = pendingQueue.shift();
|
|
84
|
+
if (!pending)
|
|
85
|
+
continue;
|
|
86
|
+
clearTimeout(pending.timeoutHandle);
|
|
87
|
+
pending.resolve(text);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
92
|
+
// Ignore timeout errors from AbortSignal — they're expected
|
|
93
|
+
if (!errMsg.includes("TimeoutError") && !errMsg.includes("AbortError")) {
|
|
94
|
+
process.stderr.write(`[meatbag-mcp] Polling error: ${errMsg}\n`);
|
|
95
|
+
}
|
|
96
|
+
// Brief back-off before retrying to avoid hammering the API
|
|
97
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
pollingActive = false;
|
|
101
|
+
}
|
|
102
|
+
// ── Core logic ────────────────────────────────────────────────────────────────
|
|
103
|
+
async function requestHumanInput(message, options, timeoutSeconds = DEFAULT_TIMEOUT) {
|
|
104
|
+
// Build the Telegram message text
|
|
105
|
+
let text = message;
|
|
106
|
+
if (options && options.length > 0) {
|
|
107
|
+
text += "\n\nOptions:";
|
|
108
|
+
options.forEach((opt, i) => {
|
|
109
|
+
text += `\n${i + 1}. ${opt}`;
|
|
110
|
+
});
|
|
111
|
+
text += "\n\nReply with the option number or your own answer.";
|
|
112
|
+
}
|
|
113
|
+
await tgSendMessage(CHAT_ID, text);
|
|
114
|
+
return new Promise((resolve) => {
|
|
115
|
+
const timeoutHandle = setTimeout(() => {
|
|
116
|
+
const idx = pendingQueue.findIndex((p) => p.timeoutHandle === timeoutHandle);
|
|
117
|
+
if (idx !== -1)
|
|
118
|
+
pendingQueue.splice(idx, 1);
|
|
119
|
+
resolve({ answer: "", timed_out: true });
|
|
120
|
+
}, timeoutSeconds * 1000);
|
|
121
|
+
pendingQueue.push({
|
|
122
|
+
resolve: (answer) => resolve({ answer, timed_out: false }),
|
|
123
|
+
reject: (err) => {
|
|
124
|
+
process.stderr.write(`[meatbag-mcp] Request rejected: ${err.message}\n`);
|
|
125
|
+
resolve({ answer: "", timed_out: true });
|
|
126
|
+
},
|
|
127
|
+
timeoutHandle,
|
|
128
|
+
});
|
|
129
|
+
// Kick off polling if not already running
|
|
130
|
+
ensurePolling();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// ── MCP Server ────────────────────────────────────────────────────────────────
|
|
134
|
+
const server = new index_js_1.Server({ name: "meatbag-mcp", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
135
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
136
|
+
tools: [
|
|
137
|
+
{
|
|
138
|
+
name: "request_human_input",
|
|
139
|
+
description: "Send a message to the human operator via Telegram and wait for their reply. Use this when you need a human decision, approval, captcha solution, or free-text input.",
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
message: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "The question or prompt to send to the human operator.",
|
|
146
|
+
},
|
|
147
|
+
options: {
|
|
148
|
+
type: "array",
|
|
149
|
+
items: { type: "string" },
|
|
150
|
+
description: "Optional list of choices. If provided, they are shown as a numbered list and the user can reply with a number.",
|
|
151
|
+
},
|
|
152
|
+
timeout_seconds: {
|
|
153
|
+
type: "number",
|
|
154
|
+
description: `How long to wait for a reply in seconds (default: ${DEFAULT_TIMEOUT}).`,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
required: ["message"],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
}));
|
|
162
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
163
|
+
if (request.params.name !== "request_human_input") {
|
|
164
|
+
return {
|
|
165
|
+
content: [{ type: "text", text: `Unknown tool: ${request.params.name}` }],
|
|
166
|
+
isError: true,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const args = request.params.arguments;
|
|
170
|
+
if (!args.message || typeof args.message !== "string") {
|
|
171
|
+
return {
|
|
172
|
+
content: [{ type: "text", text: "message argument is required" }],
|
|
173
|
+
isError: true,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
const result = await requestHumanInput(args.message, args.options, args.timeout_seconds);
|
|
178
|
+
return {
|
|
179
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
184
|
+
return {
|
|
185
|
+
content: [{ type: "text", text: `Error: ${msg}` }],
|
|
186
|
+
isError: true,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
// ── Start ─────────────────────────────────────────────────────────────────────
|
|
191
|
+
async function main() {
|
|
192
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
193
|
+
await server.connect(transport);
|
|
194
|
+
process.stderr.write("[meatbag-mcp] Server running on stdio\n");
|
|
195
|
+
}
|
|
196
|
+
main().catch((err) => {
|
|
197
|
+
process.stderr.write(`[meatbag-mcp] Fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
198
|
+
process.exit(1);
|
|
199
|
+
});
|
|
200
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;GASG;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAE5C,+EAA+E;AAE/E,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;AAChD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC5C,MAAM,eAAe,GAAG,QAAQ,CAC9B,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,KAAK,EAC5C,EAAE,CACH,CAAC;AAEF,IAAI,CAAC,SAAS,EAAE,CAAC;IACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,MAAM,GAAG,+BAA+B,SAAS,EAAE,CAAC;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C7D,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,CAAC;YAClD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,iFAAiF;AAEjF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAClE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gonzih/meatbag-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Human-in-the-loop MCP server via Telegram — lets Claude Code agents pause and ask a human for input",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"meatbag-mcp": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"start": "node dist/index.js",
|
|
12
|
+
"dev": "ts-node src/index.ts"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"mcp",
|
|
16
|
+
"telegram",
|
|
17
|
+
"human-in-the-loop",
|
|
18
|
+
"claude",
|
|
19
|
+
"ai-agent"
|
|
20
|
+
],
|
|
21
|
+
"author": "gonzih",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "1.29.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "22.15.21",
|
|
28
|
+
"typescript": "5.8.3"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
}
|
|
39
|
+
}
|