Skip to main content

MCP WebSocket Server with stdio support

Project description

MCP WebSocket Server

This project implements an MCP (Model Context Protocol) server with WebSocket enhancements for real-time data updates. It allows clients to make standard MCP requests while also enabling WebSocket-based subscriptions to receive push notifications when new data becomes available.

Features

  • MCP Server (Port 8080): Handles standard MCP requests from clients.
  • WebSocket Server (Port 8765): Allows clients to subscribe for real-time updates.
  • Push Notifications: Sends updates to all subscribed clients when new data is available.
  • Async Architecture: Uses asyncio for efficient non-blocking operations.

Installation

  1. Clone this repository:
    git clone https://github.com/your-repo/mcp-websocket-server.git
    cd mcp-websocket-server
    
  2. Install dependencies:
    pip install websockets mcp-sdk  # Replace with actual MCP SDK package name
    

Usage

Start the Server

Run the following command to start both the MCP and WebSocket servers:

python server.py

Connecting via WebSockets

Clients can connect to the WebSocket server (ws://localhost:8765) and subscribe to updates by sending:

{"action": "subscribe"}

Sending MCP Requests

MCP clients can send requests to the MCP server at http://localhost:8080 with a payload like:

{"method": "get_data"}

The server will respond with:

{"result": "Here is your data!"}

License

This project is licensed under the MIT License.

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.

Contact

For questions or suggestions, reach out via [virajsharma@sharmaviraj.com].

mcp-websocket

This server implements an MCP (Model Context Protocol) server with WebSocket enhancements for real-time data updates.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_virajsharma2000_mcp_websocket-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_virajsharma2000_mcp_websocket-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_virajsharma2000_mcp_websocket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 11ac502ba0719b5e758738a3a0bd43fbf00203b06ef85865166bf788e4a1c806
MD5 709787a8b01bc7ab87eb322370e712f7
BLAKE2b-256 d6025a6d2d0638a0c19a3e7a169f602c4f653d04120a9791c73f9759c420d958

See more details on using hashes here.

File details

Details for the file iflow_mcp_virajsharma2000_mcp_websocket-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_virajsharma2000_mcp_websocket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_virajsharma2000_mcp_websocket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db5364f2b09dc74067d00065e878d6c6af2614bad4b7adaf1776f46a0e0b4ed2
MD5 637e6a40d3612d60a0008cb16b892375
BLAKE2b-256 ea4b3221b16bbbfef007e6d2c2a1041a15fc8ad7009f03c643e90f36ba67f95b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page