telegram-claude-mcp 1.0.0 → 1.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.
Files changed (2) hide show
  1. package/bin/run.js +14 -2
  2. package/package.json +1 -1
package/bin/run.js CHANGED
@@ -2,12 +2,24 @@
2
2
  import { spawn } from 'node:child_process';
3
3
  import { dirname, join } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
+ import { createRequire } from 'node:module';
5
6
 
6
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const require = createRequire(import.meta.url);
9
+
10
+ // Find tsx executable - works both locally and when installed via npx
11
+ let tsxPath;
12
+ try {
13
+ const tsxPkg = require.resolve('tsx/package.json');
14
+ tsxPath = join(dirname(tsxPkg), 'dist', 'cli.mjs');
15
+ } catch {
16
+ // Fallback to node_modules/.bin
17
+ tsxPath = join(__dirname, '..', 'node_modules', '.bin', 'tsx');
18
+ }
19
+
7
20
  const srcPath = join(__dirname, '..', 'src', 'index.ts');
8
- const tsxPath = join(__dirname, '..', 'node_modules', '.bin', 'tsx');
9
21
 
10
- const child = spawn(tsxPath, [srcPath], {
22
+ const child = spawn('node', [tsxPath, srcPath], {
11
23
  stdio: 'inherit',
12
24
  env: process.env,
13
25
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-claude-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP server that lets Claude message you on Telegram",
5
5
  "author": "Geravant",
6
6
  "license": "MIT",