Shell MCP Server
by fabiogomez
README.md
## Shell MCP Server
Simple Model Context Protocol (MCP) server that exposes a single `terminal` tool for running shell commands.
### Prerequisites
- Python 3.11+
- [uv](https://github.com/astral-sh/uv) or `pip`
### Installation
```bash
uv sync
# or
pip install -e .
```
### Usage
Run the server over stdio:
```bash
python main.py
```
The server registers a `terminal` tool. Invoke it with an object shaped like:
```json
{
"command": "echo hello"
}
```
Command output is returned as MCP `TextContent`. Errors are surfaced with a prefixed `Error:` message.
### Resource
This server exposes a resource:
- ID: `mcpreadme://desktop`
- Returns the contents of `mcpreadme.md` resolved from OneDrive Desktop.
Resolution order:
- `$OneDrive/Desktop/mcpreadme.md`
- `~/OneDrive/Desktop/mcpreadme.md`
- `~/Desktop/mcpreadme.md`
If the file is missing or unreadable, a textual error message is returned.
### Docker
Build and run with uv inside the container (per uv Docker guide):
```bash
docker build -t shellserver .
docker run --rm -it shellserver
```
This image installs `uv` from the official image and uses:
- Dependency caching layers via `uv sync --no-install-project`
- Final run command equivalent to local: `uv run main.py`
Reference: uv Docker integration docs: [Installing a project](https://docs.astral.sh/uv/guides/integration/docker/#installing-a-project)
TDQS
D1.6/5.0
Scored across 1 tool
Disambiguation5/5
Only one tool exists, so there is no ambiguity about which tool to use.
Naming Consistency3/5
With only one tool, naming consistency is not applicable; however, the name 'terminal' is a simple noun, which is acceptable but lacks a verb pattern.
Tool Count2/5
A single tool for a shell server is too few; typical shell operations (e.g., run command, list files, manage processes) are all collapsed into one tool, making it overly broad and not well-scoped.
Completeness2/5
The tool surface is severely incomplete for a shell server, as it lacks explicit tools for common operations like file management, process control, or environment configuration, forcing the agent to rely on a single generic tool.
Maintenance
ActivityInactive
ResponsivenessNo issues