# Connect Activepieces MCP to Kotae

## Connect an MCP Server to Kotae

We recommend using **Activepieces** as an MCP server. It’s free to start and the UX is simpler than other MCP servers (e.g., n8n).

### What you’ll need

- Kotae.ai workspace with access to **Developer → MCP**
- An **Activepieces account** (a free plan works!)

For the specific example flow below, you will also need:
- A Google account with Calendar access

## Part 1 — Build the MCP tool in Activepieces

### Step 1: Create a New Flow

In Activepieces, click **New Flow**. You can start from scratch, or use the ready-made [**Kotae shared template**](https://cloud.activepieces.com/templates/kQ8qDuJcrJuUuDk43pGuJ) for booking a Google Calendar meeting:

This template covers everything you’ll do in Part 1, though you’ll still need to finish Parts 2 and 3 in Kotae. Once opened, name your flow something like **Demo Call Guide**.

### Step 2: Add the MCP Tool

For your first step in the flow, choose **MCP Tool**.

Give it a clear name and description, such as:
- **Name:** Book a demo
- **Description:** Tool used to book or schedule a call with the business owner
- **Parameters:** Define the parameters Kotae will send:
  - attendee_name (string, required)
  - attendee_email (string, required)
  - start_iso (string, required)
  - end_iso (string, required)
  - timezone (string, required, e.g. JST)

💡 _Tip: Click “Generate Sample Data” to test your flow without connecting Kotae yet._

### Step 3: Add the Google Calendar Step

Next, add another step: **Google Calendar → Create Event**.

Connect your Google account (you’ll only need to do this once), then choose the calendar where meeting invites should appear.

Fill in the fields like this:
- **Summary/Title:**`Demo call with {{step_1.attendee_name}}`
- **Start:**`{{step_1.start_iso}}`
- **End:**`{{step_1.end_iso}}`
- **Guests/Attendees:**`{{step_1.attendee_email}}`

You can also include an optional description:
- **Requested by:**`{{step_1.attendee_name}} ({{step_1.attendee_email}})`
- **Timezone:**`{{step_1.timezone}}`

Finally, turn on **Send Notifications** so guests receive their invitations automatically.

### Step 4: Return a Reply to the MCP Client

Now add one final step: **MCP → Reply to MCP Client**.

This is what sends a response back to Kotae confirming that the booking worked. Use a payload like this:
```json
{
  "status": "success",
  "message": "Booked! Calendar invite sent to {{step_1.attendee_email}}.",
  "event": {
    "id": "{{step_2.id}}",
    "htmlLink": "{{step_2.htmlLink}}",
    "start": "{{step_2.start}}",
    "end": "{{step_2.end}}"
  }
}
```

### Step 5: Test and Publish

Click **Test** and use sample values such as:
`start_iso: 2025-09-12T15:00:00-07:00` and `end_iso: 2025-09-12T15:30:00-07:00.`

If the test looks good, click **Publish**. After publishing, copy your **MCP Server URL** and note the **Auth header / API key** — you’ll need these in Kotae.

## Part 2 — Connect the MCP server in Kotae

### Step 6: Open MCP Settings in Kotae

In your **Kotae dashboard**, go to **Developer → MCP** and click **Add MCP Server**. Give it a name like “Activepieces – Book a Demo”.

For the **Event Type**, choose **Chatbot**. This tells Kotae which kind of event will trigger your MCP flow.

### Step 7: Paste the MCP JSON Configuration

In Activepieces, locate your MCP Server URL under **Project → MCP → Connect → Other**. Copy that full URL.

Then, back in Kotae, paste the configuration below, replacing \[replace\] with your URL:
```json
{
  "mcpServers": {
    "Activepieces": {
      "url": "\[replace\]"
    }
  }
}
```

## Part 3 — End-to-End Test

### Step 8: Try It in Your Chat

Open your Kotae chatbot and say something like:
> I’d like a meeting on Sep 12 at 3pm JST. My email is [nicha@example.com](mailto:nicha@example.com).

Kotae sends a request to your MCP server that looks like this:
```json
{
  "attendee_name": "Nicha",
  "attendee_email": "nicha@example.com",
  "start_iso": "2025-09-12T15:00:00-07:00",
  "end_iso": "2025-09-12T15:30:00-07:00",
  "timezone": "JST"
}
```

Activepieces creates the calendar event and replies with the JSON you defined earlier. Kotae then confirms the booking in chat:
> All set for Sep 12, 3:00–3:30 PM PT. I’ve sent you a calendar invite!

## Still Need Help?

If your test doesn’t work right away, double-check your MCP URL and API key, and make sure the **Event Type** in Kotae matches what you used in your Activepieces flow. You can also try running the flow manually inside Activepieces to confirm it’s working independently.

If you’re still stuck, reach out to Kotae Support — we’ll help you troubleshoot and get your integration running smoothly.
