mcpField
A
API & MCP Server Skeleton (ElysiaJS + Bun)

API & MCP Server Skeleton (ElysiaJS + Bun)

Local
github.com/luridarmawanDeveloper Tools2Updated 75w ago

About API & MCP Server Skeleton (ElysiaJS + Bun)

This ElysiaJS and Bun skeleton provides a starting point for building API servers with REST, WebSocket, and MCP support. It includes an MCP plugin registry and discovery endpoint, alongside development hot reload.

Key features

  1. 01REST API server on Bun
  2. 02WebSocket event handling
  3. 03MCP plugin registry
  4. 04MCP discovery endpoint
  5. 05Development hot reload

Use cases

  1. 01Build an API with REST and MCP support
  2. 02Handle real-time events over WebSocket

MCP support

The skeleton includes MCP base support, a plugin registry, and a discovery endpoint at `/.well-known/mcp.json`. Its documented MCP base URL is `/mcp`.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

API & MCP Server Skeleton (ElysiaJS + Bun)

bun elysia mcp websocket license

(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 MCP and API Explanation.

🔌 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": "[email protected]" }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":"[email protected]"}}

📁 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 Apache 2.0 License.

📚 References

Comments

Markdown supported

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.