Show HN: MCP Server SDK in Bash (~250 lines, zero runtime)

https://news.ycombinator.com/rss Hits: 14
Summary

🐚 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