# Tutorial (/aiway/tutorial)



Tutorial = the end-to-end *fabric* story (build → discover → stream → LLM orchestration); the A2A and MCP **Getting started** pages are single-gateway quickstarts. New here? This page is the guided path.

Across five steps you start KubeMQ, build and register a plain-HTTP "research" agent with **no KubeMQ SDK**, discover it by capability and invoke it synchronously, stream its live task events over SSE, and finally let an LLM discover and call that same agent over MCP — proving the "one fabric" thesis end-to-end. Every step uses Python and `curl`.

## What you'll build [#what-youll-build]

By the last step, an LLM host reaches your custom research agent through the MCP→A2A bridge — discovering it with `agent_list` and invoking it with `agent_send`, all over the message broker.

<Mermaid
  chart="`
graph LR
LLM[&#x22;LLM host<br/>(MCP client)&#x22;]
MCP[&#x22;MCP gateway<br/>:9090&#x22;]
AIWAY[&#x22;Aiway<br/>(registry + Agent Bridge)&#x22;]
BROKER[&#x22;Message Broker&#x22;]
AGENT[&#x22;research-agent-01<br/>plain-HTTP agent&#x22;]

LLM -- &#x22;agent_list / agent_send&#x22; --> MCP
MCP -- &#x22;over the broker&#x22; --> AIWAY
AIWAY --> BROKER
BROKER -- &#x22;HTTP POST&#x22; --> AGENT

class LLM client
class MCP,AIWAY aiway
class BROKER broker
class AGENT external
`"
/>

*The LLM discovers and invokes the research agent you built — through MCP, Aiway, and the message broker.*

## Prerequisites [#prerequisites]

* **Docker** (to run KubeMQ locally) — or a KubeMQ server already running with the shared HTTP server on port `9090`.
* **Python 3.11+** for the agent server and the clients.
* **`curl`** for probing the Aiway endpoints.

<Callout type="info">
  No KubeMQ SDK is required anywhere in this tutorial. The agent is a plain HTTP service, and every call to the fabric is JSON over HTTP.
</Callout>

## The steps [#the-steps]

Follow the steps in order — each one builds on the last.

<Cards>
  <Card title="1. Set up & start KubeMQ" href="/aiway/tutorial/setup" description="Start a local KubeMQ server and confirm the Aiway endpoints are live." />

  <Card title="2. Build & register an agent" href="/aiway/tutorial/build-and-register-an-agent" description="Write a plain-HTTP Python agent — no KubeMQ SDK — and register its Agent Card with Aiway." />

  <Card title="3. Discover & invoke" href="/aiway/tutorial/discover-and-invoke" description="Find your agent by capability and call it synchronously with message/send." />

  <Card title="4. Stream live results" href="/aiway/tutorial/stream-live-results" description="Use message/stream to receive task.status, task.artifact, and task.done events live over SSE." />

  <Card title="5. Orchestrate from an LLM (MCP)" href="/aiway/tutorial/orchestrate-from-an-llm" description="Connect over MCP, discover the agent with agent_list, and invoke it with agent_send — the MCP→A2A bridge in action." />
</Cards>
