Skip to Content
Week 3.2: MCP Servers & Tool Integration

Week 3.2: MCP Servers & Tool Integration


Week 3.2 Resources: MCP Servers & Tool Integration

Required Accounts & Services

To follow along with the tool integrations, you will need accounts and API keys for the following services.

  • ElevenLabs: For AI Voice Generation.
    • Get API Key 
    • Note: You may need to enable “Do not restrict” for the key to work with the MCP server.
  • Late API: A unified API for social media scheduling.
  • Zapier: For general automation (Standard account required).
  • Rube: An MCP marketplace and manager (The recommended solution).

Terminal Commands (Setup)

Run these commands in your VS Code terminal (PowerShell as Administrator is recommended for Windows users).

1. Install uv (Python Package Manager):

# Windows irm https://astral.sh/uv/install.ps1 | iex # Mac/Linux curl -lsSf https://astral.sh/uv/install.sh | sh

2. Install Python Libraries:

pip install fastmcp pip install late-sdk[mcp]

3. Install Rube (Final Step in Video):

npx rube add rube --transport http https://rube.app/mcp --scope project

Configuration Files

1. .env File Setup

Create a .env file in your root folder and add your keys:

ELEVENLABS_API_KEY=your_key_here LATE_API_KEY=your_key_here ZAPIER_API_KEY=your_key_here

2. .mcp.json Configuration

If manually configuring the servers (before using Rube), your config file should look like this:

{ "mcpServers": { "ElevenLabs": { "command": "uvx", "args": ["-c", "elevenlabs-mcp"], "env": { "ELEVENLABS_API_KEY": "insert-your-api-key-here" } }, "late": { "command": "uvx", "args": ["--from", "late-sdk[mcp]", "late-mcp"], "env": { "LATE_API_KEY": "insert-your-api-key-here" } }, "zapier": { "command": "python", "args": ["C:/Path/To/Your/zapier_mcp_server.py"] } } }

Custom Zapier Server Code

Since the native Zapier implementation often fails, use this custom script. Save this as zapier_mcp_server.py inside an mcp/ folder.

from dotenv import load_dotenv from fastmcp import FastMCP import os import httpx # Load environment variables load_dotenv() # Initialize FastMCP mcp = FastMCP("Zapier MCP") api_key = os.getenv("ZAPIER_API_KEY") @mcp.tool() async def list_zapier_tools(): """List all available Zapier actions/tools.""" headers = {"Authorization": f"Bearer {api_key}"} async with httpx.AsyncClient() as client: resp = await client.get("https://mcp.zapier.com/api/v1/actions", headers=headers) return resp.json() @mcp.tool() async def call_zapier_tool(tool_name: str, instructions: str): """ Call a specific Zapier tool. Args: tool_name: The specific name of the action (e.g., 'gmail_send_email') instructions: Natural language instructions for the action. """ headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } data = { "action_name": tool_name, "instructions": instructions } async with httpx.AsyncClient() as client: resp = await client.post( "https://mcp.zapier.com/api/v1/execute", headers=headers, json=data, timeout=30.0 ) return resp.json() if __name__ == "__main__": mcp.run()

Class Prompts

Use these prompts to test your agent’s capabilities and reliability.

Discovery (Checking capabilities):

Tell me about your ElevenLabs MCP tools.

The “Bad” Prompt (Ambiguous):

Create content and post it to my notion board.

(Note: This often fails because the agent attempts actions it doesn’t have tools for.)

The “Deterministic” Prompt (High Reliability):

# Inputs $text: "Hello world" $timestamp: MM-DD-YY--HH-MM-SS # Steps 1. Use your text_to_speech tool to create speech that says $text 2. Save the output to media/$timestamp.mp3 3. Truncate the text to 30 characters for the filename

Using Rube for Gmail (Final Demo):

Use Rube MCP tools to send email to info@aidolons.com - Subject: Hello - Body: A friendly greeting email

Source Code

The complete source code for Week 3 (including the tools, mcp, workflows, and .claude folders) is available for download.

After downloading, extract the zip file and create a .env file with your API keys.

Last updated on