Cover image
Try Now
2024-12-11

Serveur MCP pour exécuter les commandes de terminal via Claude Desktop

3 years

Works with Finder

1

Github Watches

1

Github Forks

5

Github Stars

Terminal MCP Server

A Model Context Protocol (MCP) server that enables execution of terminal commands through Claude Desktop.

Features

  • Execute any terminal command with arguments and options
  • Navigate between directories while maintaining state
  • Get terminal environment information
  • Full output capture (stdout, stderr, exit codes)
  • Proper error handling and formatting

Prerequisites

  • Node.js v18 or higher
  • TypeScript
  • Claude Desktop

Installation

  1. Clone the repository:
git clone https://github.com/stat-guy/terminal.git
cd terminal
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Local Development Setup

  1. Create or edit your Claude Desktop configuration file:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%\\Claude\\claude_desktop_config.json

Add the following configuration:

{
  "mcpServers": {
    "terminal": {
      "command": "node",
      "args": [
        "[PATH_TO_REPO]/dist/index.js"
      ],
      "env": {
        "PERMISSION_REQUIRED": "true"
      }
    }
  }
}

Replace [PATH_TO_REPO] with the actual path to your cloned repository.

  1. Restart Claude Desktop

Available Tools

execute_command

  • Execute any terminal command
  • Supports command arguments and options
  • Captures full output and exit codes

change_directory

  • Change the current working directory
  • Maintains state between commands
  • Supports relative and absolute paths

get_current_directory

  • Get the current working directory path

get_terminal_info

  • Get information about the terminal environment
  • Shows shell, user, platform, and recent command history

Usage Examples

Ask Claude to execute terminal commands like:

Can you check what's in my current directory?
-> Executes: ls -la

Can you tell me the current directory?
-> Executes: pwd

Can you change to the Downloads folder?
-> Executes: cd ~/Downloads

Security Considerations

  • The server requires explicit user permission through Claude Desktop for command execution
  • Environment variables can be controlled through the configuration
  • Command execution includes timeouts and error handling

Development

  1. Watch for changes:
npm run watch
  1. Test changes:
  • Make changes to source files in src/
  • Rebuild using npm run build
  • Restart Claude Desktop to load changes

Project Structure

/
├── src/
│   └── index.ts    # Main server implementation
├── package.json    # Project configuration and dependencies
├── tsconfig.json  # TypeScript configuration
└── README.md      # This file

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Andris Teikmanis
  • Latvian GPT assistant for developing GPT applications

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Navid RezaeiSarchoghaei
  • Professional Flask/SQLAlchemy code guide. Follow: https://x.com/navid_re

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://cantaspinar.com
  • Summarizes videos and answers related questions.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • OffchainLabs
  • Aller la mise en œuvre de la preuve de la participation Ethereum

  • oatpp
  • Implémentation du protocole de contexte du modèle d'Anthropic pour l'avoine ++

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocole de connecteur de message) 服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 , 支持员工信息查询和消息发送等功能。

    Reviews

    3 (1)
    Avatar
    user_1mL6BxXv
    2025-04-15

    As a devoted user of the shell-command-mcp by egoist, I must say it's a game-changer for automating shell commands. The intuitive interface and robust functionality save me tons of time and hassle. Highly recommend checking it out at https://mcp.so/server/shell-command-mcp/egoist!