Fastly NGWAF MCP Server
Provides seamless integration with Fastly's Next-Gen Web Application Firewall API, enabling AI assistants to manage web application security through natural language interactions.
Tools
set_credentials
Set Fastly NGWAF API credentials (email and access token)
test_connection
Test the API connection and validate credentials
set_context
Set the default corporation and site context for subsequent operations
get_context
Get the current context (corp and site names)
discover_environment
Discover available corporations and sites for the authenticated user
list_corps
List all corporations accessible to the authenticated user
get_corp_overview
Get attack overview for a corporation
list_sites
List sites in a corporation
get_site
Get details of a specific site
create_site
Create a new site in a corporation
update_site
Update site configuration
delete_site
Delete a site
list_corp_rules
List rules at corporation level
list_site_rules
List rules for a specific site
create_corp_rule
Create a corporation-level rule
create_site_rule
Create a site-level rule
delete_corp_rule
Delete a corporation-level rule
delete_site_rule
Delete a site-level rule
search_requests
Search requests with advanced filtering
list_events
List security events (attacks, blocks, etc.)
expire_event
Manually expire an event (unblock IP)
get_suspicious_ips
Get list of suspicious IP addresses
manage_whitelist
Manage IP whitelist (allowlist)
manage_blacklist
Manage IP blacklist (blocklist)
manage_lists
Manage custom lists (IP, country, string, etc.)
manage_alerts
Manage alerts for monitoring attack patterns
get_analytics
Get analytics data (top attacks, timeseries, etc.)
manage_cloudwaf
Manage CloudWAF instances
manage_users
Manage corporation users
README
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
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 FastlyMCP
- Install dependencies
npm install
- Configure 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-name
- Start the server
npm start
Configuration
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 template
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Testing
# 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 start
Security 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。