Wrap MCP servers with WebSocket for seamless integration and remote management
ws-mcp is a WebSocket wrapper designed to integrate Model Context Protocol (MCP) servers with WebSockets, allowing real-time communication between various AI applications and backend services. It enables developers to connect AI tools like Claude Desktop, Continue, Cursor, and other MCP clients to specific data sources or tools using a standardized protocol.
ws-mcp offers essential capabilities that enhance the functionality of MCP servers:
These features make ws-mcp a powerful tool in building versatile AI workflows with seamless integration across various platforms.
MCP architecture is designed to standardize the interaction between AI applications and backend services, using WebSocket as a key component. The protocol flow involves:
graph TD
A[AI Application] -->|WebSocket Request| B[MCP Server]
B --> C[MCP Protocol]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#ffffff
style D fill:#e8f5e8
graph TD
U[User Input] --> V[MCP Client]
V --> W[MCP Protocol]
W --> X[MCP Server]
X --> Y[Data Source/Tool]
Y --> Z[Processed Output]
style U fill:#f5f8e1
style V fill:#e5f3fe
style W fill:#ffffff
style X fill:#f5fafa
style Y fill:#ffeecc
style Z fill:#ffe6ff
To get ws-mcp running, follow these steps:
Install Dependencies: Ensure you have uv
installed.
curl -LsSf https://astral.sh/uv/install.sh | sh
Create Configuration File: Copy the sample configuration file to your working directory and modify it as needed.
cp sample.config.json config.json
uvx --refresh ws-mcp@latest
uvx --refresh ws-mcp@latest --config path/to/config.json --port 10125
ws-mcp allows developers to integrate various AI workflows, such as:
Suppose you need an endpoint where a user can fetch real-time data from an external API in the context of using Claude Desktop. You would use uvx mcp-server-fetch
:
uvx --refresh ws-mcp --command "uvx mcp-server-fetch" --port 3002
This setup allows your AI application to query and receive real-time data seamlessly.
For system operations and file management, use wcgw
server integrated into the workflow. On macOS:
uvx --refresh ws-mcp --command "uvx --from wcgw@latest --python 3.12 wcgw_mcp" --port 3001
This command ensures that system operations can be controlled via WebSocket connections.
ws-mcp is compatible with various MCP clients, including but not limited to:
Below is a compatibility matrix highlighting the status of each client:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
The performance and compatibility of ws-mcp are robust:
Here's a sample configuration file illustrating how to set up different server commands with environment variables:
{
"mcpServers": {
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"],
"env": {
"API_KEY": "your-api-key"
}
},
"wcgw": {
"command": "uvx --from wcgw@latest --python 3.12 wcgw_mcp"
}
}
}
Advanced configuration and security measures are crucial for maintaining a secure environment:
What is the difference between ws-mcp and typical MCP servers?
Can I use ws-mcp with different AI applications?
How do I secure my MCP server setup?
Can ws-mcp handle complex real-time workflows?
Is there a performance impact when using multiple servers with ws-mcp?
Contributing to the ws-mcp project involves the following steps:
Explore additional resources to leverage MCP further:
By utilizing ws-mcp, developers can streamline their AI application workflows while ensuring compatibility and real-time responsiveness.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration