Get the FREE Ultimate OpenClaw Setup Guide →

adonis

An AdonisJS package for building remote MCP servers

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio 7nohe-adonis-mcp npx -y @7nohe/adonis-mcp

How to use

Adonis MCP adds support for the Model Context Protocol (MCP) to an AdonisJS project, enabling you to serve remote MCP resources and tools via Server-Sent Events (SSE). After installing and configuring, you register the MCP routes and tools in your Adonis app, define prompts and resources, and expose an SSE endpoint along with a messages endpoint. The server empowers clients to discover, query, and interact with tools and prompts defined in your Adonis application, using the MCP SDK structures exposed by the package. Start by wiring your routes in start/routes.ts, then launch your Adonis server and connect via SSE to the configured endpoints.

How to install

Prerequisites:

  • Node.js installed
  • An existing AdonisJS project
  1. Install the MCP package in your Adonis project:
node ace add @7nohe/adonis-mcp
  1. Generate and edit the MCP configuration:
  • After installation, a config/mcp.ts file will be generated.
  • Open config/mcp.ts and customize the endpoints and server options, for example:
import { defineConfig } from '@7nohe/adonis-mcp'

export default defineConfig({
  ssePath: '/sse',
  messagesPath: '/messages',
  serverOptions: {
    name: 'mymcp',
    version: '0.0.1',
  },
})
  1. Start the Adonis server (which also starts the MCP server via the package integration):
npm run dev
  1. Verify the MCP server is running at the configured SSE endpoint (e.g., http://localhost:3333/sse) and the messages endpoint (e.g., http://localhost:3333/messages).

Additional notes

Tips:

  • The MCP server in Adonis uses SSE to stream updates and responses to clients. Ensure your frontend or client supports SSE.
  • You can customize paths via ssePath and messagesPath in config/mcp.ts.
  • Use serverOptions.name and version to identify your MCP server in logs and responses.
  • If you encounter CORS issues during development, ensure your Adonis app is accessible from the client origin or enable appropriate CORS settings in your Adonis config.
  • The inspector tool can be used for debugging MCP connections by pointing it to http://localhost:3333/sse when the server is running.

Environment variables:

  • No required environment variables are documented for this package beyond your standard AdonisJS environment. You can add placeholders in mcp_config.env if you plan to inject runtime values.

Related MCP Servers

Sponsor this space

Reach thousands of developers