Netlify MCP Server
A Model Context Protocol server that allows management of Netlify sites, enabling users to create, list, get information about, and delete Netlify sites directly from an MCP-enabled environment.
README Documentation
Netlify MCP Server
A Model Context Protocol (MCP) server for managing Netlify sites. This server enables seamless integration with Netlify's API through MCP, allowing you to create, manage, and deploy sites directly from your MCP-enabled environment.
Features
- 🚀 Create new sites from GitHub repositories
- 📋 List existing Netlify sites with pagination
- 🔍 Get detailed site information
- 🗑️ Delete sites
- 🔐 Secure authentication with Netlify API
- ⚡ Built with TypeScript for type safety
- 🐳 Docker support for easy deployment
Requirements
- Node.js 18 or higher
- A Netlify account with API access
- A GitHub repository for deploying sites
Installation
From Source
- Clone this repository:
git clone https://github.com/MCERQUA/netlify-mcp.git
cd netlify-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
Using Docker
docker build -t netlify-mcp .
docker run -e NETLIFY_ACCESS_TOKEN=your_token_here netlify-mcp
Configuration
Getting Your Netlify Access Token
- Create a Netlify account at https://app.netlify.com/signup
- Go to User Settings > Applications > Personal access tokens
- Click "New access token"
- Give it a name (e.g., "MCP Integration")
- Copy the generated token
Setting Up MCP
- Create a
.env
file in the project root:
NETLIFY_ACCESS_TOKEN=your_token_here
- Add the server to your MCP settings configuration:
{
"mcpServers": {
"netlify": {
"command": "node",
"args": ["path/to/netlify-mcp/build/index.js"],
"env": {
"NETLIFY_ACCESS_TOKEN": "your_token_here"
},
"disabled": false,
"autoApprove": []
}
}
}
Available Tools
createSiteFromGitHub
Create a new Netlify site from a GitHub repository.
interface CreateSiteFromGitHubArgs {
name: string; // Name for the new site (subdomain)
repo: string; // GitHub repository (format: owner/repo)
branch?: string; // Branch to deploy from (default: main)
buildCommand: string; // Build command to run
publishDir: string; // Directory containing the built files
envVars?: Record<string, string>; // Environment variables
}
listSites
List all Netlify sites you have access to.
interface ListSitesArgs {
filter?: 'all' | 'owner' | 'guest'; // Filter for sites
page?: number; // Page number for pagination
perPage?: number; // Items per page (max 100)
}
getSite
Get detailed information about a specific site.
interface GetSiteArgs {
siteId: string; // ID or name of the site
}
deleteSite
Delete a Netlify site.
interface DeleteSiteArgs {
siteId: string; // ID or name of the site
}
Documentation
For more detailed information, see:
Development
# Run in development mode with auto-rebuild
npm run dev
# Clean build artifacts
npm run clean
# Build the project
npm run build
Troubleshooting
Common Issues
-
"NETLIFY_ACCESS_TOKEN environment variable is required"
- Make sure you've set the token in your environment or
.env
file
- Make sure you've set the token in your environment or
-
"Failed to create site: 401 Unauthorized"
- Your access token might be invalid or expired
- Generate a new token from Netlify settings
-
"Invalid repo format"
- Ensure the repository is in format
owner/repo
- Example:
facebook/react
, nothttps://github.com/facebook/react
- Ensure the repository is in format
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Model Context Protocol for the MCP framework
- Netlify for their excellent deployment platform