Skip to main content
Glama
ThalesGroup

Imperva Cloud WAF MCP Server

Official
by ThalesGroup

Imperva Cloud WAF MCP Server (Beta)

Pytest codecov

A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Imperva Cloud WAF. This integration allows you to query, analyze, and manage your Cloud WAF configuration through natural language conversations.

Note: This is a beta version with read-only capabilities. Write operations are not yet supported.

What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. Think of it as a universal adapter that lets Claude and other AI assistants interact with your services.

Related MCP server: Cloudflare MCP Server

Why Use This?

Managing Cloud WAF configurations often requires:

  • Navigating through multiple dashboards and interfaces

  • Running complex API queries with specific filters

  • Understanding relationships between sites, domains, policies, and rules

  • Analyzing security configurations across multiple accounts

With this MCP server, you can ask your AI assistant questions like:

  • "Show me all the security rules for my production site"

  • "Which sites are using the WAF policy named 'strict-security'?"

  • "List all domains that have rate limiting rules configured"

  • "What's the current configuration of site ID 12345?"

Your AI assistant will use the MCP tools to fetch the information and present it in a clear, conversational format.

Available Tools

The server provides four powerful tools for Cloud WAF management:

Beta Scope

Read-Only Scope

This beta is designed for inspection and analysis, operating in read-only mode.
While you can comprehensively query and explore your configurations, creating, modifying, or deleting assets (policies, rules, sites, or domains) is not currently supported through this MCP server.
For write operations, please use the Imperva Cloud WAF Console.

These capabilities may be added in future releases. For now, use the Imperva Cloud WAF Console to perform write operations.

Beta Feedback - We Need Your Input!

This is a beta release, and your feedback will shape future development.

What we're looking to learn:

  • Which queries do you run most frequently?

  • What configuration tasks would you want your AI assistant to help with?

  • What features would save you the most time?

  • What's confusing or unclear?

Please share your feedback by opening an issue on GitHub or contacting your Imperva representative.

Installation

Choose your preferred AI assistant to get started:

Option 1: Claude Desktop

Prerequisites

  1. Claude Desktop - Download here

  2. Docker Desktop - Required to run the MCP server

  3. Imperva Cloud WAF API Credentials

Configuration

  1. Locate your Claude Desktop configuration file:

    # macOS/Linux
    ~/Library/Application Support/Claude/claude_desktop_config.json
    
    # Windows
    %APPDATA%\Claude\claude_desktop_config.json
  2. If the file doesn't exist, create it:

    # macOS/Linux
    mkdir -p ~/Library/Application\ Support/Claude
    touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
    
    # Windows (PowerShell)
    New-Item -Path "$env:APPDATA\Claude\claude_desktop_config.json" -ItemType File -Force
  3. Add the MCP server configuration, replacing YOUR_API_ID and YOUR_API_KEY with your actual Imperva credentials:

    {
      "mcpServers": {
        "imperva-cloudwaf": {
          "command": "docker",
          "args": [
            "run",
            "--rm",
            "--pull",
            "always",
            "-i",
            "-e", "API_ID=YOUR_API_ID",
            "-e", "API_KEY=YOUR_API_KEY",
            "ghcr.io/thalesgroup/imperva-cloud-waf-mcp-server:latest"
          ]
        }
      }
    }
    • If you already have other MCP servers configured, add the imperva-cloudwaf block inside the existing mcpServers object.

  4. Restart Claude Desktop.

Verification

After restarting Claude Desktop, the application should start without errors. Within a few seconds, the Imperva Cloud WAF tools will appear in the MCP tools section.


Option 2: VS Code with GitHub Copilot

Prerequisites

  1. Visual Studio Code - Download here

  2. GitHub Copilot - Install the GitHub Copilot extension and ensure you have an active subscription

  3. Docker Desktop - Required to run the MCP server

  4. Imperva Cloud WAF API Credentials

Configuration

  1. Open VS Code and launch the Command Palette:

    • macOS: Command + Shift + P

    • Windows/Linux: Ctrl + Shift + P

  2. Type MCP and select MCP: Add Server

  3. When prompted, select Command (Stdio) as the server type

  4. Enter the following command, replacing YOUR_API_ID and YOUR_API_KEY with your actual Imperva credentials:

    docker run --rm --pull always -i -e API_ID=YOUR_API_ID -e API_KEY=YOUR_API_KEY ghcr.io/thalesgroup/imperva-cloud-waf-mcp-server:latest
  5. Give the server a name when prompted (e.g., Imperva)

  6. VS Code will open the mcp.json configuration file showing all your MCP servers. Find the Imperva entry and wait for its status to change to Running

    • This may take a few minutes while Docker downloads the image

Verification

Once the server status shows Running in the mcp.json file, open GitHub Copilot and test the connection by asking:

How many sites are there under my account in Imperva?

Copilot should use the Imperva MCP server to fetch and display your Cloud WAF sites.

Usage Examples

Once configured, you can interact with your Cloud WAF account through natural language:

Example 1: Querying Sites

You: Show me all active sites in my account

Your AI assistant will use the get_sites_tool to fetch and display
your sites with their current status, CNAMEs, and configuration details.

Example 2: Checking Domain Configuration

You: What's the DNS configuration for my domain example.com?

Your AI assistant will use the get_domains_tool to find the domain and show you
the A records, CNAME, and current status.

Example 3: Analyzing Security Policies

You: List all WAF policies that are assigned to site ID 12345

Your AI assistant will use the get_policies_tool to retrieve policies
filtered by site ID and policy type, showing you their settings and configurations.

Example 4: Reviewing Security Rules

You: Show me all rate limiting rules for my production sites

Your AI assistant will use the get_rules_tool with the "Rates" category filter
to display rate limiting rules and their configurations.

Example 5: Complex Analysis

You: Compare the security policies between my staging and production sites

Your AI assistant will fetch policies for both sites using the appropriate filters and
provide a comparison of their configurations.

Authentication

The MCP server supports API Key authentication. Your credentials are passed securely through environment variables and are never stored or logged by the MCP server.

Troubleshooting

Server Not Appearing

For Claude Desktop:

  1. Verify Docker Desktop is running

  2. Check that your claude_desktop_config.json is valid JSON

  3. Ensure API credentials are correctly set

  4. Restart Claude Desktop completely

  5. Check Claude Desktop logs for error messages

For VS Code with GitHub Copilot:

  1. Verify Docker Desktop is running

  2. Check that the mcp.json file was created correctly

  3. Ensure API credentials are correctly set in the command

  4. Wait for the server status to show "Running" (may take a few minutes)

  5. Restart VS Code if the server doesn't appear

Authentication Errors

  1. Verify your API ID and API Key are correct

  2. Ensure your API credentials have the necessary permissions

  3. Check that your credentials haven't expired

Connection Issues

  1. Verify you have internet connectivity

  2. Check if Docker can pull and run images

  3. Ensure no firewall is blocking Docker or your AI assistant application

Tool Errors from the MCP Server

If you start receiving errors from the MCP tools, you may be running an outdated version of the MCP server.
Since the Docker configuration uses --pull always, simply restarting your AI assistant application will automatically pull the latest Docker image.

For Claude Desktop: Fully quit the application (ensure the process is completely killed) before restarting to ensure the old container is removed and a fresh one starts with the latest version.

For VS Code: Close and reopen VS Code, or use the Command Palette to reload the MCP server configuration.

Development

Running Locally

For development or testing, you can run the server directly with Python:

  1. Clone the repository

  2. Install dependencies:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    uv sync
  3. Create a .env file:

    API_ID=your_api_id
    API_KEY=your_api_key
  4. Run the server:

    uv run python -m cwaf_external_mcp.server

Running Tests

pytest tests/

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache License - see the LICENSE file for details.
Warning All the requirements listed have their own License.

Support

For issues related to:

Learn More


Built with FastMCP and powered by the Imperva Cloud WAF API.

Available Tools

4 tools
get_domains_by_filters_toolA

Fetches the domains associated with a specific site under a given account. To get a single domain details provide the domain ID, or the domain name. Use the most effective filter according to the context, for example, if you have the domain ID use it; if you have the domain name use it. If you get an empty list, it means that the domain does not exist, or you do not have access to it, avoid getting all domains and filter on your side. Terminology: CloudWAF site can have multiple domains; Domains that do not match the site name are sometimes referred to as CNAME reuse domains, alternative domains, or vanity domains.

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYesUnique identifier of the sub-account, if the account in context is the main account associated to the used API_ID this field MUST be empty (Optional)
domain_idsNo(list of numbers) list of domain IDs.
site_idsNo(list of numbers) list of sites IDs.
namesNo(list of strings) list of domain names.
page_numNo
page_sizeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description discloses the read operation and empty result meaning, but omits pagination behavior (page_num/page_size undocumented) and safety profile (idempotency, permissions). Acceptable but could improve.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with four sentences, each adding value: purpose, single domain guidance, filter selection, empty results interpretation, and terminology. Could trim slightly but effectively front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a fetch tool with output schema, the description covers purpose, filter choice, and edge cases. Missing pagination details, but overall adequate given complexity and schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67%, with account_id, domain_ids, site_ids, names described. The description reinforces effective filter choice. However, page_num and page_size lack description both in schema and description, so no added value for those.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it fetches domains for a site under an account, with strong verb 'Fetches' and specific resource. However, it mentions 'specific site' but allows multiple site_ids, causing slight ambiguity. No sibling differentiation needed as tools are for different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use filter parameters (domain ID vs name for single domain) and interprets empty results (no existence/no access) advising against client-side filtering. Does not mention alternatives but siblings are unrelated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_polices_of_account_by_filter_toolC

Fetches all policies of a given account.

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYesUnique identifier of the sub-account, if the account in context is the main account associated to the used API_ID this field MUST be empty (Optional)
site_idsNolist of sites IDs, only policies assigned to sites with those IDs will retrieve, if it exists (Optional)
sub_accounts_idsNolist of subaccounts IDs, only policies allowed by those subaccounts will retrieve, if it exists. (Optional)
policies_idsNolist of policies IDs, only policies with those IDs will retrieve, if it exists (Optional)
policy_typesNolist of policy types, only policies with those types will retrieve, if it exists. possible values are "WAF_RULES", "ACL", "WHITELIST". (Optional)
extendedNowhether to retrieve the full policy details, or only the basic information (without the policySettings and defaultPolicyConfig fields). Defaults to True. (Optional)
namesNolist of policies names, only policies with those names will retrieve, if it exists. (Optional)
page_numNo
page_sizeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description only states 'Fetches' without disclosing that it supports filtering, pagination, or that it's a read operation. Fails to add behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is concise but overly simplistic for a tool with 9 parameters. Lacks structure; the 'by_filter' name is not reflected in the description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (9 parameters, filtering, pagination), the description is too brief. It does not mention that results can be filtered, paginated, or that an extended parameter controls detail level. Output schema exists but return behavior is not summarized.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 78% with parameter descriptions, so baseline is 3. Description adds no parameter details beyond the generic 'of a given account'. Does not improve understanding of the filter parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Fetches all policies of a given account', identifying the action and resource. However, it omits the 'by_filter' aspect implied in the tool name, which could mislead about filtering capability.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings like get_rules_of_account_tool. No mentions of prerequisites or contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_rules_of_account_toolC

Fetches the custom rules details associated with the sites under the given account. The supported type of rules are: rate rules, security rules, forward rules, redirect rules, rewrite rules

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYesUnique identifier of the sub-account, if the account in context is the main account associated to the used API_ID this field MUST be empty (Optional)
site_idsNolist of sites IDs, only rules assigned to sites with those IDs will retrieve, if it exists (Optional)
sub_accounts_idsNolist of subaccounts IDs, only rules assigned to sites under those subaccounts will retrieve, if it exists. (Optional)
rules_idsNolist of rules IDs, only rules with those IDs will retrieve, if it exists (Optional)
categoriesNolist of rules categories, only rules with those types will retrieve, if it exists. possible values are "WafOverride","WafOverride","RewriteResponse","SimplifiedRedirect","Security","Rates","Rewrite","Redirect". (Optional)
namesNolist of rules names, only rules with those names will retrieve, if it exists. (Optional)
page_numNo
page_sizeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must disclose behavioral traits. It only states the basic purpose and rule types, omitting details on read-only nature, pagination, filtering behavior, auth requirements, or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two-sentence description is concise and front-loaded with the action and scope. No fluff, though could be slightly more structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, the description does not need to detail return values. However, it lacks mention of pagination and filtering capabilities, which are important for correct usage. Adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 75%, so most parameters are already documented. The description adds minimal value beyond the schema, primarily listing rule types which overlap with the 'categories' parameter description. Baseline score applied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool fetches custom rules details for sites under an account and lists the supported rule types. It distinguishes from sibling tools which deal with domains, policies, or site details. However, it could be more specific about what 'custom rules details' includes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description provides no guidance on when to use this tool versus siblings or alternatives. No exclusions or context-specific usage hints are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_sites_details_of_a_given_account_toolA

Fetches the list of sites for a given account. To get a single site details provide the site Id or the site name. Use the most effective filter according to the context, for example, if you have the site ID use it; if you have the site name use it; If you get an empty list, it means that the site does not exist, or you do not have access to it, avoid getting all sites and filter on your side. Terminology: The site name is not always the domain name, to get the list of domains use the domains_get_domains_of_specific_site_tool.

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYesUnique identifier of the sub-account, if the account in context is the main account associated to the used API_ID this field MUST be empty (Optional)
site_idsNolist of external sites IDs, only sites with those IDs will retrieve, if exists (Optional)
namesNolist of sites names, only sites with those names will retrieve, if exists. (Optional)
sub_account_idsNolist of subaccount IDs, only sites under the matching subaccounts will retrieve, if exists. (Optional)
page_numNo
page_sizeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavior. It explains empty list meaning and advises against fetching all sites. However, it omits details on pagination (page_num, page_size), authentication requirements, rate limits, or error cases, leaving gaps in understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and front-loaded with purpose, but the phrase 'To get a single site details provide the site Id or the site name' is slightly wordy. Overall, no excessive information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 6 parameters and an output schema, the description covers essential filtering guidance and result interpretation. However, it lacks explanation of pagination parameters and does not address error handling or access prerequisites, leaving the agent slightly underinformed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds value beyond the input schema by advising to use site ID or name for single details and warning against pulling all data. With 67% schema coverage, it compensates for partially documented parameters (page_num, page_size lack descriptions) but could elaborate more on sub_account_ids.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches a list of sites for a given account, and explains how to get single site details via ID or name. However, it does not explicitly differentiate from sibling tools, which are about domains, policies, and rules, so clarity is slightly diminished.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides specific guidance on using filters effectively (e.g., use site ID if available) and interprets empty results. It mentions a sibling tool for domains but lacks explicit when-not-to-use scenarios or alternatives for filtering.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.20
    • First observedget_domains_by_filters_tool
    • First observedget_polices_of_account_by_filter_tool
    • First observedget_rules_of_account_tool
    • First observedget_sites_details_of_a_given_account_tool

TDQS

B3.2/5.0
Disambiguation5/5

Each tool targets a distinct resource (domains, policies, rules, sites) with clear descriptions, so there is no ambiguity about which tool to use for a given purpose.

Naming Consistency2/5

Tool names are inconsistent: some use 'by_filters', others 'of_account', and one uses 'of_a_given_account'. The 'tool' suffix is unnecessary and varies in placement. Naming pattern is not uniform.

Tool Count5/5

With 4 tools, the set covers the main entities (sites, domains, policies, rules) without being overly numerous or sparse for a read-only WAF information server.

Completeness1/5

Only read operations are provided; there are no create, update, or delete tools for any resource. Agents cannot manage the WAF configuration, only retrieve existing data.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Provides seamless integration with Fastly's Next-Gen Web Application Firewall API, enabling AI assistants to manage web application security through natural language interactions.
    29
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to manage Cloudflare resources through natural language, including DNS records, zone management, Workers KV storage, cache purging, and analytics. Supports comprehensive Cloudflare operations with secure API token authentication.
    13
    2
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage Cloudflare infrastructure including DNS records, cache purging, SSL settings, Workers, and analytics through the Cloudflare API. Eliminates dashboard context-switching by allowing natural language control of domain management and infrastructure operations.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ThalesGroup/imperva-cloud-WAF-MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server