mcp-server-commands

by g0t4

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides system command execution capabilities on macOS, with specific installation paths for the Claude Desktop app configuration on macOS systems.

도구

LLM이 요청할 수 있는 도구, 즉 Claude Desktop 앱이 있습니다. Claude Sonnet 3.5는 두 도구를 모두 효과적으로 활용해서 매우 만족스러웠습니다.

  • run_command - 명령을 실행합니다. 예: hostname , ls -al 또는 echo "hello world"
    • STDOUT 및 STDERR을 텍스트로 반환합니다.
  • run_script - 스크립트 실행! (예: fish , bash , zsh , python )
    • LLM이 작성한 코드를 실행해 보세요!
    • 스크립트가 STDIN을 통해 전달됩니다.
    • run_script == run_command + STDIN을 통한 스크립트
    • 클로드는 이 부분에서 매우 창의적이었습니다. 즉, cat 인터프리터로 사용하여 새로운 파일을 만들었습니다!

[!경고] 이 서버에서 실행하도록 요청할 때는 주의하세요! Claude 데스크톱 앱에서는 각 명령을 검토할 수 있도록 Approve Once ( Allow for This Chat 가 아님)를 사용하고, 명령을 신뢰할 수 없으면 Deny 사용하세요. 권한은 서버를 실행하는 사용자에 따라 결정됩니다. sudo 사용하여 실행하지 마세요.

비디오 연습

프롬프트

프롬프트는 사용자가 채팅 기록에 포함할 수 있도록 되어 있습니다. 즉, Zed 의 슬래시 명령(AI 채팅 패널)을 통해 가능합니다.

  • run_command - 명령 출력과 함께 프롬프트 메시지를 생성합니다.

개발

종속성 설치:

지엑스피1

서버를 빌드하세요:

npm run build

자동 재빌드를 사용한 개발의 경우:

npm run watch

설치

Claude Desktop과 함께 사용하려면 서버 구성을 추가하세요.

MacOS의 경우: ~/Library/Application Support/Claude/claude_desktop_config.json Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json

게시된 npm 패키지를 사용하세요

워크플로를 사용하여 mcp-server-commands 로 npm에 게시됨

{ "mcpServers": { "mcp-server-commands": { "command": "npx", "args": ["mcp-server-commands"] } } }

로컬 빌드(repo 체크아웃) 사용

{ "mcpServers": { "mcp-server-commands": { // works b/c of shebang in index.js "command": "/path/to/mcp-server-commands/build/index.js" } } }

벌채 반출

Claude Desktop 앱은 ~/Library/Logs/Claude/mcp-server-mcp-server-commands.log 에 로그를 기록합니다.

기본적으로 중요한 메시지(예: 오류)만 기록됩니다. 더 많은 메시지를 보려면 서버를 구성할 때 args--verbose 추가하세요.

참고로, Claude Desktop이 로그 파일에 STDERR을 라우팅하기 때문에 로그가 STDERR 에 기록됩니다. 앞으로는 잘 포맷된 로그 메시지가 STDIO 전송을 통해 MCP 클라이언트(참고: Claude Desktop 앱 아님)에 기록될 것으로 예상합니다.

디버깅

MCP 서버는 stdio를 통해 통신하므로 디버깅이 어려울 수 있습니다. 패키지 스크립트로 제공되는 MCP Inspector를 사용하는 것이 좋습니다.

npm run inspector

검사기는 브라우저에서 디버깅 도구에 액세스할 수 있는 URL을 제공합니다.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

명령을 실행하는 MCP 서버.

  1. Video walkthrough
    1. Prompts
      1. Development
        1. Installation
          1. Use the published npm package
          2. Use a local build (repo checkout)
          3. Logging
          4. Debugging
        ID: 4vlwa2czqa