@tb-eng/sendkit-mcp 0.0.0 → 0.0.1

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.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
4
  import { sendTelegramMessage, telegramMessageInputSchema } from "@tb-eng/sendkit-core";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\n\nimport {\n\tsendTelegramMessage,\n\ttelegramMessageInputSchema,\n} from \"@tb-eng/sendkit-core\";\n\nconst token = process.env.TELEGRAM_BOT_TOKEN;\n\nconst server = new McpServer({\n\tname: \"Sendkit\",\n\tversion: \"1.0.0\",\n});\n\nserver.registerTool(\n\t\"telegram\",\n\t{\n\t\tdescription: \"Send a message to telegram\",\n\t\tinputSchema: telegramMessageInputSchema.shape,\n\t},\n\tasync ({ chatId, message }) => {\n\t\tif (!token) {\n\t\t\tthrow new Error(\"TELEGRAM_BOT_TOKEN is not set\");\n\t\t}\n\t\tif (!chatId || !message) {\n\t\t\tthrow new Error(\"ChatId and message are required\");\n\t\t}\n\t\ttry {\n\t\t\tconst result = await sendTelegramMessage({\n\t\t\t\tchatId,\n\t\t\t\tbotToken: token,\n\t\t\t\tmessage,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: `Message sent to telegram, messageId:${result.chatId} and chatId: ${result.messageId}`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tstructuredContent: result,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: `Failed to send message to telegram ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t},\n);\n\nasync function main() {\n\tconst transport = new StdioServerTransport();\n\tawait server.connect(transport);\n\n\tconsole.error(\"Sendkit MCP Server running on stdio\");\n}\n\nmain().catch((error) => {\n\tconsole.error(\"Fatal error in main():\", error);\n\tprocess.exit(1);\n});\n"],"mappings":";;;;AAQA,MAAM,QAAQ,QAAQ,IAAI;AAE1B,MAAM,SAAS,IAAI,UAAU;CAC5B,MAAM;CACN,SAAS;AACV,CAAC;AAED,OAAO,aACN,YACA;CACC,aAAa;CACb,aAAa,2BAA2B;AACzC,GACA,OAAO,EAAE,QAAQ,cAAc;CAC9B,IAAI,CAAC,OACJ,MAAM,IAAI,MAAM,+BAA+B;CAEhD,IAAI,CAAC,UAAU,CAAC,SACf,MAAM,IAAI,MAAM,iCAAiC;CAElD,IAAI;EACH,MAAM,SAAS,MAAM,oBAAoB;GACxC;GACA,UAAU;GACV;EACD,CAAC;EAED,OAAO;GACN,SAAS,CACR;IACC,MAAM;IACN,MAAM,uCAAuC,OAAO,OAAO,eAAe,OAAO;GAClF,CACD;GACA,mBAAmB;EACpB;CACD,SAAS,OAAO;EACf,OAAO,EACN,SAAS,CACR;GACC,MAAM;GACN,MAAM,sCAAsC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAClG,CACD,EACD;CACD;AACD,CACD;AAEA,eAAe,OAAO;CACrB,MAAM,YAAY,IAAI,qBAAqB;CAC3C,MAAM,OAAO,QAAQ,SAAS;CAE9B,QAAQ,MAAM,qCAAqC;AACpD;AAEA,KAAK,CAAC,CAAC,OAAO,UAAU;CACvB,QAAQ,MAAM,0BAA0B,KAAK;CAC7C,QAAQ,KAAK,CAAC;AACf,CAAC"}
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\tsendTelegramMessage,\n\ttelegramMessageInputSchema,\n} from \"@tb-eng/sendkit-core\";\n\nconst token = process.env.TELEGRAM_BOT_TOKEN;\n\nconst server = new McpServer({\n\tname: \"Sendkit\",\n\tversion: \"1.0.0\",\n});\n\nserver.registerTool(\n\t\"telegram\",\n\t{\n\t\tdescription: \"Send a message to telegram\",\n\t\tinputSchema: telegramMessageInputSchema.shape,\n\t},\n\tasync ({ chatId, message }) => {\n\t\tif (!token) {\n\t\t\tthrow new Error(\"TELEGRAM_BOT_TOKEN is not set\");\n\t\t}\n\t\tif (!chatId || !message) {\n\t\t\tthrow new Error(\"ChatId and message are required\");\n\t\t}\n\t\ttry {\n\t\t\tconst result = await sendTelegramMessage({\n\t\t\t\tchatId,\n\t\t\t\tbotToken: token,\n\t\t\t\tmessage,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: `Message sent to telegram, messageId:${result.chatId} and chatId: ${result.messageId}`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tstructuredContent: result,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: `Failed to send message to telegram ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t},\n);\n\nasync function main() {\n\tconst transport = new StdioServerTransport();\n\tawait server.connect(transport);\n\n\tconsole.error(\"Sendkit MCP Server running on stdio\");\n}\n\nmain().catch((error) => {\n\tconsole.error(\"Fatal error in main():\", error);\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;AASA,MAAM,QAAQ,QAAQ,IAAI;AAE1B,MAAM,SAAS,IAAI,UAAU;CAC5B,MAAM;CACN,SAAS;AACV,CAAC;AAED,OAAO,aACN,YACA;CACC,aAAa;CACb,aAAa,2BAA2B;AACzC,GACA,OAAO,EAAE,QAAQ,cAAc;CAC9B,IAAI,CAAC,OACJ,MAAM,IAAI,MAAM,+BAA+B;CAEhD,IAAI,CAAC,UAAU,CAAC,SACf,MAAM,IAAI,MAAM,iCAAiC;CAElD,IAAI;EACH,MAAM,SAAS,MAAM,oBAAoB;GACxC;GACA,UAAU;GACV;EACD,CAAC;EAED,OAAO;GACN,SAAS,CACR;IACC,MAAM;IACN,MAAM,uCAAuC,OAAO,OAAO,eAAe,OAAO;GAClF,CACD;GACA,mBAAmB;EACpB;CACD,SAAS,OAAO;EACf,OAAO,EACN,SAAS,CACR;GACC,MAAM;GACN,MAAM,sCAAsC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAClG,CACD,EACD;CACD;AACD,CACD;AAEA,eAAe,OAAO;CACrB,MAAM,YAAY,IAAI,qBAAqB;CAC3C,MAAM,OAAO,QAAQ,SAAS;CAE9B,QAAQ,MAAM,qCAAqC;AACpD;AAEA,KAAK,CAAC,CAAC,OAAO,UAAU;CACvB,QAAQ,MAAM,0BAA0B,KAAK;CAC7C,QAAQ,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@tb-eng/sendkit-mcp",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "type": "module",
5
+ "bin": {
6
+ "sendkit-mcp": "./dist/index.js"
7
+ },
5
8
  "scripts": {
6
9
  "build": "tsdown",
7
10
  "pack:dry": "bun run build && bun pm pack --dry-run",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
4