mcp -bash
minimalistic MCP server written in bash script
claude mcp add --transport stdio antonum-mcp-server-bash /Users/anton/code/mcp-server-bash/mcp_add.sh
How to use
This MCP server is a minimalistic MCP implementation written as a bash script. The mcp_add.sh script handles the MCP lifecycle (handshake and message execution) and exposes a simple tool named addition that adds two numbers. The server implements two primary test interactions you can run from the command line: listing available tools and invoking a numeric addition. To test, pipe JSON-RPC messages into the script. For example, to list tools, run: echo '{"method":"tools/list","params":{},"jsonrpc":"2.0","id":2}' | bash mcp_add.sh | jq. To perform addition, send a request to call the addition tool: echo '{"jsonrpc":"2.0","id":20, "method":"tools/call","params":{"name":"addition","arguments":{"num1":"1","num2":"2"}}}' | bash mcp_add.sh | jq. The config snippet in this repository maps the server name math to the mcp_add.sh script, enabling mcphost or other MCP clients to discover and use the tool.
How to install
Prerequisites:
- Bash (sh) shell with basic utilities
- jq (for pretty output during testing, optional)
- Access to the mcp_add.sh script from a POSIX environment
Step-by-step:
- Clone or download the repository containing mcp_add.sh.
- Ensure the script is executable: chmod +x mcp_add.sh
- Verify the MCP server configuration in your environment. An example mcp_config (as used by mcphost) maps a server name to the script path, e.g.: { "mcpServers": { "math": { "command": "/Users/anton/code/mcp-server-bash/mcp_add.sh", "args": [] } } }
- Run or connect using an MCP host or client (e.g., mcphost) with the provided config. The script itself runs in the shell and expects JSON-RPC messages on stdin.
- (Optional) Test locally by piping JSON-RPC messages into the script as shown in the usage example above.
Additional notes
Tips and common issues:
- Ensure mcp_add.sh is executable and reachable at the path specified in mcp_config.
- The server accepts JSON-RPC over stdin/stdout; make sure your client formats requests exactly as shown (including correct jsonrpc version and ids).
- If your tests fail, verify that bash is using coreutils available in your environment and that jq is installed if you want pretty-printed output.
- The repository focuses on a minimal toolset (primarily the addition tool). If you expand tooling, update the mcp_config with new server-name entries accordingly.
- When configuring mcphost or other MCP clients, mirror the example JSON configuration path to ensure the client can locate the server script.
- If using macOS paths, ensure the script path in mcp_config matches your actual filesystem layout.
Related MCP Servers
shellfirm
Terminal guardrails for humans and AI agents — intercepts dangerous commands with context-aware challenges before the damage is done.
mcp-cli
mcpc is a CLI client for MCP. It supports persistent sessions, stdio/HTTP, OAuth 2.1, JSON output for code mode, proxy for AI sandboxes, and much more.
mcp-shell
Give hands to AI. MCP server to run shell commands securely, auditably, and on demand.
hackerone-graphql
MCP server for the HackerOne GraphQL API
terminal
A minimal, zero-dependency terminal MCP (Model Context Protocol) client built for coding agents like OpenAI Codex.
opensearch
OpenSearch 3.0 with MCP Server