> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-docs-scavio-google-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Include Exclude Tools

> Filter which MCP server tools an agent can use with include_tools and exclude_tools.

Use multiple MCP servers in a single agent.

```python include_exclude_tools.py theme={null}
"""
This example demonstrates how to use multiple MCP servers in a single agent.

Prerequisites:
- Google Maps:
    - Set the environment variable `GOOGLE_MAPS_API_KEY` with your Google Maps API key.
    You can obtain the API key from the Google Cloud Console:
    https://console.cloud.google.com/projectselector2/google/maps-apis/credentials

    - You also need to activate the Address Validation API for your .
    https://console.developers.google.com/apis/api/addressvalidation.googleapis.com
"""

import asyncio

from agno.agent import Agent
from agno.tools.mcp import MultiMCPTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


async def run_agent(message: str) -> None:
    """Run the GitHub agent with the given message.

    Remember to set the environment variable `GOOGLE_MAPS_API_KEY` with your Google Maps API key.
    """

    # Initialize the MCP server
    async with MultiMCPTools(
        [
            "npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt",
            "npx -y @modelcontextprotocol/server-google-maps",
        ],
        include_tools=["airbnb_search"],
        exclude_tools=["maps_place_details"],
    ) as mcp_tools:
        agent = Agent(
            tools=[mcp_tools],
            markdown=True,
        )

        await agent.aprint_response(message, stream=True)


# Example usage
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    asyncio.run(
        run_agent(
            "What listings are available in Cape Town for 2 people for 3 nights from 1 to 4 August 2025?"
        )
    )

    asyncio.run(run_agent("What restaurants are open right now in Cape Town?"))
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[mcp]" openai
    ```
  </Step>

  <Step title="Prepare Node.js">
    The MCP server runs with `npx`. Install Node.js, then verify the commands:

    ```bash theme={null}
    node --version
    npx --version
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Review the source limitation">
    This example does not pass `GOOGLE_MAPS_API_KEY` to the Google Maps MCP server, and `include_tools=["airbnb_search"]` filters out every Maps tool. Correct both settings before running the restaurant query.
  </Step>

  <Step title="Update the sample times">
    Replace the August 2025 Airbnb dates with future dates and replace `right now` with an explicit local date and time.
  </Step>

  <Step title="Run the example">
    Save the code above as `include_exclude_tools.py`, then run:

    ```bash theme={null}
    python include_exclude_tools.py
    ```
  </Step>
</Steps>

Full source: [cookbook/91\_tools/mcp/include\_exclude\_tools.py](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/mcp/include_exclude_tools.py)
