使用WebSocket包装MCP标准I/O服务器。适用于kibitz。
安装uv:
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来运行新的配置文件。使用默认配置文件(未提供--config或--command参数)和端口的基本用法:
uvx --refresh ws-mcp@latest
这将在默认端口(10125)上启动所有已配置的服务器。
使用配置文件和端口:
uvx --refresh ws-mcp@latest --config path/to/config --port 10125
# 使用fetch示例
uvx --refresh ws-mcp --command "uvx mcp-server-fetch" --port 3002
# 使用wcgw示例
uvx --refresh ws-mcp --command "uvx --from wcgw@latest --python 3.12 wcgw_mcp" --port 3001
# 使用Brave搜索示例
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
# 或者,使用.env文件:
uvx --refresh ws-mcp --env-file path/to/.env --command "npx -y @modelcontextprotocol/server-brave-search" --port 3003
# `--command`可以多次提供!
# 示例同时服务多个服务器:
uvx --refresh ws-mcp --env-file path/to/.env --command "npx -y @modelcontextprotocol/server-brave-search" --command "uvx mcp-server-fetch" --port 3004
# 服务器也可以在遵循[MCP标准格式](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server)的`.json`文件中指定
uvx --refresh ws-mcp --env-file path/to/.env --config path/to/config.json --port 3005