MCP Server Bash SDK – muthuishere/mcp-server-bash-sdk
- A new, lightweight Model Context Protocol (MCP) server implementation in pure Bash provides a zero-overhead alternative to heavier runtimes like Node.js and Python.This implementation supports full JSON-RPC 2.0...
- The model Context Protocol (MCP) server is designed as an API wrapper with schema conversion.
- To use the bash MCP server, users need a Bash shell and jq for JSON processing.
Discover a revolutionary,lightweight approach to tool integration with the Bash MCP server,a pure Bash implementation offering a streamlined alternative to heavier runtimes. This cutting-edge server provides a robust solution,implementing both JSON-RPC 2.0 and the complete MCP protocol. Explore how this design allows for dynamic tool finding and flexible configuration, making customization a breeze. Benefit from the zero-overhead advantage,ideal for developers seeking efficiency. With the Bash MCP server, experience easy extension with custom tools, all within a lightweight ecosystem. News Directory 3 highlights the evolution of efficient server solutions. Learn how to get started with a simple clone, execute scripts, and integrate external APIs. See examples of core components and custom server creation. Discover what’s next for your projects.
Bash MCP Server Offers Lightweight Tool Integration
Updated May 30, 2025
A new, lightweight Model Context Protocol (MCP) server implementation in pure Bash provides a zero-overhead alternative to heavier runtimes like Node.js and Python.This implementation supports full JSON-RPC 2.0 protocol over stdio and complete MCP protocol implementation.
The model Context Protocol (MCP) server is designed as an API wrapper with schema conversion. The Bash MCP server distinguishes itself by offering dynamic tool discovery via function naming conventions and external configuration through JSON files, making it easy to extend with custom tools.
To use the bash MCP server, users need a Bash shell and jq for JSON processing. On macOS,jq can be installed via brew install jq.
To get started, clone the repository:
git clone https://github.com/muthuishere/mcp-server-bash-sdk
cd mcp-server-bash-sdk
Next, make the scripts executable:
chmod +x mcpserver_core.sh moviemcpserver.sh
try it out:
echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "get_movies"}, "id": 1}' | ./moviemcpserver.sh
The architecture includes:
- mcpserver_core.sh: Handles JSON-RPC and MCP protocol.
- moviemcpserver.sh: Contains business logic functions.
- assets/: JSON configuration files.
To create a custom MCP server,create a business logic file (e.g., weatherserver.sh):
#!/bin/bash
# Weather API implementation
# Source the core MCP server
source "$(dirname "${BASH_SOURCE[0]}")/mcpserver_core.sh"
# Access habitat variables
API_KEY="${MCP_API_KEY:-default_key}"
# Weather tool implementation
tool_get_weather() {
local args="$1"
local location=$(echo "$args" | jq -r '.location')
# Call external API
local weather=$(curl -s "https://api.example.com/weather?location=$location&apikey=$API_KEY")
echo "$weather"
return 0
}
# Forecast tool implementation
tool_get_forecast() {
local args="$1"
local location=$(echo "$args" | jq -r '.location')
local days=$(echo "$args" | jq -r '.days')
local forecast=$(curl -s "https://api.example.com/forecast?location=$location&days=$days&apikey=$API_KEY")
echo "$forecast"
return 0
}
# start the MCP server
run_mcp_server "$@"
