
shebang-mcp-sdk
io.github.sheldonrobinson/shebang-mcp-sdk
Generic shell MCP SDK server with stdio and Streamable HTTP transports.
Documentation
shebang-mcp-sdk
Generic Shebang MCP SDK — The Model Context Protocol (MCP) SDK for shell environments (POSIX sh/Bash & PowerShell), analogous to
python-sdkfor Python and@modelcontextprotocol/sdkfor TypeScript.
Overview
The Shebang MCP SDK is a generic, cross-platform MCP SDK that provides the core Model Context Protocol (MCP) implementation usable by any shell-based MCP server. It is strictly generic and contains no application-specific logic.
Like the official Python SDK and TypeScript SDK, the Shebang MCP SDK gives you the protocol foundation — JSON-RPC 2.0 framing, initialize/ping/tools/list/tools/call handling, stdio and streamable-http transports, and lifecycle management — so you can focus on building your MCP tools rather than reimplementing the protocol.
Native implementations for:
- Linux / macOS (Bash):
bin/mcp-sdk.sh+bin/shebang-mcp-sdk.sh - Windows (PowerShell):
bin/mcp-sdk.psm1+bin/shebang-mcp-sdk.ps1 - Polyglot Runner:
bin/script-runner.sh/bin/script-runner.ps1(runs in both POSIXsh/bashand PowerShell)
MCP Protocol Support
Required features (implemented per MCP specification):
- JSON-RPC 2.0 envelope (
jsonrpc: "2.0") on every message initializerequest → capabilities, serverInfo, protocolVersionnotifications/initialized→ handled silently (no response)pingrequest → empty object{}responsetools/list→ list of available toolstools/call→ invoke a named tool with arguments- Standard JSON-RPC 2.0 error codes (-32700, -32600, -32601, -32602, -32603)
- Transports: stdio and streamable-http
- On-exit cleanup handler
Optional features (explicitly NOT implemented):
- Authorization, Elicitation, Roots, Sampling, Completions, Logging
Deprecated features (explicitly NOT implemented):
- Legacy HTTP+SSE transport
Install Skill (.agents/skills/)
Per the Agent Skills Specification, install the skill to .agents/skills/:
# Project-level (.agents/skills/) or User-level (~/.agents/skills/)
mkdir -p .agents/skills
cp -R skills/shebang-mcp-builder .agents/skills/shebang-mcp-builder
New-Item -ItemType Directory -Path .agents/skills -Force | Out-Null
Copy-Item -Recurse -Force skills/shebang-mcp-builder .agents/skills/shebang-mcp-builder
This copies only the discoverable skill, not the SDK runtime. Set PLUGIN_ROOT to a full shebang-mcp-sdk checkout containing bin/ before running setup, generation, or server commands:
export PLUGIN_ROOT=/absolute/path/to/shebang-mcp-sdk
$env:PLUGIN_ROOT = 'C:\path\to\shebang-mcp-sdk'
OS-Specific MCP Servers (mcp.json)
| MCP Server Name | OS / Runtime | Transport | Command / Endpoint |
|---|---|---|---|
shebang-mcp-sdk | Linux / macOS (POSIX sh/Bash) | stdio | sh ${PLUGIN_ROOT}/bin/shebang-mcp-sdk.sh --stdio |
shebang-mcp-sdk-sh | Linux / macOS (with jq PATH bootstrap) | stdio | sh ${PLUGIN_ROOT}/bin/shebang-mcp-sdk.sh --stdio |
shebang-mcp-sdk-pwsh | Windows (PowerShell 7+) | stdio | pwsh -NoProfile -ExecutionPolicy Bypass -File (Join-Path $env:PLUGIN_ROOT 'bin/shebang-mcp-sdk.ps1') --stdio |
shebang-mcp-sdk-powershell | Windows (PowerShell 5.1) | stdio | powershell.exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $env:PLUGIN_ROOT 'bin/shebang-mcp-sdk.ps1') --stdio |
shebang-mcp-sdk-http | Cross-Platform | streamable-http | http://127.0.0.1:8080/mcp |
Quick Start
1. Start MCP Server (stdio mode)
- Linux / macOS (Bash):
./bin/shebang-mcp-sdk.sh --stdio - Windows (PowerShell):
pwsh -NoProfile -ExecutionPolicy Bypass -File .\bin\shebang-mcp-sdk.ps1 --stdio
2. Start Streamable HTTP Service
- Linux / macOS (Bash):
./bin/shebang-mcp-sdk.sh --streamable-http --host 127.0.0.1 --port 8080 --listen - Windows (PowerShell):
pwsh -NoProfile -ExecutionPolicy Bypass -File .\bin\shebang-mcp-sdk.ps1 --streamable-http --port 8080
3. Verify the server responds
curl -X POST http://127.0.0.1:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
Package Structure
shebang-mcp-sdk/
+-- bin/
| +-- mcp-sdk.sh # Generic Bash MCP SDK (stdio + streamable-http)
| +-- mcp-sdk.psm1 # Generic PowerShell MCP SDK (stdio + streamable-http)
| +-- shebang-mcp-sdk.sh # Bash MCP server entry point
| +-- shebang-mcp-sdk.ps1 # PowerShell MCP server entry point
| +-- script-runner # Polyglot runner (POSIX sh / Bash & PowerShell)
| +-- script-runner.sh # Polyglot runner (.sh entry point)
| +-- script-runner.ps1 # Polyglot runner (.ps1 entry point)
| +-- script-runner.cmd # Windows CMD launcher -> script-runner.ps1
| +-- package-mcpb.sh # MCPB bundle builder (POSIX sh)
| +-- package-mcpb.ps1 # MCPB bundle builder (PowerShell)
+-- packaging/mcpb/
| +-- manifest.sh.json # MCPB manifest (Bash edition)
| +-- manifest.pwsh.json # MCPB manifest (PowerShell edition)
| +-- mcp.template.json # MCP server config template
+-- skills/shebang-mcp-builder/ # Agent Skills discovery mirror
| +-- SKILL.md # Skill metadata & instructions
| +-- references/
| | +-- spec-template.md
| | +-- checklist.md
| +-- scripts/
| +-- setup-sdk.{sh,ps1} # SDK setup & info script
+-- io.github.sheldonrobinson.shebang-mcp-builder/ # Client extension hooks & commands
| +-- hooks/
| | +-- hooks.json
| | +-- stop-hook.{sh,ps1}
| +-- commands/
| +-- sdk-help.md
+-- plugin.json # Agent Plugins v1.0.0 manifest
+-- mcp.json # MCP Server configurations
+-- server.json # Official MCP Registry manifest
+-- package.sh # Basher install script and BINS/DEPS metadata
+-- LICENSE
+-- README.md
Consumer Extension
The SDK is generic — consumers extend it by defining global functions:
- Bash:
handle_list_tools,handle_tools_call,mcp_custom_method_handler - PowerShell:
Handle-ListTools,Handle-ToolsCall,Invoke-McpCustomMethod
Optional resources and prompts use the dedicated handle_list_resources / handle_read_resource and handle_list_prompts / handle_get_prompt handlers (or their PowerShell equivalents). The core advertises the corresponding capabilities only when consumers provide those handlers; they are not automatic features of every generic server.
See skills/shebang-mcp-builder/SKILL.md for the full consumer extension guide.
MCP Builder Skill Integration
The Shebang MCP SDK is designed to work with the MCP Builder Skill — a skill for creating high-quality MCP servers that enable LLMs to interact with external services through well-designed tools.
The MCP Builder Skill (from anthropics/skills) provides guidance for building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). With the Shebang MCP SDK, you can apply the same MCP Builder principles to shell-based MCP servers:
- Define tool handlers (
handle_list_tools/handle_tools_call) following MCP Builder patterns - Use
mcp_custom_method_handlerfor custom protocol methods - Register cleanup hooks via
mcp_register_cleanup/Register-McpCleanup - Package as MCPB bundles for distribution via the Official MCP Registry
See bin/package-mcpb.sh / bin/package-mcpb.ps1 for building distributable .mcpb packages.
Links
- Full Documentation — API reference and deployment guide
- Deployment Guide — Installation, MCP configuration, and Streamable HTTP service setup
- Source Repository
- Official Python SDK
- Official TypeScript SDK
- MCP Builder Skill
- Agent Skills Specification
- Agent Plugins Specification
- Model Context Protocol Specification
License
MIT
https://github.com/sheldonrobinson/shebang-mcp-sdk/releases/download/v1.0.0/shebang-mcp-sdk.sh.mcpb# mcpb: https://github.com/sheldonrobinson/shebang-mcp-sdk/releases/download/v1.0.0/shebang-mcp-sdk.sh.mcpbhttps://github.com/sheldonrobinson/shebang-mcp-sdk/releases/download/v1.0.0/shebang-mcp-sdk.pwsh.mcpb# mcpb: https://github.com/sheldonrobinson/shebang-mcp-sdk/releases/download/v1.0.0/shebang-mcp-sdk.pwsh.mcpb