
MCP Sidecar
io.github.lsequeiraa由 GitHub 账号 lsequeiraa 发布v0.3.2更新于 Oct 24, 2026
Cross-platform MCP server for managing long-lived background processes from any MCP client
概览
一个本地 MCP 服务器,让 AI 助手启动、查看、写入并停止长期运行的后台进程,例如开发服务器、监听构建和测试数据库。
- 可以做什么
- 用命令、可选名称、工作目录和环境变量启动后台进程,返回 ID 和 PID。列出所有受管进程,并查看单个进程的详细状态、退出码和运行时长。读取缓冲的 stdout 和 stderr,支持 tail 和字节上限并报告截断情况。向运行中进程的标准输入写入内容。先优雅后强制地停止进程,终止等待时间可配置。已退出进程在可配置的保留期后自动移除。
- 适用场景
- 适合助手需要让某个进程在多次工具调用之间持续存活的场景,例如启动 API 服务器后再探测它、在编辑代码时以监听模式运行构建,或启动数据库、写入种子数据、运行测试后再拆除。短时命令更适合交给助手自带的 shell。
- 运行要求
- 以本地进程通过 stdio 运行,可用 npx 或预编译二进制安装;README 称其为单个 Go 二进制,无需运行时依赖。所有配置均为可选环境变量:SIDECAR_MAX_PROCESSES、SIDECAR_BUFFER_SIZE、SIDECAR_KILL_TIMEOUT、SIDECAR_CLEANUP_AFTER、SIDECAR_MAX_OUTPUT_SIZE、SIDECAR_ALLOWED_EXECUTABLES、SIDECAR_BLOCKED_PATTERNS 和 SIDECAR_AUDIT_LOG。未声明任何身份验证。
安装
在 SourceWeft 中
- 打开 控制台中的 MCP Sidecar,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-sidecar
A lightweight, cross-platform MCP server for managing background processes. Built in Go for single-binary distribution with zero runtime dependencies.
Why?
AI coding agents (Claude Code, Gemini CLI, Cursor, etc.) lack the ability to run long-lived processes while continuing to interact with them. Common workflows affected:
- Start an API server, wait for it to be ready, then run HTTP requests against it
- Run a build in watch mode while editing code
- Start a database, seed it, run tests, tear it down
mcp-sidecar solves this by exposing process lifecycle management as MCP tools over stdio transport.
Features
- Cross-platform -- Windows, Linux, macOS from a single codebase
- Zero dependencies -- Single Go binary, no runtime required
- Minimal surface -- 6 tools, no unnecessary complexity
- Reliable cleanup -- All child processes are terminated when the server exits; exited processes are auto-removed after a configurable TTL
- Output control -- Per-request
maxBytesand globalSIDECAR_MAX_OUTPUT_SIZEto cap output returned to the LLM - Command security -- Optional executable allowlist, blocked patterns, and audit logging
Installation
Quick Setup (any agent)
The fastest way to install mcp-sidecar into any supported coding agent:
Supported agents: Claude Code, Codex, Cursor, VS Code, Gemini CLI, OpenCode, Zed, Goose, Cline, and more. See add-mcp for the full list.
Manual Configuration
Claude Code:
opencode (~/.config/opencode/opencode.json):
Generic (mcp.json):
From Source
Pre-built binaries are also available on GitHub Releases for windows/amd64, linux/amd64, darwin/arm64, and darwin/amd64.
Tools
The uptime field reflects actual runtime: for running processes it's the time since start; for exited processes it's the time the process was alive (not the time since start).
The output tool's maxBytes parameter caps the total bytes of stdout+stderr combined. When both tail and maxBytes are provided, tail selects lines first, then maxBytes caps the byte size of the result. When the output exceeds the limit, the most recent content is kept and stderr is prioritized. Truncation preserves line boundaries. When output is truncated, the response includes "truncated": true and "totalBytes" indicating the original size.
Process States
Example workflow
A typical session where an agent starts an API server, waits for it to be ready, tests it, and tears it down:
The agent uses its native shell for short-lived commands (curl, build tools, etc.) and mcp-sidecar for processes that need to stay alive across multiple tool calls.
Configuration
All configuration is via environment variables (all optional):
Auto-cleanup note: When SIDECAR_CLEANUP_AFTER is enabled (the default), exited processes are removed from the manager after the TTL expires. Once removed, calls to output, status, or stop for that process ID will return "not found". Retrieve any output you need within the TTL window (30 minutes by default).
Security
When SIDECAR_ALLOWED_EXECUTABLES is set, mcp-sidecar switches from shell mode to secure mode:
Metacharacters inside quotes are allowed -- grep "error|warning" file.txt works because the | is inside double quotes and won't be interpreted by a shell.
Backslash (\) is intentionally not treated as a metacharacter so Windows paths like C:\Users\me\app.exe work without escaping.
Configuration examples
Claude Desktop / Cursor (mcp.json):
Claude Code:
Audit log format
The audit log is always written to a file named sidecar-audit.jsonl inside the configured directory. The SIDECAR_AUDIT_LOG variable controls where:
Each line is a JSON object with one of three event types:
Executable matching
The allowlist supports three matching modes:
Distribution
License
MIT
来源:README.md,提交 10776ba
工具
0版本历史
1- v0.3.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分