mcp-websocket mcp

v1.0.0 · MCP Tool · networking · registry.pascalai.org

WebSocket and HTTP client. Operations: ws_connect (connect+send+receive WebSocket message), http_get, http_post. Supports custom headers and timeouts.

websocketwshttpnetworkingrealtime

Input Parameters

ParameterTypeDescription
operationrequired string ws_connect: connect to WebSocket, send message, receive response; http_get/http_post: make HTTP request. One of: ws_connect, http_get, http_post.
urlrequired string WebSocket URL (ws:// or wss://) or HTTP URL.
wsMessageoptional string Message to send over WebSocket.
headersoptional string JSON object of HTTP/WebSocket headers.
httpMethodoptional string HTTP method override (GET, POST, PUT, DELETE).
bodyoptional string HTTP request body for POST/PUT.
timeoutSecoptional integer Timeout in seconds (default: 10). Default: 10.

Output Fields

FieldTypeDescription
response string
statusCode integer
headers object
ok boolean
error string

Examples

Send WebSocket message

// Input
{
  "operation": "ws_connect",
  "url": "ws://localhost:8080/ws",
  "wsMessage": "{\"type\":\"ping\"}",
  "timeoutSec": 5
}

// Output
{
  "response": "{\"type\":\"pong\"}",
  "ok": true
}

Install & Discovery

Install

ppm install mcp-websocket

Get JSON Schema

GET /v1/packages/mcp-websocket/1.0.0/schema

Discover by keyword

GET /v1/mcp/discover?q=websocket
Discovery hint: Install with ppm install mcp-websocket or invoke remotely via POST /v1/invoke/mcp-websocket on the MCP Service.

PascalAI Usage

uses toolslib;
var Tool := LoadTool('mcp-websocket');
var R := Tool.Call(JsonObj(['operation','http_get','url','https://api.example.com/health']));
Writeln(R.ToJSON);