π MCP Server in Bash A lightweight, zero-overhead implementation of the Model Context Protocol (MCP) server in pure Bash. Why? Most MCP servers are just API wrappers with schema conversion. This implementation provides a zero-overhead alternative to Node.js, Python, or other heavy runtimes. π Features β Full JSON-RPC 2.0 protocol over stdio β Complete MCP protocol implementation β Dynamic tool discovery via function naming convention β External configuration via JSON files β Easy to extend with custom tools π§ Requirements Bash shell jq for JSON processing ( brew install jq on macOS) π Quick Start Clone the repo git clone https://github.com/muthuishere/mcp-server-bash-sdk cd mcp-server-bash-sdk Make 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 ποΈ Architecture βββββββββββββββ ββββββββββββββββββββββββββ β MCP Host β β MCP Server β β (AI System) βββββββββΊ β (moviemcpserver.sh) β βββββββββββββββ stdio ββββββββββββββββββββββββββ β βββββββββ΄βββββββββββ βΌ βΌ βββββββββββββββββββ βββββββββββββββββ β Protocol Layer β β Business Logicβ β(mcpserver_core.sh)β β(tool_* funcs)β βββββββββββββββββββ βββββββββββββββββ β β βΌ βΌ βββββββββββββββββββ βββββββββββββββββ β Configuration β β External β β (JSON Files) β β Services/APIs β βββββββββββββββββββ βββββββββββββββββ mcpserver_core.sh : Handles JSON-RPC and MCP protocol : Handles JSON-RPC and MCP protocol moviemcpserver.sh : Contains business logic functions : Contains business logic functions assets/: JSON configuration files π Creating Your Own MCP Server Create your 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 environment variables API_KEY= " ${MCP_API_KEY :- default_key} " # Weather tool implementation tool_get_weather () { local args= " $1 " loc...
First seen: 2025-05-30 05:22
Last seen: 2025-05-30 18:24