- Home
- MCP servers
- MCP example Netlify Express
MCP example Netlify Express
- html
0
GitHub Stars
html
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run a minimal MCP server using Netlify Functions with an Express-style route and access it via a dedicated MCP URL. This example demonstrates how to expose an MCP endpoint, test it locally, and interact with it from an MCP client or inspector.
How to use
Use the MCP endpoint exposed by the Netlify Functions backend to perform MCP operations from your client or inspector. The local server will respond at the MCP path you configure, and you can validate behavior with dedicated MCP tools. To access the endpoint during development, point your MCP client to the local URL shown below.
How to install
Prerequisites you need before starting:
[[redirects]]
force = true
from = "/mcp"
status = 200
to = "/.netlify/functions/express-mcp-server"
Additional sections
Configuration, security notes, and practical usage details directly reflect how this Netlify-based MCP example routes requests and exposes the MCP endpoint.
Local testing workflow and example commands shown in this guide help you iterate on your own MCP server implementation. The MCP inspector and a remote MCP client can be used to verify interactions against the local endpoint.
Notes and example commands
The following commands illustrate the local testing flow described in this example. Run these in separate terminals as needed.
# 1. Clone the examples repository to your local development environment
git clone git@github.com:netlify/examples
# 2. Move into the project directory for this example
cd examples/mcp/express-mcp
# 3. Install the Netlify CLI to let you locally serve your site using Netlify's features
npm i -g netlify-cli
# 4. Serve your site using Netlify Dev to get local serverless functions
netlify dev
# 5. While the site is running locally, open a separate terminal tab to run the MCP inspector or client you desire
npx @modelcontextprotocol/inspector http://localhost:8888/mcp
Available tools
inspector
MCP inspector tool used to validate and visualize interactions with an MCP endpoint.
mcp_remote
Command-line client for interacting with an MCP server via a specified URL.
netlify_dev
Netlify Dev tool to run local serverless functions and test MCP endpoints in a local environment.