# mcp-server-commands

> MCP Server

This repository provides tools, `run_command` and `run_script`, for LLMs like Claude to execute commands and scripts, enabling creative interactions while requiring careful user oversight for security. This repository provides tools,

## Overview

- **Category:** Developer Tools
- **Language:** JavaScript
- **Stars:** 231
- **Forks:** 16
- **Owner:** g0t4
- **GitHub:** https://github.com/g0t4/mcp-server-commands
- **Created:** 2024-11-29T02:39:02+00:00
- **Updated:** 2025-03-27T16:09:39+00:00
- **Source:** https://model-context-protocol.com/servers/llm-command-script-execution-server

## Setup

## Setup

To use with Claude Desktop, add the server config:

On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

### Use the published npm package

Published to npm as [mcp-server-commands](https://www.npmjs.com/package/mcp-server-commands) using this [workflow](https://github.com/g0t4/mcp-server-commands/actions)

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

### Use a local build (repo checkout)

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

### Logging

Claude Desktop app writes logs to `~/Library/Logs/Claude/mcp-server-mcp-server-commands.log`

By default, only important messages are logged (i.e. errors).
If you want to see more messages, add `--verbose` to the `args` when configuring the server.

By the way, logs are written to `STDERR` because that is what Claude Desktop routes to the log files.
In the future, I expect well formatted log messages to be written over the `STDIO` transport to the MCP client (note: not Claude Desktop app).

### Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script:

```bash
npm run inspector
```

The Inspector will provide a URL to access debugging tools in your browser.

## Tools

## Available Tools

1.  `run_command` (run a command, i.e. `hostname` or `ls -al` or `echo "hello world"` etc, returns STDOUT and STDERR as text)
2.  `run_script` (run a script! (i.e. `fish`, `bash`, `zsh`, `python`), script is passed over STDIN, `run_script` == `run_command` + script over STDIN)
