Fastly NGWAF MCP Server
The Fastly NGWAF MCP Server provides comprehensive management of Fastly's Next-Gen Web Application Firewall through an AI-assisted natural language interface with multi-tenancy support. Key capabilities include:
š”ļø WAF Management: Create, update, delete, and manage security rules, IP allow/block lists, and configure rate limiting
š¢ Multi-tenancy: Manage corporations and sites, set context-aware defaults, and perform bulk operations
š¤ AI Integration: Use natural language to create rules, detect threats, and receive policy suggestions
š Security Monitoring: View events, search request logs, identify suspicious IPs, and manage incident response
š Analytics & Reporting: Access attack trends, security metrics, and high-level summaries
š§ Administration: Manage custom lists, alerts, CloudWAF instances, and user roles/access
š Automation: Streamline security tasks, incident response, and bulk rule application
Integrates with Fastly's Next-Gen Web Application Firewall (NGWAF) API, allowing management of security rules, IP allowlists/blocklists, rate limiting, alerts, and security event monitoring across multiple sites and corporations.
Requires Node.js 18+ as a prerequisite for running the server.
Supports implementation of protection against OWASP top 10 vulnerabilities through rule creation and configuration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Fastly NGWAF MCP Server block IP 192.168.1.100 for 24 hours due to suspicious activity"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fastly NGWAF MCP Server
A comprehensive Model Context Protocol (MCP) server that provides seamless integration with the Fastly NGWAF (Next-Gen Web Application Firewall) API. This server enables AI assistants like Claude to manage web application security through natural language interactions.
Features
š”ļø Complete WAF Management
Create, read, update, and delete security rules
Manage IP allow/block lists
Configure rate limiting and alerts
Monitor security events and analytics
š¢ Multi-tenancy Support
Corporation and site-level management
Context-aware operations
Bulk operations across multiple sites
š¤ AI-Friendly Interface
Natural language rule creation
Intelligent threat pattern detection
Automated security policy suggestions
Related MCP server: @fastly/mcp
Installation
Prerequisites
Node.js 18+
Fastly NGWAF account with API access
MCP-compatible AI assistant (Claude Desktop, etc.)
Setup
Clone the repository
git clone https://github.com/yourusername/FastlyMCP.git
cd FastlyMCPInstall dependencies
npm installConfigure environment variables (optional)
# Create .env file
FASTLY_NGWAF_EMAIL=your-email@example.com
FASTLY_NGWAF_TOKEN=your-api-token
FASTLY_NGWAF_DEFAULT_CORP=your-corp-name
FASTLY_NGWAF_DEFAULT_SITE=your-site-nameStart the server
npm startConfiguration
Claude Desktop Integration
Add this to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"fastly-ngwaf": {
"command": "node",
"args": ["path/to/FastlyMCP/server.js"],
"env": {
"FASTLY_NGWAF_EMAIL": "your-email@example.com",
"FASTLY_NGWAF_TOKEN": "your-api-token"
}
}
}
}AI-Powered Interactions
Natural Language: "Create a rule to block SQL injection attacks on my website"
AI Response: The assistant will automatically:
Detect the intent (create security rule)
Identify the threat type (SQL injection)
Generate appropriate rule conditions
Apply the rule to your configured site
Available Tools
Authentication & Setup
set_credentials- Configure API credentialstest_connection- Validate API connectivityset_context- Set default corp/site contextdiscover_environment- Explore available resources
Rule Management
list_corp_rules/list_site_rules- List security rulescreate_corp_rule/create_site_rule- Create new rulesdelete_corp_rule/delete_site_rule- Remove rules
Security Monitoring
list_events- View security eventssearch_requests- Search request logsget_suspicious_ips- Identify threat sourcesexpire_event- Manually unblock IPs
IP List Management
manage_whitelist- Allow/block IP addressesmanage_blacklist- Block malicious IPsmanage_lists- Custom IP/country/string lists
Analytics & Reporting
get_analytics- Security metrics and trendsget_corp_overview- High-level attack summarymanage_alerts- Configure monitoring alerts
Advanced Features
manage_cloudwaf- CloudWAF instance managementmanage_users- User access control
Common Use Cases
šØ Incident Response
"An IP address 1.2.3.4 is attacking my site, block it immediately"
AI automatically identifies the threat
Adds IP to blacklist with appropriate duration
Confirms blocking is active
š”ļø Proactive Security
"Set up protection against the latest OWASP top 10 vulnerabilities"
Creates comprehensive rule sets
Configures appropriate thresholds
Sets up monitoring alerts
š Security Analytics
"Show me attack trends from the past month and suggest improvements"
Analyzes historical attack data
Identifies patterns and threat sources
Recommends rule optimizations
š§ Bulk Management
"Apply the same security rules from site A to sites B, C, and D"
Exports existing rule configurations
Adapts rules for different sites
Bulk applies with verification
API Reference
The server exposes the complete Fastly NGWAF API through intuitive MCP tools. Each tool maps to specific API endpoints while handling authentication, context resolution, and error management automatically.
Rate Limiting
The server respects Fastly API rate limits and implements appropriate retry logic.
Development
Project Structure
FastlyMCP/
āāā server.js # Main MCP server implementation
āāā package.json # Dependencies and scripts
āāā README.md # This documentation
āāā .env.example # Environment variable templateTesting
# Test API connectivity
npm start
# In another terminal/AI session:
# test_connection()Troubleshooting
Common Issues
Authentication Failed
Verify email and API token are correct
Ensure token has appropriate permissions
Check Fastly account status
Context Errors
Set default corporation:
set_context({ corpName: "your-corp" })Verify corp/site names exist:
discover_environment()
Permission Denied
Check user role has necessary permissions
Verify site access in Fastly dashboard
Debug Mode
Enable verbose logging by setting environment variable:
DEBUG=fastly-ngwaf npm startSecurity Considerations
Store API credentials securely (environment variables or secure credential managers)
Use principle of least privilege for API tokens
Regularly rotate API credentials
Monitor for unauthorized API usage
Keep dependencies updated
License
MIT License - see LICENSE file for details.
Support
Changelog
v1.0.0
Initial release with complete NGWAF API coverage
MCP server implementation
Rule management (CRUD operations)
IP list management
Analytics and monitoring
CloudWAF support
User management features
Available Tools
29 toolscreate_corp_ruleC
Create a corporation-level rule
Inputs: type (required), groupOperator (required), conditions (required), actions (required), +6 more.
create_siteC
Create a new site in a corporation
Inputs: siteName (required), corpName, displayName, agentLevel, +3 more.
create_site_ruleC
Create a site-level rule
Inputs: type (required), groupOperator (required), conditions (required), actions (required), +8 more.
delete_corp_ruleC
Delete a corporation-level rule
Inputs: ruleId (required), corpName.
delete_siteC
Delete a site
Inputs: corpName, siteName.
delete_site_ruleC
Delete a site-level rule
Inputs: ruleId (required), corpName, siteName.
discover_environmentC
Discover available corporations and sites for the authenticated user
Inputs: corpName.
expire_eventC
Manually expire an event (unblock IP)
Inputs: eventId (required), corpName, siteName.
get_analyticsC
Get analytics data (top attacks, timeseries, etc.)
Inputs: type (required), corpName, siteName, from, +5 more.
get_contextB
Get the current context (corp and site names)
Inputs: no named parameters.
get_corp_overviewC
Get attack overview for a corporation
Inputs: corpName, from, until.
get_siteC
Get details of a specific site
Inputs: corpName, siteName.
get_suspicious_ipsC
Get list of suspicious IP addresses
Inputs: corpName, siteName, limit.
list_corp_rulesC
List rules at corporation level
Inputs: corpName, type, page, limit.
list_corpsB
List all corporations accessible to the authenticated user
Inputs: no named parameters.
list_eventsC
List security events (attacks, blocks, etc.)
Inputs: corpName, siteName, from, until, +3 more.
list_site_rulesC
List rules for a specific site
Inputs: corpName, siteName, type, page, +1 more.
list_sitesC
List sites in a corporation
Inputs: corpName, query, page, limit.
manage_alertsC
Manage alerts for monitoring attack patterns
Inputs: action (required), corpName, siteName, alertId, +6 more.
manage_blacklistC
Manage IP blacklist (blocklist)
Inputs: action (required), corpName, siteName, ip, +3 more.
manage_cloudwafC
Manage CloudWAF instances
Inputs: action (required), corpName, deploymentId, name, +6 more.
manage_listsC
Manage custom lists (IP, country, string, etc.)
Inputs: action (required), corpName, siteName, listId, +6 more.
manage_usersC
Manage corporation users
Inputs: action (required), corpName, userEmail, role, +1 more.
manage_whitelistC
Manage IP whitelist (allowlist)
Inputs: action (required), corpName, siteName, ip, +3 more.
search_requestsC
Search requests with advanced filtering
Inputs: corpName, siteName, query, page, +1 more.
set_contextB
Set the default corporation and site context for subsequent operations
Inputs: corpName (required), siteName.
set_credentialsC
Set Fastly NGWAF API credentials (email and access token)
Inputs: email (required), token (required).
test_connectionA
Test the API connection and validate credentials
Inputs: no named parameters.
update_siteC
Update site configuration
Inputs: corpName, siteName, displayName, agentLevel, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 29 tools
Most tools have distinct purposes targeting specific resources (sites, rules, events, lists, etc.), but some overlap exists: manage_blacklist and manage_whitelist are clear opposites, but manage_lists (custom lists) could be confused with them. Tools like manage_alerts and manage_cloudwaf are distinct but their boundaries with other monitoring/configuration tools might require careful reading of descriptions.
Tool names follow a highly consistent verb_noun pattern throughout (e.g., create_corp_rule, list_sites, get_analytics, manage_users). All use snake_case with clear action prefixes (create, delete, get, list, manage, set, etc.), making them predictable and easy to parse for an agent.
With 29 tools, the count is borderline high for a WAF management server. While it covers many aspects (rules, sites, events, analytics, configuration), it risks being overwhelming. A typical well-scoped server might have 15-25 tools; this is slightly above that range but not extreme.
The toolset provides comprehensive coverage for WAF management: CRUD for sites and rules (create, get, list, update, delete), event handling (list, expire), analytics, context management, credential setup, and utilities like testing connections. No obvious gaps are present; agents can perform full lifecycle operations.
Related MCP Connectors
The WAF for agents. Pattern-based + heuristic firewall scans prompts, RAG documents, tool argume...
Real-time MCP & A2A prompt-injection, jailbreak, and tool-schema poisoning firewall for AI agents.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Security firewall for AI agents ā scans MCP calls for injection, secrets, and risks.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Fastly's CDN API through the Model Context Protocol, allowing secure management of CDN services, caching, security settings, and performance monitoring without exposing API keys.222 npm7MIT

@fastly/mcpofficial
AlicenseNot gradedqualityBmaintenanceEnables assistants to interact with the Fastly API, allowing them to manage services, domains, TLS settings, traffic, dictionaries, ACLs, purge content, and make configuration changes.327 npm39MIT- AlicenseBqualityCmaintenanceEnables AI assistants to query and analyze Imperva Cloud WAF configurations through natural language, supporting retrieval of sites, domains, policies, and rules.48Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Check Point CloudGuard WAF configuration through natural language, including assets, profiles, practices, and policy.1Apache 2.0