麦克韦

mcpway 通过SSE、WebSocket、流式HTTP和gRPC运行MCP stdio服务器。
安装
cargo install mcpway板条箱.io:
支持的平台
mcpway 支持:
- Linux
- macOS
- 视窗
平台说明:
- OAuth浏览器启动使用平台本机打开命令(
open在macOS上,xdg-open在Linux上,start在Windows上)。 connect --oauth-no-browser在您的环境中无法启动浏览器时可用。
快速开始
cargo build --release -p mcpway
./target/release/mcpway --stdio "./my-mcp-server --root ." --port 8000桥接模式
支持的输入/输出对示例:
# stdio -> sse (default output for --stdio)
mcpway --stdio "./my-mcp-server --root ." --port 8000
# stdio -> stdio (managed relay mode)
mcpway --stdio "./my-mcp-server --root ." --output-transport stdio
# stdio -> ws
mcpway --stdio "./my-mcp-server --root ." --output-transport ws --port 8000
# stdio -> streamable-http
mcpway --stdio "./my-mcp-server --root ." --output-transport streamable-http --port 8000
# stdio -> grpc
mcpway --stdio "./my-mcp-server --root ." --output-transport grpc --port 8000
# sse -> stdio
mcpway --sse https://example.com/sse
# streamable-http -> stdio
mcpway --streamable-http https://example.com/mcp对于端点首次使用,请使用 connect:
mcpway connect https://example.com/mcp
mcpway connect wss://example.com/ws --protocol ws
mcpway connect grpc://127.0.0.1:50051 --protocol grpc货物工作区
从存储库根运行:
cargo metadata --no-deps
cargo check -p mcpway
cargo test -p mcpway
cargo run -p mcpway -- --help释放烟雾测试(macOS)
在剪切版本之前,请在macOS主机上运行以下命令:
cargo check -p mcpway
cargo test -p mcpway
# stdio -> stdio
cargo run -p mcpway -- --stdio "./my-mcp-server --root ." --output-transport stdio
# stdio -> sse
cargo run -p mcpway -- --stdio "./my-mcp-server --root ." --output-transport sse --port 8000
# stdio -> grpc
cargo run -p mcpway -- --stdio "./my-mcp-server --root ." --output-transport grpc --port 50051
# oauth flow (verifies browser launch on macOS via `open`)
cargo run -p mcpway -- connect https://example.com/mcp --oauth-login命令参考
快捷方式:
-h/--help到处都有。- 未定义自定义短标志;使用完整
--long-option旗帜。
命令:
mcpway [OPTIONS](运行网关)- `mcpway generate --definition
--out [OPTIONS]`
- `mcpway regenerate --metadata
[OPTIONS]`
mcpway connect [ENDPOINT] [OPTIONS]mcpway discover [OPTIONS]mcpway import [OPTIONS]mcpway logsmcpway logs tail [OPTIONS]mcpway web [OPTIONS]
mcpway\[选项\]
--stdio --sse --streamable-http --output-transport --port --base-url --sse-path --message-path --streamable-http-path --log-level --cors --health-endpoint --header --env --oauth2-bearer --stateful --session-timeout --protocol-version --runtime-prompt --runtime-admin-port --runtime-admin-host --runtime-admin-token --retry-attempts --retry-base-delay-ms --retry-max-delay-ms --circuit-failure-threshold --circuit-cooldown-ms
mcpway生成
--definition --server --out --artifact-name --bundle-mcpway --no-bundle-mcpway --mcpway-binary --compile-wrapper --no-compile-wrapper
mcpway再生
--metadata --definition --server --out --bundle-mcpway --no-bundle-mcpway --mcpway-binary --compile-wrapper --no-compile-wrapper
mcpway连接
--server --stdio-cmd --stdio-arg --stdio-env --stdio-wrapper --save-wrapper --protocol --header --oauth2-bearer --oauth-profile --oauth-issuer --oauth-client-id --oauth-scope --oauth-flow --oauth-no-browser --oauth-cache --oauth-login --oauth-logout --oauth-audience --save-profile --registry --profile-name --retry-attempts --retry-base-delay-ms --retry-max-delay-ms --circuit-failure-threshold --circuit-cooldown-ms --log-level --protocol-version
mcpway发现
--from --project-root --json --strict-conflicts --search --transport --scope --enabled-only --sort --order --offset --limit
mcpway进口
--from --project-root --json --strict-conflicts --registry --save-profiles --bundle-mcpway --compile-wrapper
mcpway日志尾
--file --lines --level --transport --json --no-follow
mcpway网站
--host --port --log-file --admin-base-url --admin-token --auth-token --theme-catalog-url --theme-cache-ttl-seconds --theme-cache-file --no-open-browser --log-level
使用以下命令启动最小MCPway web检查器:
- WebSocket上的实时日志流(
/api/logs/ws)以及最近的日志查询(/api/logs/recent) - 可选的运行时管理代理面板(
/api/runtime/*,/api/discovery/search) - iTerm2风格方案的主题目录支持(
/api/themes/catalog,/api/themes/refresh)
示例:
# local-only web inspector (default bind 127.0.0.1:5173)
mcpway web
# use a specific log file and runtime admin endpoint
mcpway web --log-file ~/.mcpway/logs/mcpway.ndjson --admin-base-url http://127.0.0.1:9101
# protect API routes with a bearer token
mcpway web --auth-token my-web-token运行时管理API
当 --runtime-admin-port 设置后,管理服务器将公开:
GET /v1/runtime/healthGET /v1/runtime/metrics(JSON)GET /v1/runtime/metrics.prom(普罗米修斯文本)POST /v1/runtime/defaultsPOST /v1/runtime/session/{id}GET /v1/runtime/sessionsPOST /v1/discovery/search
身份验证控件:
--runtime-admin-token(或MCPWAY_RUNTIME_ADMIN_TOKEN)接受Authorization: Bearer.--runtime-admin-host+环回策略控制网络暴露。
迁移说明(突破性更改):
- 遗产
/runtime/*路线被移除;使用/v1/runtime/*. - 遗产
x-mcpway-token顶盖被移除;使用Authorization: Bearer. - 删除了旧camelCase CLI标志;使用规范的烤肉串案例标志。
- 工具API别名调用已删除;仅按规范名称调用工具。
- Windsurf传统配置路径
~/.codeium/mcp_config.json不再被阅读。 - 发现源解析器现在需要规范源密钥(例如no
mcp.serversClaude/VSCode解析器路径中的回退)。 - OpenCode发现现在只能读取
environment(没有env回退)。 - 工具API传输现在仅读取
Mcp-Session-Id用于会话捕获。 - 网关会话处理现在使用规范
Mcp-Session-Id只有。 - 连接包装器JSON现在需要
normalized.command,normalized.args,以及normalized.env_template. transport=sse删除了URL查询提示推理;只剩下显式的类型/路径/方案推理。- 生成定义解析现在需要顶级
mcpServers;根级服务器对象不再被接受。
