@asonni-dev/sendkit-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 +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { sendTelegramMessage, telegramMessageInputSchema } from "@asonni-dev/sendkit-core";
|
|
5
|
+
//#region src/index.ts
|
|
6
|
+
const server = new McpServer({
|
|
7
|
+
name: "sendkit-local",
|
|
8
|
+
version: "0.0.0"
|
|
9
|
+
});
|
|
10
|
+
function getTelegramBotToken() {
|
|
11
|
+
const token = process.env.TELEGRAM_BOT_TOKEN;
|
|
12
|
+
if (!token) throw new Error("TELEGRAM_BOT_TOKEN is required. Configure it in your MCP client environment.");
|
|
13
|
+
return token;
|
|
14
|
+
}
|
|
15
|
+
server.registerTool("telegram", {
|
|
16
|
+
title: "Telegram",
|
|
17
|
+
description: "Send a Telegram message.",
|
|
18
|
+
inputSchema: telegramMessageInputSchema.shape
|
|
19
|
+
}, async (input) => {
|
|
20
|
+
const result = await sendTelegramMessage({
|
|
21
|
+
...input,
|
|
22
|
+
botToken: getTelegramBotToken()
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
content: [{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: `Sent Telegram message ${result.messageId} to chat ${result.chatId}.`
|
|
28
|
+
}],
|
|
29
|
+
structuredContent: result
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
async function main() {
|
|
33
|
+
const transport = new StdioServerTransport();
|
|
34
|
+
await server.connect(transport);
|
|
35
|
+
}
|
|
36
|
+
main().catch((err) => {
|
|
37
|
+
console.error(err);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export {};
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nimport {\n telegramMessageInputSchema,\n sendTelegramMessage\n} from '@asonni-dev/sendkit-core';\n\nconst server = new McpServer({\n name: 'sendkit-local',\n version: '0.0.0'\n});\n\nfunction getTelegramBotToken(): string {\n const token = process.env.TELEGRAM_BOT_TOKEN;\n\n if (!token) {\n throw new Error(\n 'TELEGRAM_BOT_TOKEN is required. Configure it in your MCP client environment.'\n );\n }\n\n return token;\n}\n\nserver.registerTool(\n 'telegram',\n {\n title: 'Telegram',\n description: 'Send a Telegram message.',\n inputSchema: telegramMessageInputSchema.shape\n },\n async input => {\n const result = await sendTelegramMessage({\n ...input,\n botToken: getTelegramBotToken()\n });\n\n return {\n content: [\n {\n type: 'text',\n text: `Sent Telegram message ${result.messageId} to chat ${result.chatId}.`\n }\n ],\n structuredContent: result\n };\n }\n);\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\nmain().catch(err => {\n console.error(err);\n process.exit(1);\n});\n"],"mappings":";;;;;AASA,MAAM,SAAS,IAAI,UAAU;CAC3B,MAAM;CACN,SAAS;AACX,CAAC;AAED,SAAS,sBAA8B;CACrC,MAAM,QAAQ,QAAQ,IAAI;CAE1B,IAAI,CAAC,OACH,MAAM,IAAI,MACR,8EACF;CAGF,OAAO;AACT;AAEA,OAAO,aACL,YACA;CACE,OAAO;CACP,aAAa;CACb,aAAa,2BAA2B;AAC1C,GACA,OAAM,UAAS;CACb,MAAM,SAAS,MAAM,oBAAoB;EACvC,GAAG;EACH,UAAU,oBAAoB;CAChC,CAAC;CAED,OAAO;EACL,SAAS,CACP;GACE,MAAM;GACN,MAAM,yBAAyB,OAAO,UAAU,WAAW,OAAO,OAAO;EAC3E,CACF;EACA,mBAAmB;CACrB;AACF,CACF;AAEA,eAAe,OAAO;CACpB,MAAM,YAAY,IAAI,qBAAqB;CAC3C,MAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,CAAC,CAAC,OAAM,QAAO;CAClB,QAAQ,MAAM,GAAG;CACjB,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@asonni-dev/sendkit-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"bin": {
|
|
5
|
+
"sendkit-mcp": "./dist/index.js"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsdown",
|
|
25
|
+
"pack:dry": "bun run build && bun pm pack --dry-run",
|
|
26
|
+
"prepublishOnly": "bun run build"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@asonni-dev/sendkit-core": "1.0.0",
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
31
|
+
"zod": "^4.4.3"
|
|
32
|
+
}
|
|
33
|
+
}
|