Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-server-bash

MCP.Pizza Chef: antonum

mcp-server-bash is a minimalistic MCP server implemented entirely in bash shell script. It supports the full MCP lifecycle including handshake, initialization, and operation phases. This server demonstrates a simple example of MCP tool execution, such as adding two numbers, making it ideal for learning and lightweight MCP server use cases. It is easy to test and integrate with MCP hosts like Claude Desktop using JSON-RPC messages via CLI.

Use This MCP server To

Run a lightweight MCP server for simple tool execution Demonstrate MCP protocol lifecycle in bash scripting Test MCP tool calls via command line Integrate with MCP hosts using JSON-RPC over CLI Prototype MCP server logic in shell script Execute basic arithmetic tools via MCP protocol

README

mcp-server-bash

Minimalistic MCP server written in shell script.

This repo is comlimentary to the article: Minimalistic MCP Server in bash script

The lifecycle of MCP server can be described in two phases. Initialization and Operation.

Phases of MCP

The mcp_add.sh implements all of the messages within this lifecicle, from the handshake to execution of the simple "add two numbers" tool.

To do the basic test methods right in CLI use:

# test tools/list method
echo '{"method":"tools/list","params":{},"jsonrpc":"2.0","id":2}' | bash mcp_add.sh | jq 

# test math_addition tool
echo '{"jsonrpc":"2.0","id":20, "method":"tools/call","params":{"name":"addition","arguments":{"num1":"1","num2":"2"}}}' | bash mcp_add.sh | jq 

LLM host configuration

JSON Configuration file for mcphost and Claude Desktop:

{
    "mcpServers": {
      "math": {
        "command": "/Users/anton/code/mcp-server-bash/mcp_add.sh",
        "args": []
      }
    }
  }

Test with mcphost

Add execute to bash script:

chmod +x mcp_add.sh

Run mcphost with llama3.1 and tool configuration file

mcphost -m ollama:llama3.1:latest --config /Users/anton/code/mcp-server-bash/mcp.json

...

using math tool add 10 and 88

References

mcp-server-bash FAQ

How do I test the mcp-server-bash tools from the command line?
Use echo with JSON-RPC messages piped into the bash script, e.g., echo '{"method":"tools/list"}' | bash mcp_add.sh | jq.
What tools does mcp-server-bash provide?
It includes a simple 'addition' tool that adds two numbers, demonstrating basic MCP tool execution.
How does mcp-server-bash handle the MCP lifecycle?
It implements all lifecycle messages from handshake to tool execution in bash script phases: initialization and operation.
Can mcp-server-bash be integrated with MCP hosts?
Yes, it supports JSON configuration for MCP hosts like Claude Desktop and mcphost for seamless integration.
Is mcp-server-bash suitable for production use?
It is primarily a minimalistic example for learning and prototyping, not optimized for production environments.
What dependencies are required to run mcp-server-bash?
It requires a Unix-like shell environment with bash and jq for JSON parsing.
Can I extend mcp-server-bash with additional tools?
Yes, you can add more tool implementations by extending the bash script following the MCP protocol.