> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-mcp-agent.md).

# Example: MCP Mermaid agent

Connect a public **MCP** server ([Agentic Mermaid](https://agentic-mermaid.dev/mcp)), discover tools, optionally call one directly, then run a **tool agent** that can verify, describe, and ASCII-render Mermaid diagrams.

## Flow

```
  mcp.connect(endpoint)
         │
         ▼
  Discover tools (verify, describe, render_ascii)
         │
         ▼
  defineAgent({ tools: [...] })
         │
         ▼
  runAgent({ input: "create a 3-tier diagram…" })
         │
         ▼
  Final answer
```

{% hint style="info" %}
Requires network access to the MCP endpoint and a DNotifier app with AI enabled (`transport: "http"`).
{% endhint %}

## Prerequisites

1. DNotifier app with AI enabled
2. Outbound HTTPS to the MCP server
3. SDK credentials

## Language guides

| Language                | Guide                                                                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| JavaScript / TypeScript | [javascript-typescript.md](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-mcp-agent/javascript-typescript.md) |
| Dart / Flutter          | [dart-flutter.md](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-mcp-agent/dart-flutter.md)                   |
| Python                  | [python.md](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-mcp-agent/python.md)                               |

## Next steps

* [**Tools & MCP overview**](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/tools-and-mcp.md)
* [**Local tool agent example**](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-tool-agent.md)
* [**Workflow observability**](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/observability.md)
