MCP ExplorerExplorer

Ws Mcp

@nick1udwigon 9 months ago
17 MIT
FreeCommunity
AI Systems
Wraps MCP stdio servers with WebSocket for easy integration.

Overview

What is Ws Mcp

ws-mcp is a server that wraps MCP stdio servers with a WebSocket interface, allowing for real-time communication and interaction with various MCP servers.

Use cases

Use cases for ws-mcp include integrating with Kibitz for real-time monitoring, making HTTP requests through the fetch MCP server, and managing system operations using the wcgw MCP server.

How to use

To use ws-mcp, first install the required ‘uv’ package. Then, create a configuration file to specify which MCP servers to run. You can start the server with default settings or specify a custom configuration and port using the command line.

Key features

Key features of ws-mcp include the ability to run multiple MCP servers simultaneously, easy configuration through JSON files, and real-time WebSocket communication for efficient data handling.

Where to use

ws-mcp can be used in various fields such as web development, system operations, and file management, particularly where real-time data processing and communication are required.

Content

ws-mcp

Wrap MCP stdio servers with a WebSocket.
For use with kibitz.

Quickstart

Prerequisites

Install uv:

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

Configuration

The config file specifies which MCP servers to run.
The default config (no --config or --command args provided) includes:

  • wcgw: For general system operations and file management
  • fetch: For making HTTP requests

To make a configuration file:

  1. Create your configuration file:
    cp sample.config.json config.json
    
  2. Modify config.json to add or remove servers based on your needs.
  3. Run with --config path/to/config.json to use the new config file.

Running ws-mcp

Basic usage with default config file (no --config or --command provided) and port:

uvx --refresh ws-mcp@latest

This will start all configured servers on the default port (10125).

To use a config file and port:

uvx --refresh ws-mcp@latest --config path/to/config --port 10125

Detailed Usage

# Example using fetch
uvx --refresh ws-mcp --command "uvx mcp-server-fetch" --port 3002

# Example using wcgw
## On macOS
uvx --refresh ws-mcp --command "uvx --from wcgw@latest --python 3.12 wcgw_mcp" --port 3001

## On Linux (or if you have issues on macOS with wcgw)
cd /tmp
git clone https://github.com/nick1udwig/wcgw.git
cd wcgw
git submodule update --init --recursive
git checkout hf/fix-wcgw-on-ubuntu
cd ..
uvx --refresh ws-mcp --command "uvx --from /tmp/wcgw --with /tmp/wcgw/src/mcp_wcgw --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

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers