Skip to main content
Glama
README.md
# terminal

An MCP server that exposes a single `execute` tool for running any CLI command over stdio. Uses `execFile` (no shell) to prevent injection.

## Quick Start

```bash
npx @renfeng/terminal
```

## MCP Configuration

```json
{
  "mcpServers": {
    "terminal": {
      "command": "npx",
      "args": ["-y", "@renfeng/terminal@0.4"],
      "autoApprove": ["execute"]
    }
  }
}
```

Remove `execute` from `autoApprove` to require user confirmation for every call.

## Tool: `execute`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `command` | `string` | Yes | The CLI to run (e.g. `mvn`, `git`, `gradle`) |
| `args` | `string[]` | Yes | Arguments to pass |
| `cwd` | `string` | No | Working directory |
| `timeout` | `number` | No | Timeout in ms (default: 30000) |

### Examples

```json
{ "command": "mvn", "args": ["clean", "install", "-DskipTests"] }
{ "command": "git", "args": ["log", "--oneline", "-10"] }
{ "command": "gradle", "args": ["build", "--info"] }
{ "command": "docker", "args": ["ps"] }
{ "command": "kubectl", "args": ["get", "pods"] }
```

## Response Format

```
<stdout>
[stderr]
<stderr output>
[exit code: N]
```

Non-zero exit codes set `isError: true` in the MCP response.

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `CLI_TIMEOUT` | `30000` | Default execution timeout in milliseconds |

## Security

- `execFile` runs commands directly — no shell interpretation, no injection via args
- Trust is managed by Kiro's `autoApprove` in `mcp.json`
- The server has no allowlist — Kiro is the gatekeeper

## Development

```bash
npm install
npm run build
npm test
```

## License

MIT

TDQS

A3.9/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of misselection or overlap with a sibling tool. Its purpose (run a CLI command) is unambiguous.

Naming Consistency4/5

The single name 'execute' is a clear, lowercase verb with no casing or style conflicts. There is no multi-tool pattern to evaluate against, so consistency is trivially satisfied rather than demonstrated.

Tool Count4/5

A terminal server's core job is running commands, and one tool covers that cleanly without bloat. It is slightly thin in that everything (command, args, working directory, environment) must be funneled through a single entry point.

Completeness3/5

Single-shot command execution via execFile is covered, but there is no support for persistent/interactive sessions, stdin streaming, background processes, or explicit cwd/env handling. Agents needing multi-step stateful terminal work will hit dead ends.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues