Get the FREE Ultimate OpenClaw Setup Guide →

mcp -bash

minimalistic MCP server written in bash script

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone or download the repository containing mcp_add.sh.
  2. Ensure the script is executable: chmod +x mcp_add.sh
  3. 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": [] } } }
  4. 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.
  5. (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

Sponsor this space

Reach thousands of developers