@baitong-dev/bash-mcp 0.0.2

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/bash.txt ADDED
@@ -0,0 +1,118 @@
1
+ Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
2
+
3
+ All commands run in ${directory} by default. Use the `cwd` parameter if you need to run a command in a different directory. AVOID using `cd <directory> && <command>` patterns - use `cwd` instead.
4
+
5
+ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
6
+
7
+ Before executing the command, please follow these steps:
8
+
9
+ 1. Directory Verification:
10
+ - If the command will create new directories or files, first use `ls` to verify the parent directory exists and is the correct location
11
+ - For example, before running "mkdir foo/bar", first use `ls foo` to check that "foo" exists and is the intended parent directory
12
+
13
+ 2. Command Execution:
14
+ - Always quote file paths that contain spaces with double quotes (e.g., rm "path with spaces/file.txt")
15
+ - Examples of proper quoting:
16
+ - mkdir "/Users/name/My Documents" (correct)
17
+ - mkdir /Users/name/My Documents (incorrect - will fail)
18
+ - python "/path/with spaces/script.py" (correct)
19
+ - python /path/with spaces/script.py (incorrect - will fail)
20
+ - After ensuring proper quoting, execute the command.
21
+ - Capture the output of the command.
22
+
23
+ Usage notes:
24
+ - The command argument is required.
25
+ - You can specify an optional timeout in milliseconds. If not specified, commands will time out after 120000ms (2 minutes).
26
+ - It is very helpful if you write a clear, concise description of what this command does in 5-10 words.
27
+ - If the output exceeds ${maxLines} lines or ${maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Because of this, you do NOT need to use `head`, `tail`, or other truncation commands to limit output - just run the command directly.
28
+
29
+ - Avoid using Bash with the `find`, `grep`, `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
30
+ - File search: Use Glob (NOT find or ls)
31
+ - Content search: Use Grep (NOT grep or rg)
32
+ - Read files: Use Read (NOT cat/head/tail)
33
+ - Edit files: Use Edit (NOT sed/awk)
34
+ - Write files: Use Write (NOT echo >/cat <<EOF)
35
+ - Communication: Output text directly (NOT echo/printf)
36
+
37
+ - When issuing multiple commands:
38
+ - If the commands are independent and can run in parallel, make multiple Bash tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two Bash tool calls in parallel.
39
+ - If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead.
40
+ - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
41
+ - DO NOT use newlines to separate commands (newlines are ok in quoted strings)
42
+
43
+ - AVOID using `cd <directory> && <command>`. Use the `cwd` parameter to change directories instead.
44
+ <good-example>
45
+ Use cwd="/foo/bar" with command: pytest tests
46
+ </good-example>
47
+ <bad-example>
48
+ cd /foo/bar && pytest tests
49
+ </bad-example>
50
+
51
+
52
+ # Committing changes with git
53
+
54
+ Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:
55
+
56
+ Git Safety Protocol:
57
+ - NEVER update the git config
58
+ - NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
59
+ - NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
60
+ - NEVER run force push to main/master, warn the user if they request it
61
+ - Avoid git commit --amend. ONLY use --amend when ALL conditions are met:
62
+ (1) User explicitly requested amend, OR commit SUCCEEDED but pre-commit hook auto-modified files that need including
63
+ (2) HEAD commit was created by you in this conversation (verify: git log -1 --format='%an %ae')
64
+ (3) Commit has NOT been pushed to remote (verify: git status shows "Your branch is ahead")
65
+ - CRITICAL: If commit FAILED or was REJECTED by hook, NEVER amend - fix the issue and create a NEW commit
66
+ - CRITICAL: If you already pushed to remote, NEVER amend unless user explicitly requests it (requires force push)
67
+ - NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
68
+
69
+ 1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the Bash tool:
70
+ - Run a git status command to see all untracked files.
71
+ - Run a git diff command to see both staged and unstaged changes that will be committed.
72
+ - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
73
+ 2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
74
+ - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).
75
+ - Do not commit files that likely contain secrets (.env, credentials.json, etc.). Warn the user if they specifically request to commit those files
76
+ - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
77
+ - Ensure it accurately reflects the changes and their purpose
78
+ 3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:
79
+ - Add relevant untracked files to the staging area.
80
+ - Create the commit with a message
81
+ - Run git status after the commit completes to verify success.
82
+ Note: git status depends on the commit completing, so run it sequentially after the commit.
83
+ 4. If the commit fails due to pre-commit hook, fix the issue and create a NEW commit (see amend rules above)
84
+
85
+ Important notes:
86
+ - NEVER run additional commands to read or explore code, besides git bash commands
87
+ - NEVER use the TodoWrite or Task tools
88
+ - DO NOT push to the remote repository unless the user explicitly asks you to do so
89
+ - IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.
90
+ - If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
91
+
92
+ # Creating pull requests
93
+ Use the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a GitHub URL use the gh command to get the information needed.
94
+
95
+ IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
96
+
97
+ 1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the Bash tool, in order to understand the current state of the branch since it diverged from the main branch:
98
+ - Run a git status command to see all untracked files
99
+ - Run a git diff command to see both staged and unstaged changes that will be committed
100
+ - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote
101
+ - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)
102
+ 2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request summary
103
+ 3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:
104
+ - Create new branch if needed
105
+ - Push to remote with -u flag if needed
106
+ - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
107
+ <example>
108
+ gh pr create --title "the pr title" --body "$(cat <<'EOF'
109
+ ## Summary
110
+ <1-3 bullet points>
111
+ </example>
112
+
113
+ Important:
114
+ - DO NOT use the TodoWrite or Task tools
115
+ - Return the PR URL when you're done, so the user can see it
116
+
117
+ # Other common operations
118
+ - View comments on a GitHub PR: gh api repos/foo/bar/pulls/123/comments
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,349 @@
1
+ #!/usr/bin/env bun
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ /**
8
+ * Bash MCP Server v1.0
9
+ */
10
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
11
+ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
12
+ const path_1 = __importDefault(require("path"));
13
+ const zod_1 = __importDefault(require("zod"));
14
+ const web_tree_sitter_1 = require("web-tree-sitter");
15
+ // @ts-ignore wasm
16
+ const web_tree_sitter_wasm_1 = __importDefault(require("web-tree-sitter/web-tree-sitter.wasm"));
17
+ // @ts-ignore wasm
18
+ const tree_sitter_bash_wasm_1 = __importDefault(require("tree-sitter-bash/tree-sitter-bash.wasm"));
19
+ const child_process_1 = require("child_process");
20
+ const bash_txt_1 = __importDefault(require("../bash.txt"));
21
+ const mcp_helpers_1 = require("@baitong-dev/mcp-helpers");
22
+ const MCP_NAME = 'Bash MCP';
23
+ const MCP_VERSION = '0.0.1';
24
+ const parser = (0, mcp_helpers_1.lazy)(async () => {
25
+ const treePath = (0, mcp_helpers_1.resolveWasm)(web_tree_sitter_wasm_1.default);
26
+ await web_tree_sitter_1.Parser.init({
27
+ locateFile() {
28
+ return treePath;
29
+ }
30
+ });
31
+ const bashPath = (0, mcp_helpers_1.resolveWasm)(tree_sitter_bash_wasm_1.default);
32
+ const bashLanguage = await web_tree_sitter_1.Language.load(bashPath);
33
+ const p = new web_tree_sitter_1.Parser();
34
+ p.setLanguage(bashLanguage);
35
+ return p;
36
+ });
37
+ /**
38
+ * Get the path to the bash executable
39
+ * @returns The path to the bash executable
40
+ */
41
+ const getBashPath = (0, mcp_helpers_1.lazy)(() => {
42
+ const shell = process.env.SHELL;
43
+ if (shell)
44
+ return shell;
45
+ // Fallback: check common Git Bash paths directly
46
+ if (process.platform === 'win32') {
47
+ const bash = (0, mcp_helpers_1.findGitBash)((0, mcp_helpers_1.getBundledBinaryPath)('bash'));
48
+ if (bash)
49
+ return bash;
50
+ throw new Error('Git Bash not found');
51
+ // return process.env.COMSPEC || "cmd.exe"
52
+ }
53
+ if (process.platform === 'darwin')
54
+ return '/bin/zsh';
55
+ const bash = Bun.which('bash');
56
+ if (bash)
57
+ return bash;
58
+ return '/bin/sh';
59
+ });
60
+ const server = new mcp_js_1.McpServer({
61
+ name: MCP_NAME,
62
+ version: MCP_VERSION
63
+ }, {
64
+ capabilities: {
65
+ logging: {}
66
+ }
67
+ });
68
+ // =============================================================================
69
+ // Constants
70
+ // =============================================================================
71
+ // Default working directory
72
+ const DEFAULT_CWD = path_1.default.join(mcp_helpers_1.MCP_HOME_DIR, 'workspace');
73
+ // Grace period before SIGKILL (ms)
74
+ const SIGKILL_TIMEOUT_MS = 5000;
75
+ // Reserved characters for truncation ellipsis
76
+ const TRUNCATION_ELLIPSIS_RESERVE = 50;
77
+ // Exit code for timeout (shell convention)
78
+ const EXIT_CODE_TIMEOUT = 124;
79
+ // Sudo rejection message
80
+ const SUDO_REJECTION_MESSAGE = '[REJECTED] sudo commands cannot be executed. Please STOP and ask human user to run it for you!\n';
81
+ // Default max_output
82
+ const DEFAULT_MAX_OUTPUT = 30000;
83
+ const DEFAULT_TIMEOUT_MS = 2 * 60 * 1000;
84
+ // Environment variables that cannot be overridden (hardened mode only)
85
+ const PROTECTED_ENV_VARS = new Set([
86
+ 'LD_PRELOAD',
87
+ 'LD_LIBRARY_PATH',
88
+ 'DYLD_INSERT_LIBRARIES',
89
+ 'DYLD_LIBRARY_PATH'
90
+ ]);
91
+ /**
92
+ * Check if a command contains sudo
93
+ * Matches: sudo at start, after semicolon, after &&, after ||, after |, after $(, after backtick
94
+ */
95
+ function containsSudo(command) {
96
+ // Match sudo as a standalone command (not part of another word like "pseudocode")
97
+ return /(?:^|[;&|`$()]\s*)sudo(?:\s|$)/m.test(command);
98
+ }
99
+ /**
100
+ * Filter out protected environment variables that could be used for injection.
101
+ * Only active in hardened mode. Passes everything through when hardened mode is off.
102
+ */
103
+ function filterEnvVars(env) {
104
+ if (!env)
105
+ return { filtered: undefined, rejected: [] };
106
+ const rejected = [];
107
+ const filtered = {};
108
+ for (const [key, value] of Object.entries(env)) {
109
+ if (PROTECTED_ENV_VARS.has(key.toUpperCase())) {
110
+ rejected.push(key);
111
+ }
112
+ else {
113
+ filtered[key] = value;
114
+ }
115
+ }
116
+ return { filtered: Object.keys(filtered).length > 0 ? filtered : undefined, rejected };
117
+ }
118
+ /**
119
+ * Middle-truncate output to preserve beginning and end
120
+ */
121
+ function middleTruncate(text, maxLength) {
122
+ if (text.length <= maxLength)
123
+ return text;
124
+ const halfLength = Math.floor((maxLength - TRUNCATION_ELLIPSIS_RESERVE) / 2);
125
+ const start = text.slice(0, halfLength);
126
+ const end = text.slice(-halfLength);
127
+ const truncatedBytes = text.length - maxLength;
128
+ return `${start}\n\n... [truncated ${truncatedBytes} characters] ...\n\n${end}`;
129
+ }
130
+ // =============================================================================
131
+ // Tool Definitions
132
+ // =============================================================================
133
+ const bashInputSchema = zod_1.default.object({
134
+ command: zod_1.default.string().min(1).describe('The command to execute'),
135
+ cwd: zod_1.default
136
+ .string()
137
+ .optional()
138
+ .describe(`The working directory to run the command in. Must be in ${DEFAULT_CWD}. Defaults to ${DEFAULT_CWD}. Use this instead of 'cd' commands.`), // 需要在DEFAULT_CWD下
139
+ timeout: zod_1.default
140
+ .number()
141
+ .min(1)
142
+ .max(600000)
143
+ .optional()
144
+ .describe(`Timeout in milliseconds (optional, default ${DEFAULT_TIMEOUT_MS}, max 600000)`),
145
+ description: zod_1.default
146
+ .string()
147
+ .optional()
148
+ .describe('Clear, concise description of what this command does in 5-10 words. Examples:\nInput: ls\nOutput: Lists files in current directory\n\nInput: git status\nOutput: Shows working tree status\n\nInput: npm install\nOutput: Installs package dependencies\n\nInput: mkdir foo\nOutput: Creates directory "foo"'),
149
+ env: zod_1.default
150
+ .record(zod_1.default.string(), zod_1.default.string())
151
+ .optional()
152
+ .describe('Additional environment variables to set'),
153
+ maxOutput: zod_1.default
154
+ .number()
155
+ .min(1)
156
+ .max(1000000)
157
+ .optional()
158
+ .describe(`Maximum output length before middle-truncation (default ${DEFAULT_MAX_OUTPUT})`)
159
+ });
160
+ async function killTree(proc, opts) {
161
+ const pid = proc.pid;
162
+ if (!pid || opts?.exited?.())
163
+ return;
164
+ if (process.platform === 'win32') {
165
+ await new Promise(resolve => {
166
+ const killer = (0, child_process_1.spawn)('taskkill', ['/pid', String(pid), '/f', '/t'], { stdio: 'ignore' });
167
+ killer.once('exit', () => resolve());
168
+ killer.once('error', () => resolve());
169
+ });
170
+ return;
171
+ }
172
+ try {
173
+ process.kill(-pid, 'SIGTERM');
174
+ await Bun.sleep(SIGKILL_TIMEOUT_MS);
175
+ if (!opts?.exited?.()) {
176
+ process.kill(-pid, 'SIGKILL');
177
+ }
178
+ }
179
+ catch (_e) {
180
+ proc.kill('SIGTERM');
181
+ await Bun.sleep(SIGKILL_TIMEOUT_MS);
182
+ if (!opts?.exited?.()) {
183
+ proc.kill('SIGKILL');
184
+ }
185
+ }
186
+ }
187
+ /**
188
+ * Execute a bash command and return result
189
+ */
190
+ async function executeBash(options) {
191
+ const command = options.command.trim();
192
+ const cwd = options.cwd || DEFAULT_CWD;
193
+ const timeout = options.timeout || DEFAULT_TIMEOUT_MS;
194
+ const maxOutput = options.maxOutput || DEFAULT_MAX_OUTPUT;
195
+ const { filtered: safeEnv, rejected: rejectedVars } = filterEnvVars(options.env);
196
+ if (containsSudo(command)) {
197
+ throw Error(`${SUDO_REJECTION_MESSAGE}$ ${command}`);
198
+ }
199
+ if (!(0, mcp_helpers_1.isSubdirectory)(DEFAULT_CWD, cwd, {
200
+ includeSelf: true
201
+ })) {
202
+ throw Error(`"${cwd}" must be in ${DEFAULT_CWD}`);
203
+ }
204
+ if (!(await (0, mcp_helpers_1.isDir)(cwd))) {
205
+ throw Error(`"${cwd}" must be a directory`);
206
+ }
207
+ const tree = await parser().then(p => p.parse(command));
208
+ if (!tree) {
209
+ throw new Error('Failed to parse command');
210
+ }
211
+ const directories = new Set();
212
+ // if (!Instance.containsPath(cwd)) directories.add(cwd)
213
+ const patterns = new Set();
214
+ // const always = new Set<string>()
215
+ let output = '';
216
+ for (const node of tree.rootNode.descendantsOfType('command')) {
217
+ if (!node)
218
+ continue;
219
+ // Get full command text including redirects if present
220
+ let commandText = node.parent?.type === 'redirected_statement' ? node.parent.text : node.text;
221
+ const commands = [];
222
+ for (let i = 0; i < node.childCount; i++) {
223
+ const child = node.child(i);
224
+ if (!child)
225
+ continue;
226
+ if (child.type !== 'command_name' &&
227
+ child.type !== 'word' &&
228
+ child.type !== 'string' &&
229
+ child.type !== 'raw_string' &&
230
+ child.type !== 'concatenation') {
231
+ continue;
232
+ }
233
+ commands.push(child.text);
234
+ }
235
+ // not an exhaustive list, but covers most common cases
236
+ if (['cd', 'rm', 'cp', 'mv', 'mkdir', 'touch', 'chmod', 'chown', 'cat'].includes(commands[0])) {
237
+ for (const arg of commands.slice(1)) {
238
+ if (arg.startsWith('-') || (commands[0] === 'chmod' && arg.startsWith('+'))) {
239
+ continue;
240
+ }
241
+ const resolved = await Bun.$ `realpath ${arg}`
242
+ .cwd(cwd)
243
+ .quiet()
244
+ .nothrow()
245
+ .text()
246
+ .then(x => x.trim());
247
+ if (resolved) {
248
+ // Git Bash on Windows returns Unix-style paths like /c/Users/...
249
+ const normalized = process.platform === 'win32' && resolved.match(/^\/[a-z]\//)
250
+ ? (0, mcp_helpers_1.gitBashToWindowsPath)(resolved)
251
+ : resolved;
252
+ if (!(0, mcp_helpers_1.isSubdirectory)(DEFAULT_CWD, normalized, { includeSelf: true })) {
253
+ const dir = (await (0, mcp_helpers_1.isDir)(normalized)) ? normalized : path_1.default.dirname(normalized);
254
+ directories.add(dir);
255
+ }
256
+ }
257
+ }
258
+ }
259
+ else {
260
+ }
261
+ // cd covered by above check
262
+ if (commands.length && commands[0] !== 'cd') {
263
+ patterns.add(commandText);
264
+ // always.add(BashArity.prefix(command).join(' ') + ' *')
265
+ }
266
+ }
267
+ const mergedEnv = {
268
+ ...process.env,
269
+ ...safeEnv,
270
+ ...(0, mcp_helpers_1.getBinaryEnvs)()
271
+ };
272
+ const proc = (0, child_process_1.spawn)(command, {
273
+ shell: getBashPath(),
274
+ cwd,
275
+ env: {
276
+ ...mergedEnv
277
+ },
278
+ stdio: ['ignore', 'pipe', 'pipe'],
279
+ detached: process.platform !== 'win32'
280
+ });
281
+ const append = (chunk) => {
282
+ output += chunk.toString();
283
+ };
284
+ proc.stdout?.on('data', append);
285
+ proc.stderr?.on('data', append);
286
+ let timedOut = false;
287
+ let exited = false;
288
+ const kill = () => killTree(proc, { exited: () => exited });
289
+ const timeoutTimer = setTimeout(() => {
290
+ timedOut = true;
291
+ void kill();
292
+ }, timeout + 100);
293
+ await new Promise((resolve, reject) => {
294
+ const cleanup = () => {
295
+ clearTimeout(timeoutTimer);
296
+ };
297
+ proc.once('exit', () => {
298
+ exited = true;
299
+ cleanup();
300
+ resolve();
301
+ });
302
+ proc.once('error', error => {
303
+ exited = true;
304
+ cleanup();
305
+ reject(error);
306
+ });
307
+ });
308
+ const resultMetadata = [];
309
+ if (timedOut) {
310
+ resultMetadata.push(`bash tool terminated command after exceeding timeout ${timeout} ms`);
311
+ }
312
+ if (rejectedVars.length > 0) {
313
+ resultMetadata.push(`bash tool blocked env vars: ${rejectedVars.join(', ')}`);
314
+ }
315
+ if (resultMetadata.length > 0) {
316
+ output += '\n\n<bash_metadata>\n' + resultMetadata.join('\n') + '\n</bash_metadata>';
317
+ }
318
+ return {
319
+ output: middleTruncate(output, maxOutput),
320
+ exitCode: proc.exitCode,
321
+ description: options.description
322
+ };
323
+ }
324
+ server.registerTool('bash', {
325
+ description: bash_txt_1.default.replaceAll('${directory}', DEFAULT_CWD)
326
+ .replaceAll('${maxLines}', String(2000))
327
+ .replaceAll('${maxBytes}', String(50 * 1024)),
328
+ inputSchema: bashInputSchema
329
+ }, async (args) => {
330
+ try {
331
+ const result = await executeBash({ ...args });
332
+ return {
333
+ content: [{ type: 'text', text: JSON.stringify(result) }],
334
+ structuredContent: result
335
+ };
336
+ }
337
+ catch (error) {
338
+ return {
339
+ isError: true,
340
+ content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }]
341
+ };
342
+ }
343
+ });
344
+ // =============================================================================
345
+ // Start Server
346
+ // =============================================================================
347
+ const transport = new stdio_js_1.StdioServerTransport();
348
+ server.connect(transport);
349
+ console.error(`${MCP_NAME} Server v${MCP_VERSION} running`);
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@baitong-dev/bash-mcp",
3
+ "version": "0.0.2",
4
+ "main": "./dist/index.js",
5
+ "bin": {
6
+ "@baitong-dev/bash-mcp": "./dist/index.js"
7
+ },
8
+ "files": [
9
+ "dist",
10
+ "bash.txt",
11
+ "README.md"
12
+ ],
13
+ "keywords": [
14
+ "mcp",
15
+ "bash"
16
+ ],
17
+ "description": "bash-mcp",
18
+ "dependencies": {
19
+ "@modelcontextprotocol/sdk": "^1.25.1",
20
+ "tree-sitter-bash": "^0.25.1",
21
+ "web-tree-sitter": "^0.26.5",
22
+ "zod": "^4.3.4",
23
+ "@baitong-dev/mcp-helpers": "0.0.1"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "registry": "https://registry.npmjs.org"
28
+ },
29
+ "scripts": {
30
+ "tsc": "tsc ./src/index.ts --declaration --module commonjs --target es2021 --esModuleInterop --outDir ./dist"
31
+ }
32
+ }