A Model Context Protocol (MCP) server that provides tools and resources for interacting with Netlify through their CLI. This server enables deploying sites, managing environment variables, builds, and more, compatible with Netlify CLI v19.1.5.
dns
, forms
, plugins
, hooks
, deploys
. Specific commands like functions:delete
, functions:invoke
, and sites:get
were also removed as they were either unavailable or incompatible with non-interactive use via the MCP server.env:*
, logs:function
, build
, trigger-build
) to pass the siteId
via the NETLIFY_SITE_ID
environment variable, as the --site
flag is not supported for these commands in this CLI version.deploy-site
, build-site
, trigger-build
, link-site
, unlink-site
, get-status
, create-site
, delete-site
)set-env-vars
, get-env-var
, unset-env-var
, import-env
, clone-env-vars
)get-logs
)list-sites
, list-functions
, list-env-vars
)To install Netlify MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @DynamicEndpoints/Netlify-MCP-Server --client claude
npm install
npm run build
# Example global install:
npm install -g netlify-cli@19.1.5
This MCP server interacts with the Netlify CLI, which requires authentication with your Netlify account. Since the server runs non-interactively, you must use a Personal Access Token (PAT).
NETLIFY_AUTH_TOKEN
environment variable. Add it to the env
section of the server's configuration in your MCP settings file (see below).Note: Using netlify login
is not suitable for this server as it requires interactive browser authentication.
Add the following configuration to your MCP settings file (location varies by platform), replacing "YOUR_NETLIFY_PAT_HERE"
with your actual Personal Access Token:
{
"mcpServers": {
"netlify": {
"command": "node",
"args": ["/path/to/Netlify-MCP-Server/build/index.js"], // Adjust path if needed
"env": {
"NETLIFY_AUTH_TOKEN": "YOUR_NETLIFY_PAT_HERE"
},
"disabled": false,
"autoApprove": []
}
}
}
Replace /path/to/Netlify-MCP-Server
with the actual path where you cloned/installed the server.
Settings file locations:
~/Library/Application Support/Claude/claude_desktop_config.json
/home/user/.codeoss-cloudworkstations/data/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
(or similar based on OS/setup)(Parameters are based on the Zod schemas defined in src/index.ts
)
Deploy a site directory to Netlify.
{
"path": "string", // Required: Path to the site directory
"prod": "boolean?", // Optional: Deploy to production
"message": "string?" // Optional: Deploy message
}
Example:
{
"path": "./dist",
"prod": true,
"message": "Deploying latest changes"
}
List all Netlify sites linked to your account.
{} // No parameters
Example:
{}
Trigger a new build/deploy for a site. Site context is passed via NETLIFY_SITE_ID
env var.
{
"siteId": "string", // Required: Site ID or name
"message": "string?" // Optional: Deploy message
}
Example:
{
"siteId": "your-site-id-here",
"message": "Triggering rebuild"
}
Run a Netlify build locally (mimics Netlify build environment). Site context is passed via NETLIFY_SITE_ID
env var if siteId
is provided.
{
"siteId": "string?", // Optional: Site ID (if project dir not linked)
"context": "string?", // Optional: Build context (e.g., 'production', 'deploy-preview')
"dry": "boolean?" // Optional: Run a dry build (list steps without executing)
}
Example:
{
"siteId": "your-site-id-here",
"context": "production"
}
Link the current project directory to a Netlify site (requires Site ID for non-interactive use).
{
"siteId": "string" // Required: Site ID to link to.
}
Example:
{
"siteId": "your-site-id-here"
}
Unlink the current project directory from the associated Netlify site.
{} // No parameters
Example:
{}
Show the Netlify status for the linked site/directory. (Will likely fail if run via MCP server unless the server directory itself is linked).
{} // No parameters
Example:
{}
Create a new site on Netlify (non-interactively).
{
"name": "string?", // Optional: Site name (subdomain)
"accountSlug": "string?" // Optional: Account slug for the team (defaults to 'playhousehosting' if omitted)
}
Example:
{
"name": "my-awesome-new-site"
}
Delete a site from Netlify.
{
"siteId": "string", // Required: Site ID to delete
"force": "boolean?" // Optional: Force deletion without confirmation (default: true)
}
Example:
{
"siteId": "site-id-to-delete",
"force": true
}
Set one or more environment variables for a site. Site context is passed via NETLIFY_SITE_ID
env var.
{
"siteId": "string", // Required: Site ID or name
"envVars": { // Required: Object of key-value pairs
"KEY": "value"
}
}
Example:
{
"siteId": "your-site-id-here",
"envVars": {
"API_KEY": "secret123",
"NODE_ENV": "production"
}
}
Get the value of a specific environment variable. Site context is passed via NETLIFY_SITE_ID
env var if siteId
is provided.
{
"siteId": "string?", // Optional: Site ID (if not linked)
"key": "string", // Required: The environment variable key
"context": "string?", // Optional: Specific context (e.g., 'production')
"scope": "string?" // Optional: Specific scope (e.g., 'builds', 'functions')
}
Example:
{
"siteId": "your-site-id-here",
"key": "API_KEY"
}
Unset (delete) an environment variable. Site context is passed via NETLIFY_SITE_ID
env var if siteId
is provided.
{
"siteId": "string?", // Optional: Site ID (if not linked)
"key": "string", // Required: The environment variable key
"context": "string?" // Optional: Specific context to unset from (otherwise all)
}
Example:
{
"siteId": "your-site-id-here",
"key": "OLD_VAR"
}
Import environment variables from a .env
file. Site context is passed via NETLIFY_SITE_ID
env var.
{
"siteId": "string", // Required: Site ID or name
"filePath": "string", // Required: Path to the .env file
"replace": "boolean?" // Optional: Replace existing variables instead of merging
}
Example:
{
"siteId": "your-site-id-here",
"filePath": ".env.production",
"replace": true
}
Clone environment variables from one site to another. Requires source site to be linked or specified via NETLIFY_SITE_ID
.
{
"fromSiteId": "string", // Required: Source Site ID
"toSiteId": "string" // Required: Destination Site ID
}
Example:
{
"fromSiteId": "source-site-id",
"toSiteId": "destination-site-id"
}
View function logs. Site context is passed via NETLIFY_SITE_ID
env var.
{
"siteId": "string", // Required: Site ID or name
"function": "string?" // Optional: Specific function name to filter logs
}
Example:
{
"siteId": "your-site-id-here",
"function": "my-serverless-func"
}
Access Netlify data directly using these resource URIs:
netlify://sites
: List all sites (JSON output of sites:list --json
)netlify://sites/{siteId}/functions
: List functions for a site (JSON output of functions:list --json
, requires NETLIFY_SITE_ID={siteId}
env var)netlify://sites/{siteId}/env
: List environment variables for a site (JSON output of env:list --json
, requires NETLIFY_SITE_ID={siteId}
env var)netlify login
, netlify init
, netlify dev
) are not supported by this server. Use a Personal Access Token for authentication.env:*
, logs:function
, build
, trigger-build
, functions:list
) require site context. This server passes the required siteId
via the NETLIFY_SITE_ID
environment variable when executing these commands. Commands like status
and unlink
operate on the current working directory of the server, which is typically not linked, and thus may not function as expected when called via the MCP server.To modify the server:
src/index.ts
.npm run build
.Seamless access to top MCP servers powering the future of AI integration.