| Crates.io | mcp-shim |
| lib.rs | mcp-shim |
| version | 0.1.2 |
| created_at | 2025-12-29 23:33:32.742453+00 |
| updated_at | 2025-12-30 00:09:08.035887+00 |
| description | An MCP server process wrapper which kills the underlying process on stdin closure. |
| homepage | |
| repository | https://github.com/cbgbt/mcp-shim |
| max_upload_size | |
| id | 2011705 |
| size | 36,585 |
A process wrapper that ensures MCP server child processes are properly terminated when the parent connection closes.
MCP (Model Context Protocol) servers are typically spawned as child processes by host applications. When the host terminates, it should clean up these child processes. However, many MCP hosts don't properly track and terminate their child processes, leading to leaked processes that continue running in the background.
This is especially problematic for MCP servers that spawn their own subprocesses (e.g., uvx, npx, or other process launchers), as the entire process tree can be orphaned.
mcp-shim wraps your MCP server command and:
docker pull ghcr.io/cbgbt/mcp-shim:latest
Wrap your MCP server command with mcp-shim:
mcp-shim <command> [args...]
Without the shim, an MCP server might be configured like this:
{
"mcpServers": {
"my-server": {
"command": "uvx",
"args": ["some-mcp-server"]
}
}
}
With the shim, wrap the command to ensure proper cleanup:
{
"mcpServers": {
"my-server": {
"command": "mcp-shim",
"args": ["uvx", "some-mcp-server"]
}
}
}
setpgid(0, 0))MIT OR Apache-2.0