Skip to content

MCP Tool Filtering

MCP Tool Filtering allows you to control which tools are available to AI models on a per-request basis using Virtual Keys (VKs). By configuring a VirtualKey, you can create a strict allow-list of MCP clients and tools, ensuring that only approved tools can be executed.

Make sure you have at least one MCP client set up. Read more about it here.

A Virtual Key’s MCP configuration controls exactly which tools requests using that key can execute:

  • Leave the Virtual Key’s MCP configuration empty (default) - All tools from all enabled MCP clients are available. In this state, a caller can still narrow tools for a single request by passing the x-bf-mcp-include-tools header.
  • Configure MCP clients on the Virtual Key - The key’s configuration becomes a strict allow-list and takes precedence over any x-bf-mcp-include-tools header sent with the request. Use this to guarantee that a key can only ever reach the tools you approved.

When you do configure MCP clients on a Virtual Key, set the allowed tools for each client:

  • Select specific tools - Only the chosen tools from that client are available.
  • Use the * wildcard - All available tools from that client are permitted.
  • Leave the tool list empty - All tools from that client are blocked.
  • Do not add a client at all - Every tool from that client is blocked (once any other client is configured).

You can configure which tools a Virtual Key has access to via the Web UI.

  1. Go to Virtual Keys page.
  2. Create/Edit virtual key Virtual Key MCP Tool Restrictions
  3. In MCP Client Configurations section, add the MCP client you want to restrict the VK to
  4. Add the tools you want to restrict the VK to, or leave it blank to allow all tools for this client
  5. Click on the Save button

For example, to allow only the check-status tool from billing-client while allowing all tools from support-client, add both clients in the MCP Client Configurations section, set billing-client’s allowed tools to check-status, and leave support-client’s tool list empty (or use the * wildcard) to permit all of its tools. Any other MCP client is then implicitly blocked for this key.

Available MCP Clients & Tools:

  • billing-client: with tools [create-invoice, check-status]
  • support-client: with tools [create-ticket, get-faq]

Configuration:

  • billing-client -> Allowed Tools: [*] (wildcard)
  • support-client -> Allowed Tools: [*] (wildcard)

Result: A request with this Virtual Key can access all four tools: create-invoice, check-status, create-ticket, and get-faq.