MCP (Model Context Protocol) Server
LocalAbout MCP (Model Context Protocol) Server
A Node.js MCP server implementation for developers building real-time and HTTP services. It combines WebSocket communication with REST endpoints and static file serving.
Key features
- 01WebSocket communication
- 02REST API endpoints
- 03Static file serving
- 04CORS support
Use cases
- 01Testing WebSocket messages in a browser
- 02Echoing messages through the REST API
MCP support
It is an MCP server implementation. Its documented interfaces include WebSocket communication and REST API endpoints.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP (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 MIT License.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.