ws-mcp
用WebSocket封装MCP stdio服务器。 用于 多管闲事.
快速启动
先决条件
安装 紫外线:
curl -LsSf https://astral.sh/uv/install.sh | sh配置
配置文件指定要运行哪些MCP服务器。 默认配置(否 --config 或 --command 提供的参数)包括:
要创建配置文件,请执行以下操作:
- 创建配置文件:
cp sample.config.json config.json- 修改
config.json根据您的需要添加或删除服务器。 - 与一起跑步
--config path/to/config.json使用新的配置文件。
运行ws-mcp
默认配置文件的基本用法(否 --config 或 --command 提供)和端口:
uvx --refresh ws-mcp@latest这将在默认端口上启动所有配置的服务器(10125).
要使用配置文件和端口:
uvx --refresh ws-mcp@latest --config path/to/config --port 10125详细用法
# Example using fetch
uvx --refresh ws-mcp --command "uvx mcp-server-fetch" --port 3002
# Example using wcgw
uvx --refresh ws-mcp --command "uvx --from wcgw@latest --python 3.12 wcgw_mcp" --port 3001
# Example using Brave search
export BRAVE_API_KEY=YOUR_API_KEY_HERE
uvx --refresh ws-mcp --env BRAVE_API_KEY=$BRAVE_API_KEY --command "npx -y @modelcontextprotocol/server-brave-search" --port 3003
# Or, with a .env file:
uvx --refresh ws-mcp --env-file path/to/.env --command "npx -y @modelcontextprotocol/server-brave-search" --port 3003
# `--command` can be supplied multiple times!
# Example serving multiple servers at once:
uvx --refresh ws-mcp --env-file path/to/.env --command "npx -y @modelcontextprotocol/server-brave-search" --command "uvx mcp-server-fetch" --port 3004
# Servers can also be specified in a `.json` file following [the standard MCP format](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server)
uvx --refresh ws-mcp --env-file path/to/.env --config path/to/config.json --port 3005