{"id":23302248,"url":"https://github.com/hdresearch/mcp-shell","last_synced_at":"2025-08-22T07:32:08.566Z","repository":{"id":264914292,"uuid":"894248473","full_name":"hdresearch/mcp-shell","owner":"hdresearch","description":"Execute a secure shell in Claude Desktop using the Model Context Protocol.","archived":false,"fork":false,"pushed_at":"2024-12-10T23:52:29.000Z","size":40,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-11T00:28:51.402Z","etag":null,"topics":["claude","function-calling","shell"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hdresearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-26T02:45:12.000Z","updated_at":"2024-12-10T23:52:33.000Z","dependencies_parsed_at":"2024-12-11T00:25:24.015Z","dependency_job_id":"9875f3aa-c164-4b7a-9ca9-e3ba6b0ec43d","html_url":"https://github.com/hdresearch/mcp-shell","commit_stats":null,"previous_names":["hdresearch/mcp-shell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdresearch%2Fmcp-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdresearch%2Fmcp-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdresearch%2Fmcp-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdresearch%2Fmcp-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hdresearch","download_url":"https://codeload.github.com/hdresearch/mcp-shell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230568957,"owners_count":18246437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude","function-calling","shell"],"created_at":"2024-12-20T10:19:38.822Z","updated_at":"2024-12-20T10:19:39.488Z","avatar_url":"https://github.com/hdresearch.png","language":"JavaScript","readme":"# Shell MCP Server\n\nA 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.\n\n## Features\n\n- MCP-compliant server implementation\n- Secure command execution with blacklist protection\n- Command existence validation\n- Standard I/O based transport\n- Error handling and graceful shutdown\n\n## Installation\n\nRun `npx mcp-shell`.\n\nTo add it to Claude Desktop, run `npx mcp-shell config`. Or add `npx -y mcp-shell` to your config manually.\n\nStart (or restart) [Claude Desktop](https://claude.ai/download) and you should see the MCP tool listed on the landing page.\n\n## Security Features\n\nThe server implements several security measures:\n\n1. Command Blacklisting\n\n   - Prevents execution of dangerous system commands\n   - Blocks access to critical system modifications\n   - Protects against file system destruction\n   - Prevents privilege escalation\n\n2. Command Validation\n   - Verifies command existence before execution\n   - Validates against the blacklist\n   - Returns clear error messages for invalid commands\n\n## Available Tools\n\nThe server provides one tool:\n\n### run_command\n\nExecutes a shell command and returns its output.\n\n**Input Schema:**\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"command\": { \"type\": \"string\" }\n  }\n}\n```\n\n**Response:**\n\n- Success: Command output as plain text\n- Error: Error message as plain text\n\n## Blacklisted Commands\n\nThe following command categories are blocked for security:\n\n- File System Destruction Commands (rm, rmdir, del)\n- Disk/Filesystem Commands (format, mkfs, dd)\n- Permission/Ownership Commands (chmod, chown)\n- Privilege Escalation Commands (sudo, su)\n- Code Execution Commands (exec, eval)\n- System Communication Commands (write, wall)\n- System Control Commands (shutdown, reboot, init)\n\n## Error Handling\n\nThe server includes comprehensive error handling:\n\n- Command not found errors\n- Blacklisted command errors\n- Execution errors\n- MCP protocol errors\n- Graceful shutdown on SIGINT\n\n## Implementation Details\n\nThe server is built using:\n\n- Model Context Protocol SDK\n- StdioServerTransport for communication\n- execa for command execution\n- command-exists for command validation\n\n## Development\n\nTo modify the security settings, you can:\n\n1. Edit the `BLACKLISTED_COMMANDS` set to adjust blocked commands\n2. Modify the `validateCommand` function to add additional validation rules\n3. Enhance the command parsing logic in the `CallToolRequestSchema` handler\n","funding_links":[],"categories":["📚 Projects (1974 total)","🌐 Web Development","Task and Project Management","Command Line"],"sub_categories":["MCP Servers","How to Submit"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdresearch%2Fmcp-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdresearch%2Fmcp-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdresearch%2Fmcp-shell/lists"}