# Dify.AI

Dify reads remote MCP servers from the Tools page. Add Cakewalk's gateway as an HTTP-based MCP server and Dify validates the connection before registering it.

## Install Method

Custom form on Dify's Tools page. Available from Dify v1.6.0 onwards.

## Step 1: Open the Tools Page

1. Open Dify and sign in.
2. Go to the **Tools** page.
3. Select **MCP**.

## Step 2: Add the Cakewalk Gateway

1. Click **Add MCP Server (HTTP)**.
2. Fill the form:
   * **Display Name:** Cakewalk
   * **Server URL:** `https://mcp-gateway.getcakewalk.io/mcp`
   * **Unique Identifier:** `cakewalk` (or your chosen slug).
   * **Description:** optional.
3. Submit the form. Dify validates that it can reach Cakewalk's gateway before completing registration.

## Step 3: Authenticate

After registration, Dify initiates the OAuth flow on first tool use. Sign in with your Cakewalk account and approve the Connection in your browser.

## Verifying It Works

In a Dify app, ask the agent to list its available tools. The tools surfaced through the Cakewalk gateway appear in the response. In Cakewalk, the Dify card on **My Agents** flips to **Connected** after the first agent call.

## Troubleshooting

* **Form does not submit (validation error):** Dify probes the MCP server URL before completing registration. Confirm `mcp-gateway.getcakewalk.io` is reachable from Dify's servers (or from your self-hosted Dify network).
* **OAuth flow does not start:** Cakewalk's gateway expects OAuth-aware clients. If Dify falls back to anonymous access, the tool list returns empty. Confirm the Server URL points to `/mcp` (no trailing slash, no extra path).

## Learn more

* [Dify v1.6.0: Built-in Two-Way MCP Support](https://dify.ai/blog/v1-6-0-built-in-two-way-mcp-support) from Dify.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-platforms/dify-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
