Guides / Express.js
🟩 Express.js

Connect Express.js to Claude Desktop

Paste your router.get / app.post routes and get a hosted MCP server URL in under 2 minutes. Works with app and Router().

✓

Prerequisites

  • An Express.js app with defined routes (app.get, router.post, etc.)
  • Claude Desktop installed (claude.ai/download)
  • A free MCP Forge account — sign up here
1

Copy your route file

Open the file where you define your Express routes. MCP Forge recognises both app.* and Router() styles:

const express = require('express');
const router = express.Router();

// List all users
router.get('/users', getAll);

// Get single user
router.get('/users/:id', getById);

// Create user
router.post('/users', create);

// Update user
router.put('/users/:id', update);

// Delete user
router.delete('/users/:id', remove);

module.exports = router;
Tip: Path parameters like :id or :userId are automatically extracted and exposed as tool inputs. You don't need to annotate them.
2

Paste into the dashboard

Sign in to your dashboard and go to the Deploy tab. Paste your route file into the code editor. The framework is auto-detected — no need to specify Express.js manually.

Hit Generate + Deploy MCP Server →. The scanner extracts every route definition and builds a tool schema for each one.

3

Review the generated tools

The dashboard shows the tools found in your routes file:

Generated tools — users router
GET
getAll
/users
GET
getById
/users/:id
POST
create
/users
PUT
update
/users/:id
DELETE
remove
/users/:id

Your MCP server is live. Find the endpoint URL in the dashboard under Your MCP Endpoint.

4

Add to Claude Desktop

Open Claude Desktop → Settings → Developer → Edit Config and add your endpoint to claude_desktop_config.json:

{
  "mcpServers": {
    "my-users-api": {
      "url": "https://api.main-duck.com/mcp/YOUR_TENANT_ID/sse"
    }
  }
}

Replace YOUR_TENANT_ID with the value shown in your dashboard. Save the file and restart Claude Desktop.

Done. Claude can now call your Express routes. Try: "Get user 42" or "Create a new user with email jane@company.com."
⚡

Optional: Auto-sync on push

Keep tools in sync with your repo automatically — no re-pasting needed when routes change:

  1. Go to Dashboard → GitHub Sync
  2. Paste your repo URL and a GitHub Personal Access Token (read scope)
  3. Set the branch to watch (default: main)
  4. Copy the webhook URL into GitHub → Settings → Webhooks

Pushes to the configured branch trigger an automatic re-deploy of your MCP tools.