
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@mcpx-protocol/gateway
Advanced tools
A reference implementation of the MCPx v0 protocol server providing WebSocket-based real-time communication for multi-agent MCP collaboration.
cd server
npm install
Copy the example environment file and configure:
cp .env.example .env
Edit .env with your settings, especially:
JWT_SECRET: Set a secure secret for productionPORT: Server port (default: 3000)npm run dev
The server will start on http://localhost:3000 with:
ws://localhost:3000/v0/wshttp://localhost:3000/healthhttp://localhost:3000/v0/npm run build
npm start
Generate a token for testing:
curl -X POST http://localhost:3000/v0/auth/token \
-H "Content-Type: application/json" \
-d '{"participantId": "test-user", "topic": "room:test"}'
Connect to a topic:
const ws = new WebSocket('ws://localhost:3000/v0/ws?topic=room:test', {
headers: {
'Authorization': 'Bearer your-jwt-token'
}
});
All messages follow the MCPx v0 envelope format:
{
"protocol": "mcp-x/v0",
"id": "uuid",
"ts": "2025-08-19T...",
"from": "participant-id",
"to": ["target-id"],
"kind": "mcp",
"payload": {
"jsonrpc": "2.0",
"method": "tools/call",
"params": { ... }
}
}
GET /v0/topics - List topicsGET /v0/topics/{topic}/participants - Get participantsGET /v0/topics/{topic}/history - Get message historyPOST /v0/auth/token - Generate auth token (dev only)| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Server port |
JWT_SECRET | dev-secret... | JWT signing secret |
TOKEN_EXPIRY | 1h | Token expiration time |
MAX_PARTICIPANTS_PER_TOPIC | 50 | Max participants per topic |
HISTORY_LIMIT | 1000 | Max stored messages per topic |
RATE_LIMIT_MESSAGES | 60 | Messages per minute per participant |
RATE_LIMIT_CHAT | 10 | Chat messages per minute per participant |
CORS_ORIGIN | localhost:3001,localhost:5173 | Allowed CORS origins |
src/
├── types/ # TypeScript type definitions
│ ├── mcpx.ts # MCPx protocol types
│ └── server.ts # Server-specific types
├── services/ # Core business logic
│ ├── AuthService.ts # JWT authentication
│ └── TopicService.ts # Topic and message management
├── routes/ # API endpoints
│ ├── api.ts # REST API routes
│ └── websocket.ts# WebSocket handling
├── config.ts # Configuration loading
└── index.ts # Main server entry point
The server includes comprehensive unit and integration tests.
npm test # Run all unit tests (48 tests)
npm run test:watch # Run tests in watch mode for development
npm run test:coverage # Run tests with coverage report
npm run test:integration # Run integration tests only (6 tests)
Unit Tests (48 tests - 100% passing)
Integration Tests (6 tests - 5 passing)
Tests require Node.js and npm dependencies. No external services needed - tests use in-memory configuration.
npm run typecheck
npm run lint
const ws = new WebSocket('ws://localhost:3000/v0/ws?topic=room:chat', {
headers: { 'Authorization': 'Bearer your-token' }
});
ws.on('message', (data) => {
const envelope = JSON.parse(data.toString());
console.log('Received:', envelope);
});
// Send a chat message
const chatMessage = {
protocol: 'mcp-x/v0',
id: crypto.randomUUID(),
ts: new Date().toISOString(),
from: 'chat-bot',
kind: 'mcp',
payload: {
jsonrpc: '2.0',
method: 'notifications/chat/message',
params: {
text: 'Hello everyone!',
format: 'plain'
}
}
};
ws.send(JSON.stringify(chatMessage));
FAQs
MCPx Reference Gateway Server
We found that @mcpx-protocol/gateway demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.