mcpField
M
mcp-server-bash

mcp-server-bash

Local
github.com/antonumDeveloper Tools33Updated 82w ago

About mcp-server-bash

mcp-server-bash is a minimal MCP server written as a shell script, showing the full lifecycle from the initialization handshake to tool execution. It suits developers who want to understand the raw MCP message format.

Key features

  1. 01MCP server implemented as a bash script
  2. 02Covers initialization and operation phases
  3. 03Handles tools/list and tools/call messages
  4. 04Includes a simple addition tool

Use cases

  1. 01Learning the basic structure of MCP message exchange
  2. 02Testing JSON-RPC requests and responses from the command line
  3. 03Serving as a minimal example for connecting to LLM hosts

MCP support

This project is an MCP server that receives JSON-RPC messages over stdio and exposes an addition tool to clients. It can be registered in hosts such as mcphost or Claude Desktop through a JSON configuration file.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project 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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.