├── .gitattributes ├── .gitignore ├── .prettierrc ├── LICENSE.md ├── README.md ├── package-lock.json ├── package.json ├── src ├── config.ts └── index.ts └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "tabWidth": 2, 5 | "printWidth": 100 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2024 Ishmail Inc. dba High Dimensional Research 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shell MCP Server 2 | 3 | A Node.js implementation of the Model Context Protocol (MCP) that provides secure shell command execution capabilities. This server allows AI models to execute shell commands in a controlled environment with built-in security measures. Easily integrates with [Claude Desktop](https://claude.ai/download) for connecting Claude with your shell. 4 | 5 | ## Features 6 | 7 | - MCP-compliant server implementation 8 | - Secure command execution with blacklist protection 9 | - Command existence validation 10 | - Standard I/O based transport 11 | - Error handling and graceful shutdown 12 | 13 | ## Installation 14 | 15 | Run `npx mcp-shell`. 16 | 17 | To add it to Claude Desktop, run `npx mcp-shell config`. Or add `npx -y mcp-shell` to your config manually. 18 | 19 | Start (or restart) [Claude Desktop](https://claude.ai/download) and you should see the MCP tool listed on the landing page. 20 | 21 | ## Security Features 22 | 23 | The server implements several security measures: 24 | 25 | 1. Command Blacklisting 26 | 27 | - Prevents execution of dangerous system commands 28 | - Blocks access to critical system modifications 29 | - Protects against file system destruction 30 | - Prevents privilege escalation 31 | 32 | 2. Command Validation 33 | - Verifies command existence before execution 34 | - Validates against the blacklist 35 | - Returns clear error messages for invalid commands 36 | 37 | ## Available Tools 38 | 39 | The server provides one tool: 40 | 41 | ### run_command 42 | 43 | Executes a shell command and returns its output. 44 | 45 | **Input Schema:** 46 | 47 | ```json 48 | { 49 | "type": "object", 50 | "properties": { 51 | "command": { "type": "string" } 52 | } 53 | } 54 | ``` 55 | 56 | **Response:** 57 | 58 | - Success: Command output as plain text 59 | - Error: Error message as plain text 60 | 61 | ## Blacklisted Commands 62 | 63 | The following command categories are blocked for security: 64 | 65 | - File System Destruction Commands (rm, rmdir, del) 66 | - Disk/Filesystem Commands (format, mkfs, dd) 67 | - Permission/Ownership Commands (chmod, chown) 68 | - Privilege Escalation Commands (sudo, su) 69 | - Code Execution Commands (exec, eval) 70 | - System Communication Commands (write, wall) 71 | - System Control Commands (shutdown, reboot, init) 72 | 73 | ## Error Handling 74 | 75 | The server includes comprehensive error handling: 76 | 77 | - Command not found errors 78 | - Blacklisted command errors 79 | - Execution errors 80 | - MCP protocol errors 81 | - Graceful shutdown on SIGINT 82 | 83 | ## Implementation Details 84 | 85 | The server is built using: 86 | 87 | - Model Context Protocol SDK 88 | - StdioServerTransport for communication 89 | - execa for command execution 90 | - command-exists for command validation 91 | 92 | ## Development 93 | 94 | To modify the security settings, you can: 95 | 96 | 1. Edit the `BLACKLISTED_COMMANDS` set to adjust blocked commands 97 | 2. Modify the `validateCommand` function to add additional validation rules 98 | 3. Enhance the command parsing logic in the `CallToolRequestSchema` handler 99 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcp-shell", 3 | "version": "0.0.2", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "mcp-shell", 9 | "version": "0.0.2", 10 | "license": "SEE LICENSE IN LICENSE.md", 11 | "dependencies": { 12 | "@modelcontextprotocol/sdk": "^0.6.0", 13 | "@types/command-exists": "^1.2.3", 14 | "command-exists": "^1.2.9", 15 | "execa": "^9.5.1" 16 | }, 17 | "bin": { 18 | "mcp-shell": "build/index.js" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^20.11.24", 22 | "husky": "^9.1.7", 23 | "lint-staged": "^15.2.10", 24 | "typescript": "^5.3.3" 25 | } 26 | }, 27 | "node_modules/@modelcontextprotocol/sdk": { 28 | "version": "0.6.0", 29 | "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-0.6.0.tgz", 30 | "integrity": "sha512-9rsDudGhDtMbvxohPoMMyAUOmEzQsOK+XFchh6gZGqo8sx9sBuZQs+CUttXqa8RZXKDaJRCN2tUtgGof7jRkkw==", 31 | "dependencies": { 32 | "content-type": "^1.0.5", 33 | "raw-body": "^3.0.0", 34 | "zod": "^3.23.8" 35 | } 36 | }, 37 | "node_modules/@sec-ant/readable-stream": { 38 | "version": "0.4.1", 39 | "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", 40 | "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==" 41 | }, 42 | "node_modules/@sindresorhus/merge-streams": { 43 | "version": "4.0.0", 44 | "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", 45 | "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", 46 | "engines": { 47 | "node": ">=18" 48 | }, 49 | "funding": { 50 | "url": "https://github.com/sponsors/sindresorhus" 51 | } 52 | }, 53 | "node_modules/@types/command-exists": { 54 | "version": "1.2.3", 55 | "resolved": "https://registry.npmjs.org/@types/command-exists/-/command-exists-1.2.3.tgz", 56 | "integrity": "sha512-PpbaE2XWLaWYboXD6k70TcXO/OdOyyRFq5TVpmlUELNxdkkmXU9fkImNosmXU1DtsNrqdUgWd/nJQYXgwmtdXQ==" 57 | }, 58 | "node_modules/@types/node": { 59 | "version": "20.11.24", 60 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", 61 | "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", 62 | "dev": true, 63 | "dependencies": { 64 | "undici-types": "~5.26.4" 65 | } 66 | }, 67 | "node_modules/ansi-escapes": { 68 | "version": "7.0.0", 69 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", 70 | "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", 71 | "dev": true, 72 | "dependencies": { 73 | "environment": "^1.0.0" 74 | }, 75 | "engines": { 76 | "node": ">=18" 77 | }, 78 | "funding": { 79 | "url": "https://github.com/sponsors/sindresorhus" 80 | } 81 | }, 82 | "node_modules/ansi-regex": { 83 | "version": "6.1.0", 84 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 85 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 86 | "dev": true, 87 | "engines": { 88 | "node": ">=12" 89 | }, 90 | "funding": { 91 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 92 | } 93 | }, 94 | "node_modules/ansi-styles": { 95 | "version": "6.2.1", 96 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", 97 | "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", 98 | "dev": true, 99 | "engines": { 100 | "node": ">=12" 101 | }, 102 | "funding": { 103 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 104 | } 105 | }, 106 | "node_modules/braces": { 107 | "version": "3.0.3", 108 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", 109 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", 110 | "dev": true, 111 | "dependencies": { 112 | "fill-range": "^7.1.1" 113 | }, 114 | "engines": { 115 | "node": ">=8" 116 | } 117 | }, 118 | "node_modules/bytes": { 119 | "version": "3.1.2", 120 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 121 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 122 | "engines": { 123 | "node": ">= 0.8" 124 | } 125 | }, 126 | "node_modules/chalk": { 127 | "version": "5.3.0", 128 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", 129 | "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", 130 | "dev": true, 131 | "engines": { 132 | "node": "^12.17.0 || ^14.13 || >=16.0.0" 133 | }, 134 | "funding": { 135 | "url": "https://github.com/chalk/chalk?sponsor=1" 136 | } 137 | }, 138 | "node_modules/cli-cursor": { 139 | "version": "5.0.0", 140 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", 141 | "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", 142 | "dev": true, 143 | "dependencies": { 144 | "restore-cursor": "^5.0.0" 145 | }, 146 | "engines": { 147 | "node": ">=18" 148 | }, 149 | "funding": { 150 | "url": "https://github.com/sponsors/sindresorhus" 151 | } 152 | }, 153 | "node_modules/cli-truncate": { 154 | "version": "4.0.0", 155 | "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", 156 | "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", 157 | "dev": true, 158 | "dependencies": { 159 | "slice-ansi": "^5.0.0", 160 | "string-width": "^7.0.0" 161 | }, 162 | "engines": { 163 | "node": ">=18" 164 | }, 165 | "funding": { 166 | "url": "https://github.com/sponsors/sindresorhus" 167 | } 168 | }, 169 | "node_modules/colorette": { 170 | "version": "2.0.20", 171 | "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", 172 | "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", 173 | "dev": true 174 | }, 175 | "node_modules/command-exists": { 176 | "version": "1.2.9", 177 | "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", 178 | "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" 179 | }, 180 | "node_modules/commander": { 181 | "version": "12.1.0", 182 | "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", 183 | "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", 184 | "dev": true, 185 | "engines": { 186 | "node": ">=18" 187 | } 188 | }, 189 | "node_modules/content-type": { 190 | "version": "1.0.5", 191 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 192 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 193 | "engines": { 194 | "node": ">= 0.6" 195 | } 196 | }, 197 | "node_modules/cross-spawn": { 198 | "version": "7.0.6", 199 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 200 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 201 | "dependencies": { 202 | "path-key": "^3.1.0", 203 | "shebang-command": "^2.0.0", 204 | "which": "^2.0.1" 205 | }, 206 | "engines": { 207 | "node": ">= 8" 208 | } 209 | }, 210 | "node_modules/debug": { 211 | "version": "4.3.7", 212 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", 213 | "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", 214 | "dev": true, 215 | "dependencies": { 216 | "ms": "^2.1.3" 217 | }, 218 | "engines": { 219 | "node": ">=6.0" 220 | }, 221 | "peerDependenciesMeta": { 222 | "supports-color": { 223 | "optional": true 224 | } 225 | } 226 | }, 227 | "node_modules/depd": { 228 | "version": "2.0.0", 229 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 230 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 231 | "engines": { 232 | "node": ">= 0.8" 233 | } 234 | }, 235 | "node_modules/emoji-regex": { 236 | "version": "10.4.0", 237 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", 238 | "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", 239 | "dev": true 240 | }, 241 | "node_modules/environment": { 242 | "version": "1.1.0", 243 | "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", 244 | "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", 245 | "dev": true, 246 | "engines": { 247 | "node": ">=18" 248 | }, 249 | "funding": { 250 | "url": "https://github.com/sponsors/sindresorhus" 251 | } 252 | }, 253 | "node_modules/eventemitter3": { 254 | "version": "5.0.1", 255 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", 256 | "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", 257 | "dev": true 258 | }, 259 | "node_modules/execa": { 260 | "version": "9.5.1", 261 | "resolved": "https://registry.npmjs.org/execa/-/execa-9.5.1.tgz", 262 | "integrity": "sha512-QY5PPtSonnGwhhHDNI7+3RvY285c7iuJFFB+lU+oEzMY/gEGJ808owqJsrr8Otd1E/x07po1LkUBmdAc5duPAg==", 263 | "dependencies": { 264 | "@sindresorhus/merge-streams": "^4.0.0", 265 | "cross-spawn": "^7.0.3", 266 | "figures": "^6.1.0", 267 | "get-stream": "^9.0.0", 268 | "human-signals": "^8.0.0", 269 | "is-plain-obj": "^4.1.0", 270 | "is-stream": "^4.0.1", 271 | "npm-run-path": "^6.0.0", 272 | "pretty-ms": "^9.0.0", 273 | "signal-exit": "^4.1.0", 274 | "strip-final-newline": "^4.0.0", 275 | "yoctocolors": "^2.0.0" 276 | }, 277 | "engines": { 278 | "node": "^18.19.0 || >=20.5.0" 279 | }, 280 | "funding": { 281 | "url": "https://github.com/sindresorhus/execa?sponsor=1" 282 | } 283 | }, 284 | "node_modules/figures": { 285 | "version": "6.1.0", 286 | "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", 287 | "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", 288 | "dependencies": { 289 | "is-unicode-supported": "^2.0.0" 290 | }, 291 | "engines": { 292 | "node": ">=18" 293 | }, 294 | "funding": { 295 | "url": "https://github.com/sponsors/sindresorhus" 296 | } 297 | }, 298 | "node_modules/fill-range": { 299 | "version": "7.1.1", 300 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", 301 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", 302 | "dev": true, 303 | "dependencies": { 304 | "to-regex-range": "^5.0.1" 305 | }, 306 | "engines": { 307 | "node": ">=8" 308 | } 309 | }, 310 | "node_modules/get-east-asian-width": { 311 | "version": "1.3.0", 312 | "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", 313 | "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", 314 | "dev": true, 315 | "engines": { 316 | "node": ">=18" 317 | }, 318 | "funding": { 319 | "url": "https://github.com/sponsors/sindresorhus" 320 | } 321 | }, 322 | "node_modules/get-stream": { 323 | "version": "9.0.1", 324 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", 325 | "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", 326 | "dependencies": { 327 | "@sec-ant/readable-stream": "^0.4.1", 328 | "is-stream": "^4.0.1" 329 | }, 330 | "engines": { 331 | "node": ">=18" 332 | }, 333 | "funding": { 334 | "url": "https://github.com/sponsors/sindresorhus" 335 | } 336 | }, 337 | "node_modules/http-errors": { 338 | "version": "2.0.0", 339 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 340 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 341 | "dependencies": { 342 | "depd": "2.0.0", 343 | "inherits": "2.0.4", 344 | "setprototypeof": "1.2.0", 345 | "statuses": "2.0.1", 346 | "toidentifier": "1.0.1" 347 | }, 348 | "engines": { 349 | "node": ">= 0.8" 350 | } 351 | }, 352 | "node_modules/human-signals": { 353 | "version": "8.0.0", 354 | "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz", 355 | "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==", 356 | "engines": { 357 | "node": ">=18.18.0" 358 | } 359 | }, 360 | "node_modules/husky": { 361 | "version": "9.1.7", 362 | "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", 363 | "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", 364 | "dev": true, 365 | "bin": { 366 | "husky": "bin.js" 367 | }, 368 | "engines": { 369 | "node": ">=18" 370 | }, 371 | "funding": { 372 | "url": "https://github.com/sponsors/typicode" 373 | } 374 | }, 375 | "node_modules/iconv-lite": { 376 | "version": "0.6.3", 377 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 378 | "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 379 | "dependencies": { 380 | "safer-buffer": ">= 2.1.2 < 3.0.0" 381 | }, 382 | "engines": { 383 | "node": ">=0.10.0" 384 | } 385 | }, 386 | "node_modules/inherits": { 387 | "version": "2.0.4", 388 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 389 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 390 | }, 391 | "node_modules/is-fullwidth-code-point": { 392 | "version": "4.0.0", 393 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", 394 | "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", 395 | "dev": true, 396 | "engines": { 397 | "node": ">=12" 398 | }, 399 | "funding": { 400 | "url": "https://github.com/sponsors/sindresorhus" 401 | } 402 | }, 403 | "node_modules/is-number": { 404 | "version": "7.0.0", 405 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 406 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 407 | "dev": true, 408 | "engines": { 409 | "node": ">=0.12.0" 410 | } 411 | }, 412 | "node_modules/is-plain-obj": { 413 | "version": "4.1.0", 414 | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", 415 | "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", 416 | "engines": { 417 | "node": ">=12" 418 | }, 419 | "funding": { 420 | "url": "https://github.com/sponsors/sindresorhus" 421 | } 422 | }, 423 | "node_modules/is-stream": { 424 | "version": "4.0.1", 425 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", 426 | "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", 427 | "engines": { 428 | "node": ">=18" 429 | }, 430 | "funding": { 431 | "url": "https://github.com/sponsors/sindresorhus" 432 | } 433 | }, 434 | "node_modules/is-unicode-supported": { 435 | "version": "2.1.0", 436 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", 437 | "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", 438 | "engines": { 439 | "node": ">=18" 440 | }, 441 | "funding": { 442 | "url": "https://github.com/sponsors/sindresorhus" 443 | } 444 | }, 445 | "node_modules/isexe": { 446 | "version": "2.0.0", 447 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 448 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" 449 | }, 450 | "node_modules/lilconfig": { 451 | "version": "3.1.2", 452 | "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", 453 | "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", 454 | "dev": true, 455 | "engines": { 456 | "node": ">=14" 457 | }, 458 | "funding": { 459 | "url": "https://github.com/sponsors/antonk52" 460 | } 461 | }, 462 | "node_modules/lint-staged": { 463 | "version": "15.2.10", 464 | "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.10.tgz", 465 | "integrity": "sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==", 466 | "dev": true, 467 | "dependencies": { 468 | "chalk": "~5.3.0", 469 | "commander": "~12.1.0", 470 | "debug": "~4.3.6", 471 | "execa": "~8.0.1", 472 | "lilconfig": "~3.1.2", 473 | "listr2": "~8.2.4", 474 | "micromatch": "~4.0.8", 475 | "pidtree": "~0.6.0", 476 | "string-argv": "~0.3.2", 477 | "yaml": "~2.5.0" 478 | }, 479 | "bin": { 480 | "lint-staged": "bin/lint-staged.js" 481 | }, 482 | "engines": { 483 | "node": ">=18.12.0" 484 | }, 485 | "funding": { 486 | "url": "https://opencollective.com/lint-staged" 487 | } 488 | }, 489 | "node_modules/lint-staged/node_modules/execa": { 490 | "version": "8.0.1", 491 | "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", 492 | "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", 493 | "dev": true, 494 | "dependencies": { 495 | "cross-spawn": "^7.0.3", 496 | "get-stream": "^8.0.1", 497 | "human-signals": "^5.0.0", 498 | "is-stream": "^3.0.0", 499 | "merge-stream": "^2.0.0", 500 | "npm-run-path": "^5.1.0", 501 | "onetime": "^6.0.0", 502 | "signal-exit": "^4.1.0", 503 | "strip-final-newline": "^3.0.0" 504 | }, 505 | "engines": { 506 | "node": ">=16.17" 507 | }, 508 | "funding": { 509 | "url": "https://github.com/sindresorhus/execa?sponsor=1" 510 | } 511 | }, 512 | "node_modules/lint-staged/node_modules/get-stream": { 513 | "version": "8.0.1", 514 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", 515 | "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", 516 | "dev": true, 517 | "engines": { 518 | "node": ">=16" 519 | }, 520 | "funding": { 521 | "url": "https://github.com/sponsors/sindresorhus" 522 | } 523 | }, 524 | "node_modules/lint-staged/node_modules/human-signals": { 525 | "version": "5.0.0", 526 | "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", 527 | "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", 528 | "dev": true, 529 | "engines": { 530 | "node": ">=16.17.0" 531 | } 532 | }, 533 | "node_modules/lint-staged/node_modules/is-stream": { 534 | "version": "3.0.0", 535 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", 536 | "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", 537 | "dev": true, 538 | "engines": { 539 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 540 | }, 541 | "funding": { 542 | "url": "https://github.com/sponsors/sindresorhus" 543 | } 544 | }, 545 | "node_modules/lint-staged/node_modules/npm-run-path": { 546 | "version": "5.3.0", 547 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", 548 | "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", 549 | "dev": true, 550 | "dependencies": { 551 | "path-key": "^4.0.0" 552 | }, 553 | "engines": { 554 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 555 | }, 556 | "funding": { 557 | "url": "https://github.com/sponsors/sindresorhus" 558 | } 559 | }, 560 | "node_modules/lint-staged/node_modules/onetime": { 561 | "version": "6.0.0", 562 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", 563 | "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", 564 | "dev": true, 565 | "dependencies": { 566 | "mimic-fn": "^4.0.0" 567 | }, 568 | "engines": { 569 | "node": ">=12" 570 | }, 571 | "funding": { 572 | "url": "https://github.com/sponsors/sindresorhus" 573 | } 574 | }, 575 | "node_modules/lint-staged/node_modules/path-key": { 576 | "version": "4.0.0", 577 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", 578 | "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", 579 | "dev": true, 580 | "engines": { 581 | "node": ">=12" 582 | }, 583 | "funding": { 584 | "url": "https://github.com/sponsors/sindresorhus" 585 | } 586 | }, 587 | "node_modules/lint-staged/node_modules/strip-final-newline": { 588 | "version": "3.0.0", 589 | "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", 590 | "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", 591 | "dev": true, 592 | "engines": { 593 | "node": ">=12" 594 | }, 595 | "funding": { 596 | "url": "https://github.com/sponsors/sindresorhus" 597 | } 598 | }, 599 | "node_modules/listr2": { 600 | "version": "8.2.5", 601 | "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", 602 | "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", 603 | "dev": true, 604 | "dependencies": { 605 | "cli-truncate": "^4.0.0", 606 | "colorette": "^2.0.20", 607 | "eventemitter3": "^5.0.1", 608 | "log-update": "^6.1.0", 609 | "rfdc": "^1.4.1", 610 | "wrap-ansi": "^9.0.0" 611 | }, 612 | "engines": { 613 | "node": ">=18.0.0" 614 | } 615 | }, 616 | "node_modules/log-update": { 617 | "version": "6.1.0", 618 | "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", 619 | "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", 620 | "dev": true, 621 | "dependencies": { 622 | "ansi-escapes": "^7.0.0", 623 | "cli-cursor": "^5.0.0", 624 | "slice-ansi": "^7.1.0", 625 | "strip-ansi": "^7.1.0", 626 | "wrap-ansi": "^9.0.0" 627 | }, 628 | "engines": { 629 | "node": ">=18" 630 | }, 631 | "funding": { 632 | "url": "https://github.com/sponsors/sindresorhus" 633 | } 634 | }, 635 | "node_modules/log-update/node_modules/is-fullwidth-code-point": { 636 | "version": "5.0.0", 637 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", 638 | "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", 639 | "dev": true, 640 | "dependencies": { 641 | "get-east-asian-width": "^1.0.0" 642 | }, 643 | "engines": { 644 | "node": ">=18" 645 | }, 646 | "funding": { 647 | "url": "https://github.com/sponsors/sindresorhus" 648 | } 649 | }, 650 | "node_modules/log-update/node_modules/slice-ansi": { 651 | "version": "7.1.0", 652 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", 653 | "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", 654 | "dev": true, 655 | "dependencies": { 656 | "ansi-styles": "^6.2.1", 657 | "is-fullwidth-code-point": "^5.0.0" 658 | }, 659 | "engines": { 660 | "node": ">=18" 661 | }, 662 | "funding": { 663 | "url": "https://github.com/chalk/slice-ansi?sponsor=1" 664 | } 665 | }, 666 | "node_modules/merge-stream": { 667 | "version": "2.0.0", 668 | "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", 669 | "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", 670 | "dev": true 671 | }, 672 | "node_modules/micromatch": { 673 | "version": "4.0.8", 674 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", 675 | "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", 676 | "dev": true, 677 | "dependencies": { 678 | "braces": "^3.0.3", 679 | "picomatch": "^2.3.1" 680 | }, 681 | "engines": { 682 | "node": ">=8.6" 683 | } 684 | }, 685 | "node_modules/mimic-fn": { 686 | "version": "4.0.0", 687 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", 688 | "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", 689 | "dev": true, 690 | "engines": { 691 | "node": ">=12" 692 | }, 693 | "funding": { 694 | "url": "https://github.com/sponsors/sindresorhus" 695 | } 696 | }, 697 | "node_modules/mimic-function": { 698 | "version": "5.0.1", 699 | "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", 700 | "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", 701 | "dev": true, 702 | "engines": { 703 | "node": ">=18" 704 | }, 705 | "funding": { 706 | "url": "https://github.com/sponsors/sindresorhus" 707 | } 708 | }, 709 | "node_modules/ms": { 710 | "version": "2.1.3", 711 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 712 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 713 | "dev": true 714 | }, 715 | "node_modules/npm-run-path": { 716 | "version": "6.0.0", 717 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", 718 | "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", 719 | "dependencies": { 720 | "path-key": "^4.0.0", 721 | "unicorn-magic": "^0.3.0" 722 | }, 723 | "engines": { 724 | "node": ">=18" 725 | }, 726 | "funding": { 727 | "url": "https://github.com/sponsors/sindresorhus" 728 | } 729 | }, 730 | "node_modules/npm-run-path/node_modules/path-key": { 731 | "version": "4.0.0", 732 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", 733 | "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", 734 | "engines": { 735 | "node": ">=12" 736 | }, 737 | "funding": { 738 | "url": "https://github.com/sponsors/sindresorhus" 739 | } 740 | }, 741 | "node_modules/onetime": { 742 | "version": "7.0.0", 743 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", 744 | "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", 745 | "dev": true, 746 | "dependencies": { 747 | "mimic-function": "^5.0.0" 748 | }, 749 | "engines": { 750 | "node": ">=18" 751 | }, 752 | "funding": { 753 | "url": "https://github.com/sponsors/sindresorhus" 754 | } 755 | }, 756 | "node_modules/parse-ms": { 757 | "version": "4.0.0", 758 | "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", 759 | "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", 760 | "engines": { 761 | "node": ">=18" 762 | }, 763 | "funding": { 764 | "url": "https://github.com/sponsors/sindresorhus" 765 | } 766 | }, 767 | "node_modules/path-key": { 768 | "version": "3.1.1", 769 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 770 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 771 | "engines": { 772 | "node": ">=8" 773 | } 774 | }, 775 | "node_modules/picomatch": { 776 | "version": "2.3.1", 777 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 778 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 779 | "dev": true, 780 | "engines": { 781 | "node": ">=8.6" 782 | }, 783 | "funding": { 784 | "url": "https://github.com/sponsors/jonschlinkert" 785 | } 786 | }, 787 | "node_modules/pidtree": { 788 | "version": "0.6.0", 789 | "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", 790 | "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", 791 | "dev": true, 792 | "bin": { 793 | "pidtree": "bin/pidtree.js" 794 | }, 795 | "engines": { 796 | "node": ">=0.10" 797 | } 798 | }, 799 | "node_modules/pretty-ms": { 800 | "version": "9.2.0", 801 | "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz", 802 | "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==", 803 | "dependencies": { 804 | "parse-ms": "^4.0.0" 805 | }, 806 | "engines": { 807 | "node": ">=18" 808 | }, 809 | "funding": { 810 | "url": "https://github.com/sponsors/sindresorhus" 811 | } 812 | }, 813 | "node_modules/raw-body": { 814 | "version": "3.0.0", 815 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", 816 | "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", 817 | "dependencies": { 818 | "bytes": "3.1.2", 819 | "http-errors": "2.0.0", 820 | "iconv-lite": "0.6.3", 821 | "unpipe": "1.0.0" 822 | }, 823 | "engines": { 824 | "node": ">= 0.8" 825 | } 826 | }, 827 | "node_modules/restore-cursor": { 828 | "version": "5.1.0", 829 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", 830 | "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", 831 | "dev": true, 832 | "dependencies": { 833 | "onetime": "^7.0.0", 834 | "signal-exit": "^4.1.0" 835 | }, 836 | "engines": { 837 | "node": ">=18" 838 | }, 839 | "funding": { 840 | "url": "https://github.com/sponsors/sindresorhus" 841 | } 842 | }, 843 | "node_modules/rfdc": { 844 | "version": "1.4.1", 845 | "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", 846 | "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", 847 | "dev": true 848 | }, 849 | "node_modules/safer-buffer": { 850 | "version": "2.1.2", 851 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 852 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 853 | }, 854 | "node_modules/setprototypeof": { 855 | "version": "1.2.0", 856 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 857 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 858 | }, 859 | "node_modules/shebang-command": { 860 | "version": "2.0.0", 861 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 862 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 863 | "dependencies": { 864 | "shebang-regex": "^3.0.0" 865 | }, 866 | "engines": { 867 | "node": ">=8" 868 | } 869 | }, 870 | "node_modules/shebang-regex": { 871 | "version": "3.0.0", 872 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 873 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 874 | "engines": { 875 | "node": ">=8" 876 | } 877 | }, 878 | "node_modules/signal-exit": { 879 | "version": "4.1.0", 880 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", 881 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", 882 | "engines": { 883 | "node": ">=14" 884 | }, 885 | "funding": { 886 | "url": "https://github.com/sponsors/isaacs" 887 | } 888 | }, 889 | "node_modules/slice-ansi": { 890 | "version": "5.0.0", 891 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", 892 | "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", 893 | "dev": true, 894 | "dependencies": { 895 | "ansi-styles": "^6.0.0", 896 | "is-fullwidth-code-point": "^4.0.0" 897 | }, 898 | "engines": { 899 | "node": ">=12" 900 | }, 901 | "funding": { 902 | "url": "https://github.com/chalk/slice-ansi?sponsor=1" 903 | } 904 | }, 905 | "node_modules/statuses": { 906 | "version": "2.0.1", 907 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 908 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 909 | "engines": { 910 | "node": ">= 0.8" 911 | } 912 | }, 913 | "node_modules/string-argv": { 914 | "version": "0.3.2", 915 | "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", 916 | "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", 917 | "dev": true, 918 | "engines": { 919 | "node": ">=0.6.19" 920 | } 921 | }, 922 | "node_modules/string-width": { 923 | "version": "7.2.0", 924 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", 925 | "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", 926 | "dev": true, 927 | "dependencies": { 928 | "emoji-regex": "^10.3.0", 929 | "get-east-asian-width": "^1.0.0", 930 | "strip-ansi": "^7.1.0" 931 | }, 932 | "engines": { 933 | "node": ">=18" 934 | }, 935 | "funding": { 936 | "url": "https://github.com/sponsors/sindresorhus" 937 | } 938 | }, 939 | "node_modules/strip-ansi": { 940 | "version": "7.1.0", 941 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 942 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 943 | "dev": true, 944 | "dependencies": { 945 | "ansi-regex": "^6.0.1" 946 | }, 947 | "engines": { 948 | "node": ">=12" 949 | }, 950 | "funding": { 951 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 952 | } 953 | }, 954 | "node_modules/strip-final-newline": { 955 | "version": "4.0.0", 956 | "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", 957 | "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", 958 | "engines": { 959 | "node": ">=18" 960 | }, 961 | "funding": { 962 | "url": "https://github.com/sponsors/sindresorhus" 963 | } 964 | }, 965 | "node_modules/to-regex-range": { 966 | "version": "5.0.1", 967 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 968 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 969 | "dev": true, 970 | "dependencies": { 971 | "is-number": "^7.0.0" 972 | }, 973 | "engines": { 974 | "node": ">=8.0" 975 | } 976 | }, 977 | "node_modules/toidentifier": { 978 | "version": "1.0.1", 979 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 980 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 981 | "engines": { 982 | "node": ">=0.6" 983 | } 984 | }, 985 | "node_modules/typescript": { 986 | "version": "5.3.3", 987 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", 988 | "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", 989 | "dev": true, 990 | "bin": { 991 | "tsc": "bin/tsc", 992 | "tsserver": "bin/tsserver" 993 | }, 994 | "engines": { 995 | "node": ">=14.17" 996 | } 997 | }, 998 | "node_modules/undici-types": { 999 | "version": "5.26.5", 1000 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", 1001 | "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", 1002 | "dev": true 1003 | }, 1004 | "node_modules/unicorn-magic": { 1005 | "version": "0.3.0", 1006 | "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", 1007 | "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", 1008 | "engines": { 1009 | "node": ">=18" 1010 | }, 1011 | "funding": { 1012 | "url": "https://github.com/sponsors/sindresorhus" 1013 | } 1014 | }, 1015 | "node_modules/unpipe": { 1016 | "version": "1.0.0", 1017 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1018 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1019 | "engines": { 1020 | "node": ">= 0.8" 1021 | } 1022 | }, 1023 | "node_modules/which": { 1024 | "version": "2.0.2", 1025 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1026 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1027 | "dependencies": { 1028 | "isexe": "^2.0.0" 1029 | }, 1030 | "bin": { 1031 | "node-which": "bin/node-which" 1032 | }, 1033 | "engines": { 1034 | "node": ">= 8" 1035 | } 1036 | }, 1037 | "node_modules/wrap-ansi": { 1038 | "version": "9.0.0", 1039 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", 1040 | "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", 1041 | "dev": true, 1042 | "dependencies": { 1043 | "ansi-styles": "^6.2.1", 1044 | "string-width": "^7.0.0", 1045 | "strip-ansi": "^7.1.0" 1046 | }, 1047 | "engines": { 1048 | "node": ">=18" 1049 | }, 1050 | "funding": { 1051 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 1052 | } 1053 | }, 1054 | "node_modules/yaml": { 1055 | "version": "2.5.1", 1056 | "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", 1057 | "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", 1058 | "dev": true, 1059 | "bin": { 1060 | "yaml": "bin.mjs" 1061 | }, 1062 | "engines": { 1063 | "node": ">= 14" 1064 | } 1065 | }, 1066 | "node_modules/yoctocolors": { 1067 | "version": "2.1.1", 1068 | "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", 1069 | "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==", 1070 | "engines": { 1071 | "node": ">=18" 1072 | }, 1073 | "funding": { 1074 | "url": "https://github.com/sponsors/sindresorhus" 1075 | } 1076 | }, 1077 | "node_modules/zod": { 1078 | "version": "3.23.8", 1079 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", 1080 | "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", 1081 | "funding": { 1082 | "url": "https://github.com/sponsors/colinhacks" 1083 | } 1084 | } 1085 | } 1086 | } 1087 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcp-shell", 3 | "version": "0.1.3", 4 | "description": "Secure shell server for the Model Context Protocol. Integrates with Claude Desktop.", 5 | "type": "module", 6 | "bin": { 7 | "mcp-shell": "build/index.js" 8 | }, 9 | "files": [ 10 | "build/**/*" 11 | ], 12 | "scripts": { 13 | "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"", 14 | "prepare": "npm run build", 15 | "watch": "tsc --watch", 16 | "inspector": "npx @modelcontextprotocol/inspector build/index.js" 17 | }, 18 | "author": "High Dimensional Research", 19 | "license": "MIT", 20 | "dependencies": { 21 | "@modelcontextprotocol/sdk": "^0.6.0", 22 | "@types/command-exists": "^1.2.3", 23 | "command-exists": "^1.2.9", 24 | "execa": "^9.5.1" 25 | }, 26 | "devDependencies": { 27 | "@types/node": "^20.11.24", 28 | "husky": "^9.1.7", 29 | "lint-staged": "^15.2.10", 30 | "typescript": "^5.3.3" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import os from 'os'; 4 | 5 | function getConfigPath() { 6 | switch (process.platform) { 7 | case 'darwin': 8 | return path.join( 9 | os.homedir(), 10 | 'Library', 11 | 'Application Support', 12 | 'Claude', 13 | 'claude_desktop_config.json', 14 | ); 15 | case 'win32': 16 | return path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json'); 17 | default: 18 | throw new Error('Unsupported platform'); 19 | } 20 | } 21 | 22 | export function updateConfig(debug = false) { 23 | const isNpx = Boolean( 24 | process.argv[1].includes('/_npx/') || 25 | process.env.npm_command === 'exec' || 26 | process.env._?.includes('/_npx/'), 27 | ); 28 | if (!isNpx && !debug) { 29 | console.error({"error": 'Not running via npx'}); 30 | return; 31 | } 32 | 33 | const scriptPath = process.argv[1]; 34 | const configPath = getConfigPath(); 35 | 36 | try { 37 | let config: { mcpServers?: { 'shell-server'?: { command: string, args?: string[] } } } = {}; 38 | try { 39 | config = JSON.parse(fs.readFileSync(configPath, 'utf8')); 40 | } catch (err) { 41 | console.log('Creating new config file'); 42 | } 43 | 44 | config.mcpServers = config.mcpServers || {}; 45 | 46 | if (process.platform === 'win32') { 47 | config.mcpServers['shell-server'] = { 48 | command: "C:\\Program Files\\nodejs\\node.exe", 49 | args: [scriptPath] 50 | } 51 | } else { 52 | config.mcpServers['shell-server'] = { 53 | command: `${debug ? 'node' : 'npx'}`, 54 | args: debug ? [scriptPath] : ['mcp-shell'] 55 | }; 56 | } 57 | 58 | const configDir = path.dirname(configPath); 59 | if (!fs.existsSync(configDir)) { 60 | fs.mkdirSync(configDir, { recursive: true }); 61 | } 62 | 63 | fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); 64 | console.log('Updated config at:', configPath); 65 | console.log('Added server with command:', scriptPath); 66 | } catch (err) { 67 | console.error('Error updating config:', err); 68 | process.exit(1); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { Server } from '@modelcontextprotocol/sdk/server/index.js'; 4 | import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; 5 | import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'; 6 | import { execa } from 'execa'; 7 | import commandExists from 'command-exists'; 8 | import { updateConfig } from './config.js'; 9 | 10 | interface CommandResult { 11 | stdout: string; 12 | stderr: string; 13 | } 14 | 15 | // Dangerous commands that should never be allowed 16 | const BLACKLISTED_COMMANDS = new Set([ 17 | // File System Destruction Commands 18 | 'rm', // Remove files/directories - Could delete critical system or user files 19 | 'rmdir', // Remove directories - Could delete important directories 20 | 'del', // Windows delete command - Same risks as rm 21 | 22 | // Disk/Filesystem Commands 23 | 'format', // Formats entire disks/partitions - Could destroy all data on drives 24 | 'mkfs', // Make filesystem - Could reformat drives and destroy data 25 | 'dd', // Direct disk access - Can overwrite raw disks, often called "disk destroyer" 26 | 27 | // Permission/Ownership Commands 28 | 'chmod', // Change file permissions - Could make critical files accessible or inaccessible 29 | 'chown', // Change file ownership - Could transfer ownership of sensitive files 30 | 31 | // Privilege Escalation Commands 32 | 'sudo', // Superuser do - Allows running commands with elevated privileges 33 | 'su', // Switch user - Could be used to gain unauthorized user access 34 | 35 | // Code Execution Commands 36 | 'exec', // Execute commands - Could run arbitrary commands with shell's privileges 37 | 'eval', // Evaluate strings as code - Could execute malicious code injection 38 | 39 | // System Communication Commands 40 | 'write', // Write to other users' terminals - Could be used for harassment/phishing 41 | 'wall', // Write to all users - Could be used for system-wide harassment 42 | 43 | // System Control Commands 44 | 'shutdown', // Shut down the system - Denial of service 45 | 'reboot', // Restart the system - Denial of service 46 | 'init', // System initialization control - Could disrupt system state 47 | 48 | // Additional High-Risk Commands 49 | 'mkfs', // Duplicate of above, filesystem creation - Data destruction risk 50 | ]); 51 | 52 | // Example validation function 53 | function validateCommand(baseCommand: string): boolean { 54 | return !BLACKLISTED_COMMANDS.has(baseCommand); 55 | } 56 | 57 | class ShellServer { 58 | private server: Server; 59 | 60 | constructor() { 61 | this.server = new Server( 62 | { 63 | name: 'shell-server', 64 | version: '0.1.0', 65 | }, 66 | { capabilities: { resources: {}, tools: {} } }, 67 | ); 68 | 69 | this.setupErrorHandling(); 70 | this.setupHandlers(); 71 | } 72 | 73 | private setupErrorHandling(): void { 74 | this.server.onerror = (error) => { 75 | console.error('[MCP Error]', error); 76 | }; 77 | 78 | process.on('SIGINT', async () => { 79 | await this.server.close(); 80 | process.exit(0); 81 | }); 82 | } 83 | 84 | private setupHandlers(): void { 85 | this.setupToolHandlers(); 86 | } 87 | 88 | private setupToolHandlers(): void { 89 | this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ 90 | tools: [ 91 | { 92 | name: 'run_command', 93 | description: 'Run a shell command', 94 | inputSchema: { 95 | type: 'object', 96 | properties: { 97 | command: { type: 'string' }, 98 | }, 99 | }, 100 | }, 101 | ], 102 | })); 103 | 104 | this.server.setRequestHandler(CallToolRequestSchema, async (request) => { 105 | if (request.params.name !== 'run_command') { 106 | throw new Error(`Unknown tool: ${request.params.name}`); 107 | } 108 | 109 | const command = request.params.arguments?.command as string; 110 | try { 111 | const baseCommand = command.trim().split(/\s+/)[0]; 112 | if (!(await commandExists(baseCommand))) { 113 | throw new Error(`Command not found: ${baseCommand}`); 114 | } 115 | 116 | if (!validateCommand(baseCommand)) { 117 | throw new Error(`Command not allowed: ${baseCommand}`); 118 | } 119 | 120 | const { stdout, stderr } = await execa(command, [], { 121 | shell: true, 122 | env: process.env, 123 | }); 124 | 125 | return { 126 | content: [{ type: 'text', text: stdout || stderr, mimeType: 'text/plain' }], 127 | }; 128 | } catch (error) { 129 | return { 130 | content: [ 131 | { 132 | type: 'text', 133 | text: String(error), 134 | mimeType: 'text/plain', 135 | }, 136 | ], 137 | }; 138 | } 139 | }); 140 | } 141 | 142 | async run(): Promise { 143 | const transport = new StdioServerTransport(); 144 | await this.server.connect(transport); 145 | 146 | // Although this is just an informative message, we must log to stderr, 147 | // to avoid interfering with MCP communication that happens on stdout 148 | console.error('MCP server running on stdio'); 149 | } 150 | } 151 | 152 | async function main() { 153 | // Get command line arguments 154 | const args = process.argv.slice(2); 155 | 156 | // setup in claude desktop 157 | if (args.includes('config')) { 158 | const debug = args.includes('--debug'); 159 | updateConfig(debug); 160 | } 161 | 162 | // start server 163 | const server = new ShellServer(); 164 | await server.run(); 165 | } 166 | 167 | main().catch((error) => { 168 | console.error('Server error:', error); 169 | process.exit(1); 170 | }); 171 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "Node16", 5 | "moduleResolution": "Node16", 6 | "outDir": "./build", 7 | "rootDir": "./src", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true 12 | }, 13 | "include": ["src/**/*"], 14 | "exclude": ["node_modules"] 15 | } 16 | --------------------------------------------------------------------------------