返回市场
网关-MCP

网关-MCP

作者:nick1udwig19 星标更新:2025-09-23

项目介绍

ws-mcp

使用WebSocket包装MCP标准I/O服务器。适用于kibitz

快速开始

预备条件

安装uv

curl -LsSf https://astral.sh/uv/install.sh | sh

配置

配置文件指定了要运行的MCP服务器。 默认配置(未提供--config--command参数)包括:

  • wcgw:用于通用系统操作和文件管理
  • fetch:用于发起HTTP请求

创建配置文件的方法如下:

  1. 创建你的配置文件:
    cp sample.config.json config.json
    
  2. 修改config.json以根据需要添加或移除服务器。
  3. 使用--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

详细用法

# 使用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