Skip to content
Search

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
  • Integrates with VS Code, GitHub Copilot Chat, etc. without a separate language environment
  • While most MCP servers are just heavy API wrappers, this project offers a practical approach suited to local automation and AI agent tools
  • Limitations:
    • 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
  • Define each tool's parameters and description in assets/tools_list.json
  • Define the version, server name, and capabilities in mcpserverconfig.json
  • Grant execute permission to the file, then send and receive commands via stdio

See also

Favorite site

author Zer0 sitemap