WebSocket MCP
@zeropointo
Model Context Protocol (MCP) server and client with a custom websocket transport layer.
Overview
What is WebSocket MCP?
WebSocket MCP is an implementation of the Model Context Protocol (MCP) using WebSocket transport, including a server, client, and a local LLM chat bot demo. It aims to overcome the limitations of the default stdio and SSE transport layers.
How to use WebSocket MCP?
Run uv run local-llm-server to start the server, which defaults to ws://0.0.0.0:8766. Connect a client with uv run local-llm-client --server-ip <IP> to interact with the LLM.
Key features of WebSocket MCP
- WebSocket transport for efficient message exchange
- Supports resource listing and data streaming
- Local LLM integration via the
ollamapackage - Extensible to handle various request and notification types
- Command-line configurable for local or remote operation
Use cases of WebSocket MCP
- Running a local LLM chatbot with WebSocket-based MCP
- Building custom MCP servers and clients beyond stdio and SSE
- Prototyping AI applications requiring flexible transport
FAQ from WebSocket MCP
How does WebSocket MCP differ from default MCP transports?
It uses WebSocket instead of stdio or SSE to overcome their limitations in efficiency and flexibility.
What are the dependencies?
The project depends on the ollama package for listing available LLM models.
Where does the LLM run?
The local LLM server runs locally and handles requests for generating responses based on provided prompts.
Does WebSocket MCP support authentication?
No authentication mechanism is mentioned in the README for the WebSocket connection.
What LLM models are available?
Models such as llava:13b, deepseek-r1:8b, llama3.1:8b, and others are listed in the client output.