kritsanan1/mcp-server
3.1
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A simple MCP server implementation with WebSocket and REST API support.
MCP (Model Context Protocol) Server
A simple MCP server implementation with WebSocket and REST API support.
Features
- WebSocket server for real-time communication
- REST API endpoints
- Static file serving
- CORS support
Getting Started
Prerequisites
- Node.js (v14 or later)
- npm (comes with Node.js)
Installation
-
Clone the repository:
git clone <repository-url> cd mcp-server
-
Install dependencies:
npm install
Running the Server
Start the server with the following command:
node server.js
The server will start on port 3000 by default. You can change the port by setting the PORT
environment variable.
API Endpoints
GET /
- Server statusPOST /api/echo
- Echo the provided message- Request body:
{ "message": "Hello" }
- Response:
{ "echo": "Hello" }
- Request body:
WebSocket
The WebSocket server runs on the same port as the HTTP server. Connect using:
ws://localhost:3000
Testing
Open your browser and navigate to:
http://localhost:3000
You'll find a test page where you can:
- Test WebSocket connections
- Send and receive messages
- Test the REST API
License
This project is open source and available under the .