MCP Allowed Tools Configuration

Overview

The allowed_tools configuration enables you to restrict which tools a Digital Employee can access from Model Context Protocol (MCP) servers. This is useful for security, cost control, and ensuring your Digital Employee only uses approved functionality.

Key Concepts

What are Allowed Tools?

Allowed tools are a whitelist of specific tool names that an MCP connector is permitted to use. When configured, the Digital Employee will only have access to the specified tools from that MCP, even if the MCP server provides additional capabilities.

Benefits

  • Security: Limit access to sensitive operations

  • Cost Control: Prevent usage of expensive API calls

  • Compliance: Ensure only approved tools are used

  • Clarity: Make it explicit which capabilities are available

Configuration

Basic Setup

Allowed tools are configured using DigitalEmployeeConfiguration objects with specific key patterns:

DigitalEmployeeConfiguration(
    key="<MCP_NAME>_ALLOWED_TOOLS",
    value="tool1,tool2,tool3"
)

Key Pattern

The configuration key follows this pattern:

  • <MCP_NAME>_ALLOWED_TOOLS

Where <MCP_NAME> matches the MCP connector's configuration prefix (e.g., GOOGLE_MAIL_MCP, GOOGLE_CALENDAR_MCP).

Value Format

The value is a comma-separated string of tool names that will be automatically converted to a list:

Complete Example

Step 1: Import Required Components

Step 2: Create Identity

Step 3: Configure MCP URLs and Allowed Tools

circle-info

Note: Replace the example values above with your actual configuration:

  • GOOGLE_MAIL_MCP_URL: Your MCP server endpoints

  • GOOGLE_MCP_X_API_KEY: Your actual API key (consider using environment variables)

Step 4: Create and Deploy the Digital Employee

Step 5 (Optional): Verify Configuration

If you want to verify the configuration was applied correctly, you can check the deployed MCP config:

Step 6: Run the Digital Employee

Now you can run the Digital Employee and it will only have access to the allowed tools:

In this example:

  • The Digital Employee can use google_mail_get_email_details, google_mail_list_emails to find the latest email.

  • It cannot use tools like google_mail_delete_email because they weren't in the allowed list.

For the list of tools that are available via GLConnector, please refer to https://api.bosa.id/docsarrow-up-right.

Common Use Cases

Restricting Email Operations

Only allow reading and searching emails, but not sending:

Read-Only Calendar Access

Only allow listing events, but not creating or modifying:

Multiple Tool Permissions

Grant access to multiple related tools:

Best Practices

1. Principle of Least Privilege

Only grant access to tools that are absolutely necessary for the Digital Employee's job:

2. Document Your Tool Choices

Add comments explaining why specific tools are allowed:

3. Use Environment Variables for Sensitive Data

Store API keys and URLs in environment variables:

Troubleshooting

Tools Not Being Restricted

Problem: All tools are still accessible despite configuration.

Solution: Ensure the configuration key matches the MCP's expected pattern:

  • Check the MCP connector's documentation for the correct prefix

  • Verify the key format: <MCP_PREFIX>_ALLOWED_TOOLS

Tool Names Incorrect

Problem: Tools are not recognized.

Solution: Verify the exact tool names from the MCP server documentation. Tool names are case-sensitive and must match exactly.

Last updated