MCP with Express

A starter example for using Express with Netlify to add serverless MCP to your project.


Model Context Protocol (MCP)

MCP is a lightweight protocol built to allow AI agents/clients to interact with servers to provide dynamic content, prompting, and tool calling. This is very important for websites wanting to provide a great agent experience (AX) through allowing agents to work dynamically with information and capabilities on the server.

Express

Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web applications.​

Try out this example

Using an MCP Client

Provide the following configuration to your MCP client. After connecting, you will see the tools, prompts, resources, etc. available to the agent.

{
  "mcpServers": {
    "express-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote@next",
        "https://mcp-example-express.netlify.app/mcp"
      ]
    }
  }
}

Using the MCP Inspector

MCP comes with an inspector tool for testing the server locally or remotely. Run the following command in your terminal to use the inspector. After connecting, you will see the tools, prompts, resources, etc. available to the agent.

npx @modelcontextprotocol/inspector npx mcp-remote@next https://mcp-example-express.netlify.app/mcp

Deploy your own

A great place to start is to clone and deploy your own copy of this example. You can do that by clicking the button below.

Deploy to Netlify

Clicking the button will clone this example from the examples repo and deploy it as a new site on Netlify


More information