DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to serve MCP tools over HTTP from an Express app with TypeScript SDK

Add the Express middleware package so an existing web service can offer MCP tools over the Streamable HTTP transport.

Short answer: Install the server package with npm install @modelcontextprotocol/server; then add the adapter with npm install @modelcontextprotocol/express express, or npm install @modelcontextprotocol/fastify fastify for Fastify; For plain Node.js HTTP use npm install @modelcontextprotocol/node for the Streamable HTTP transport. All steps.

security. An HTTP MCP endpoint is reachable by anyone who can reach the server, so put authentication in front of it before exposing it publicly.

Who it is forA backend developer who already runs an Express or Fastify service.

The problemA stdio server only works locally; remote agents need an HTTP endpoint.

The outcomeYour existing web app answering MCP requests next to its normal routes.

What you need first

  • Node.js with npm, or Bun or Deno as the README shows
  • The server package from `npm install @modelcontextprotocol/server`, or the client package from `npm install @modelcontextprotocol/client`
  • zod for tool input schemas, as in the README example

Steps

  1. Install the server package with npm install @modelcontextprotocol/server
  2. Add the adapter with npm install @modelcontextprotocol/express express, or npm install @modelcontextprotocol/fastify fastify for Fastify
  3. For plain Node.js HTTP use npm install @modelcontextprotocol/node for the Streamable HTTP transport
  4. Register your tools on an McpServer and mount it through the adapter, following the middleware README

Prompt for your agent

With modelcontextprotocol/typescript-sdk, add MCP to my Express service <repo path>: run `npm install @modelcontextprotocol/express express`, register <my tools> on an McpServer and expose it over Streamable HTTP.

Caveat. The README says the middleware packages are intentionally thin adapters and add no MCP features or business logic of their own.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for modelcontextprotocol/typescript-sdk and "Serve MCP tools over HTTP from an Express app"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer