关于 ws-mcp
ws-mcp 是一个将 MCP stdio 服务包装为 WebSocket 服务的工具,主要与 kibitz 配合使用。它通过配置文件指定要运行的 MCP 服务,适合需要通过网络访问本地 MCP 服务的开发者。
主要功能
- 01将 stdio MCP 服务包装为 WebSocket
- 02通过配置文件管理多个 MCP 服务
- 03默认包含 wcgw 与 fetch 服务
- 04可指定端口运行
适用场景
- 01通过 WebSocket 访问本地 MCP 服务
- 02为 kibitz 提供 MCP 服务后端
- 03使用 uvx 快速启动多个 MCP 服务
MCP 相关
该项目是一个 MCP 服务代理,将 MCP stdio 服务以 WebSocket 形式暴露给连接的客户端。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
ws-mcp
通过 WebSocket 封装 MCP stdio 服务。 供 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运行,以使用新的配置文件。
运行 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
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。