MCP Server in Bash
lastmod 2025-06-02created 2025-06-021 edits
An MCP server implemented in Bash
About
- MCP Server in Bash is an ultra-lightweight open-source project that implements an MCP server using only Bash and jq, without Node.js or Python
- Without a complex runtime, it handles the MCP protocol over stdio with full JSON-RPC 2.0, and tools (features) can be added dynamically using a function naming convention
- All configuration and feature definitions can be managed in JSON files, so you can quickly build all kinds of custom MCP servers with little effort
- Being Bash-based, no support for concurrency, memory management, or streaming responses
- Unsuitable for high-volume requests or high-performance real-time processing, but sufficient for AI assistance and local tools
📋 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
How to build a custom MCP server
- Create a business logic shell script (e.g. weatherserver.sh)
- e.g. implement tool_get_weather and tool_get_forecast functions
- Call external APIs and return the results as JSON