These examples show how to integrate various MCP (Model Context Protocol) servers with the Ailoy agent.
This example demonstrates how to use the GitHub MCP Server to interact with GitHub through the Ailoy agent. You can instruct the agent to perform a variety of GitHub-related tasks, including:
- Searching for repositories
- Fetching file contents
- Creating issues or pull requests
- And more
As outlined in the GitHub MCP Server documentation, you'll need the following:
⚠️ The GitHub MCP server requires theGITHUB_PERSONAL_ACCESS_TOKENenvironment variable, even if you don't plan to use tools that require authentication.
# Set the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable
export GITHUB_PERSONAL_ACCESS_TOKEN=xxx
uv run github.pyThis example demonstrates how to use the Playwright MCP Server to control Playwright browsers through the Ailoy agent. You can instruct the agent to perform browser automation tasks, such as:
- Navigating pages and retrieving content
- Automating actions like clicks or keystrokes
- And more
⚠️ This example uses an OpenAI model, so make sure theOPENAI_API_KEYenvironment variable is set.
⚠️ The Playwright MCP server can quickly consume a large number of tokens due to the huge size of HTML page content, potentially leading to high costs if not used carefully.
-
Playwright (Make sure to install the required browsers as explained in the Playwright browser installation guide):
npx playwright install
# Set the `OPENAI_API_KEY` environment variable to use OpenAI models
export OPENAI_API_KEY=xxx
uv run playwright.py