mcp-api-server

mcp-api-server

3.2

If you are the rightful owner of mcp-api-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 lightweight, high-performance API Server using ElysiaJS with Bun runtime, integrated with Model Context Protocol (MCP) and WebSocket support.

API & MCP Server Skeleton (ElysiaJS + Bun)

(Documentation is not yet complete.)

๐Ÿ“‘ Daftar Isi

A lightweight, high-performance API Server using ElysiaJS with Bun runtime, integrated with Model Context Protocol (MCP) and WebSocket support.

๐Ÿš€ Features

  • REST API Server powered by Bun runtime.
  • WebSocket Event Handling (realtime communication).
  • Model Context Protocol (MCP) base support:
    • MCP Plugin Registry
    • MCP Discovery Endpoint (/.well-known/mcp.json)
  • Hot reload during development.
  • Ready for scalable deployment.
  • Example Events: Prayer Schedule, Event Registration.

๐Ÿ“‹ Requirements

  • Bun runtime (v1.0+): Install Bun
  • Node.js (optional, for installing tools like wscat)
  • WebSocket client (Postman, wscat, etc.)

๐Ÿ› ๏ธ Getting Started

Clone this project and install dependencies:

git clone https://github.com/luridarmawan/mcp-api-server.git
cd mcp-api-server
bun install

Run development server:

bun run dev

Open http://localhost:3000 in your browser.

๐Ÿง  Model Context Protocol (MCP)

MCP is a lightweight communication protocol designed to enable context-aware interactions with AI agents or applications.

Example basic MCP interaction via WebSocket:

{
  "event": "prayer:schedule",
  "data": {
    "city": "Jakarta"
  }
}

For full details, see .

๐Ÿ”Œ WebSocket Usage

You can interact with the server via WebSocket:

  1. Install wscat if needed:
npm install -g wscat
  1. Connect to the WebSocket server:
wscat -c ws://localhost:3000
  1. Example Events you can send:
EventPayload ExampleDescription
prayer:schedule"Jakarta"Get prayer times for a city
registration:new{ "name": "Alice", "phone": "081122334455", "email": "alice@example.com" }Register a new user
# Install wscat (jika belum ada)
npm install -g wscat

# Connect ke socket server
wscat -c ws://localhost:3000

# Setelah terhubung, kirim event:
>> {"event":"prayer:schedule","data":{"city":"Jakarta"}}
>> {"event":"registration:new","data":{"name":"Alice","phone":"081122334455","email":"alice@example.com"}}

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ constants.ts
โ”œโ”€โ”€ index.test.ts
โ”œโ”€โ”€ index.ts
โ”œโ”€โ”€ modules
โ”‚ย ย  โ”œโ”€โ”€ mcp
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ index.ts
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ types.ts
โ”‚ย ย  โ”œโ”€โ”€ prayer
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ index.ts
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ types.ts
โ”‚ย ย  โ””โ”€โ”€ registration
โ”‚ย ย      โ”œโ”€โ”€ index.ts
โ”‚ย ย      โ””โ”€โ”€ types.ts
โ”œโ”€โ”€ services
โ”‚ย ย  โ””โ”€โ”€ prayerService.ts
โ”œโ”€โ”€ sockets
โ”‚ย ย  โ””โ”€โ”€ index.ts
โ””โ”€โ”€ utils
    โ””โ”€โ”€ http.ts

๐Ÿš€ Deployment

Build and run for production:

bun run build
bun start

Ready to deploy on platforms like Vercel, Railway, Fly.io, or any Bun-supported environment.

๐Ÿ“„ License

This project is licensed under the .

๐Ÿ“š References