Back to Integrations

Express.js Quickstart

Export OpenAPI specifications using swagger-jsdoc or similar in Node.js. Follow the flowchart below to set up your spec and link it with LegacyAI.

01

Expose OpenAPI Specification

Install swagger-jsdoc to generate the OpenAPI JSON file from JSDoc comments in your Express application.

// server.js
const express = require('express');
const swaggerJSDoc = require('swagger-jsdoc');
const app = express();

const options = {
  definition: {
    openapi: '3.0.0',
    info: { title: 'Express MCP Tools API', version: '1.0.0' },
  },
  apis: ['./server.js'],
};
const swaggerSpec = swaggerJSDoc(options);

app.get('/swagger.json', (req, res) => {
  res.setHeader('Content-Type', 'application/json');
  res.send(swaggerSpec);
});

app.listen(3000);
javascript
Tip:

Verify the schema loads correctly by visiting http://localhost:3000/swagger.json in your browser.

02

Generate the MCP Server

In the LegacyAI dashboard, create a project, choose "Express.js", and enter your spec URL: http://localhost:3000/swagger.json.

03

Register in Claude Desktop

Open your Claude Desktop configuration file and register the Express MCP tool server.

{
  "mcpServers": {
    "legacy-express-tools": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-openapi", "http://localhost:3000/swagger.json"]
    }
  }
}
json
Tip:

Locate your config file at %APPDATA%\Claude\claude_desktop_config.json on Windows.

04

Test in Claude Desktop

Relaunch Claude Desktop. Ask Claude to connect and call your Express routes.

Flowchart Complete