# n8n

***

Here's how you can start using the Katoshi MCP with [n8n](https://n8n.io/)

## 1) Create a new workflow

* Add a simple chat message trigger for testing
  * Can be replaced by webhook triggers (Telegram, Tradingview, etc) or Scheduled triggers to run at fixed intervals.&#x20;
* Add an `AI Agent` node
* Add and connect an `OpenAI Model` node
* Add and connect a `Simple Memory` node
* Add and connect an `MCP Client` node

<figure><img src="/files/2AQxPWOV431q8JFa4TLK" alt=""><figcaption></figcaption></figure>

***

## 2) Configure the MCP client

* Add the Katoshi MCP SSE endpoint
* Select Bearer Auth
* Add your credential

<figure><img src="/files/lYnX3UFcz2yMk1dbP30f" alt=""><figcaption></figcaption></figure>

* Add your Katoshi API Key in the Bearer Token input

<figure><img src="/files/MJDxXnuKGlWArMMKCFYG" alt=""><figcaption></figcaption></figure>

***

## 3) Configure OpenAI

* Connect your OpenAI API Key in credentials ([create one here](https://platform.openai.com/api-keys))
* Select the model of your choice ([view all models](https://platform.openai.com/docs/models))

<figure><img src="/files/m0chLdoMHA7iP7qGny9v" alt=""><figcaption></figcaption></figure>

***

## 4) Test your Agent

* Click on the bottom `Open Chat` orange button
* Send a message to your AI agent (e.g. Open a BTC long with $11, 1% sl, 3% tp)

<figure><img src="/files/nim19Q8gHuKP2DoqRCap" alt=""><figcaption></figcaption></figure>


---

# 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://katoshi.gitbook.io/katoshi-docs/integrations/n8n.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.
