API & MCP Server Skeleton (ElysiaJS + Bun)

by luridarmawan

2 stars
203 downloads
Not rated
GitHub

About

A lightweight, high-performance API server built with ElysiaJS on the Bun runtime. It integrates Model Context Protocol (MCP) for context-aware AI interactions and includes WebSocket support for real-time communication. Designed for developers who need a fast, scalable server…

Details

Author
luridarmawan
GitHub stars
2
Downloads
203
Categories
Developer Tools

- REST API server powered by Bun runtime.
- WebSocket event handling for real-time communication.
- Model Context Protocol (MCP) support with plugin registry and discovery endpoint.
- Hot reload during development.
- Scalable deployment ready.
- Example events: Prayer Schedule and Event Registration.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name API & MCP Server Skeleton (ElysiaJS + Bun)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies with bun install, and start the development server with bun run dev. Access the base API at http://localhost:3000. For WebSocket interactions, connect using a client like wscat to ws://localhost:3000 and send JSON events (e.g., prayer:schedule). For MCP discovery, use the endpoint http://localhost:3000/mcp/.well-known/mcp.json. Build for production with bun run build and start with bun start.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "api & mcp server skeleton (elysiajs + bun)": {
            "mcp-api-server": {
                "command": "bun",
                "args": [
                    "run",
                    "dev"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-api-server": {
        "command": "bun",
        "args": [
            "run",
            "dev"
        ]
    }
}

API & MCP Server Skeleton (ElysiaJS + Bun)

bun
elysia
mcp
websocket
license

__(Documentation is not yet complete.)__

<!-- TOC -->
<details>
<summary>📑 Daftar Isi</summary>

- API & MCP Server Skeleton (ElysiaJS + Bun)
- 🚀 Features
- 📌 Requirements
- 🛠️ Getting Started
- 🧠 Model Context Protocol (MCP)
- 🔌 WebSocket Usage
- 📁 Project Structure
- 🚀 Deployment
- 🔖 License
- 📘 References
- MCP vs Traditional API
</details>

---

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.

- Base URL: http://localhost:3000/mcp
- Discovery Endpoint: http://localhost:3000/mcp/.well-known/mcp.json

Example basic MCP interaction via WebSocket:

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

For full details, see MCP and API Explanation.

🔌 WebSocket Usage

You can interact with the server via WebSocket:

1. Install wscat if needed:

npm install -g wscat

2. Connect to the WebSocket server:

wscat -c ws://localhost:3000

3. Example Events you can send:

| Event | Payload Example | Description |
|---|---|---|
| prayer:schedule | "Jakarta" | Get prayer times for a city |
| registration:new | { "name": "Alice", "phone": "081122334455", "email": "alice@example.com" } | Register a new user |

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.