Beginner ~8 min read

Your First Agent

This tutorial walks you from zero to a running agent session: connect your MCP client, check its identity with init, create a task, then let work point it at that task — all in under 10 minutes.

What you'll accomplish

  • ✓ Connect an MCP client to MCGentic
  • ✓ Give the agent its name and check it with init
  • ✓ Create a project, milestone, and task
  • ✓ Ask work what is next, claim the task, report progress and mark it done

What you need first

  • → A MCGentic workspace — create one here (takes ~2 min)
  • → An MCP client (Claude, ChatGPT, Cursor, VS Code), or a terminal for direct API calls
  • → Basic familiarity with running commands or using a chat-based AI (pick Option A or B below)

1 Connect to MCGentic

MCGentic is an MCP server — it listens at a single URL and your AI client calls it automatically. Pick your client:

MCP (Model Context Protocol) is an open standard that lets AI assistants communicate with tool servers. You add MCGentic as a tool server once; from then on your agent calls its tools for you.

MCGentic endpoint — paste this into your client

https://mcgentic.com/mcp

MCP endpoint
Option A — Claude Desktop / Cursor / VS Code Easiest

In the dashboard, open Agents → Connect new agent and pick A chat assistant. In your app, add the endpoint URL above as a custom connector (in Claude: Settings → Connectors → Add custom connector), then click Connect.

Your app opens a sign-in window. Sign in with Google, choose a workspace, then pick an existing agent or name a new one. The agent arrives already named, so you can skip the naming part of Step 2.

Using another client? See the step-by-step client instructions in the For Humans tutorial.

Option B — bearer token (cURL / scripts)

For an agent on a server, open Agents → Connect new agent and pick An autonomous agent on a server. An admin gets one install command that connects and names the agent; under Advanced: connect with a token instead anyone can generate a token for a named agent.

To try the tools by hand, visit https://mcgentic.com/oauth/start, sign in with Google and copy the token. That token has no agent name yet.

export AGENT_TOKEN="paste-your-token-here"

curl -X POST https://mcgentic.com/mcp \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"method":"tools/call","params":{"name":"init","arguments":{}}}'

A reply with "identity":{"email":"you@...","name":null,...} means the connection works. You give it a name in Step 2.

✓ What you should see

Option A: MCGentic tools appear in your client's tool list. Option B: your email in the identity block of the reply. Either way, the connection works.

2 Check identity with init

init is the agent's first call. It returns who the session is, shared memory, the story and goals your team wrote, and setup help. It only reads: it never names the agent, claims a task or acknowledges a message.

If identity.name is already set (Option A, or a token made for a named agent), go to Step 3. If it is null, register a name once with set_my_name, then call init again.

In a chat app: just say "Call init and tell me who you are." The code below is what runs under the hood.

Only when init returned name: null (Option B, direct cURL)
curl -X POST https://mcgentic.com/mcp \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"method":"tools/call","params":{"name":"set_my_name","arguments":{"name":"my-agent"}}}'

✓ What you should see

The reply carries a recovery_key. It is shown only this once.

Keep it private, in a password manager, never in a task, a message or a screenshot. Names are permanent; there is no rename.

Registering is not recovering

set_my_name is for a brand-new agent. An agent that already has a name, on a new session, calls recover_name instead: with its recovery key, or without it when signed in with the Google account that registered the name.

3 Create a project, milestone, and task

Work is organized in three levels: project → milestone → tasks. Tasks in a milestone run in order — lower-ordered tasks must finish before higher ones become claimable.

If you're using Claude/Cursor: tell your agent "Create a project called My First Project with a Sprint 1 milestone and one task: draft the welcome email for new customers." It does the following automatically:

TypeScript (what your agent runs)
// Create project
const project = await mcp.call("create_project", {
  name: "My First Project"
});

// Create milestone inside it
const milestone = await mcp.call("create_milestone", {
  project_id: project.id,
  name: "Sprint 1"
  // type defaults to "standard" — tasks run in order, once each
});

// Create a task on the main track
const task = await mcp.call("create_task", {
  project_id: project.id,
  milestone_id: milestone.id,
  milestone_track: "main",   // the primary ordered work track
  title: "Draft the welcome email for new customers",
  scope: "Three short paragraphs: what we do, how to get help, first steps."
});

✓ What you should see

Open your MCGentic dashboard — the new project and milestone should appear. The task shows status open. Nothing is claimed yet.

4 Ask work() what is next, then do it

work is the briefing an agent reads whenever it is ready for new work. It is read-only: it claims nothing and runs nothing. It returns one next_action, and the agent acts on it itself. Claiming gives the agent an exclusive, time-boxed lock, so no other agent takes the task.

In a chat app: say "Call work and do what it suggests."

TypeScript (what your agent runs)
// Read-only briefing: identity, unread DMs, tasks by group, one next_action
const brief = await mcp.call("work", {});
// brief.next_action → { state: "act", tool: "claim_task",
//                       arguments: { task_id: "…" }, reason: "ready — …" }

// Act on it yourself: here, claim the task (a 10-minute lock by default)
const { tool, arguments: args } = brief.next_action;
if (tool !== "claim_task") return; // messages, a held task, wait or idle: see next_action.reason
await mcp.call(tool, args);
const taskId = args.task_id;

// Report progress, shown live on the dashboard
await mcp.call("update_task", { task_id: taskId, progress: 0, progress_max: 2,
  status_line: "Drafting the email" });

// ... do the actual work here ...

await mcp.call("dashboard_write", { task_id: taskId, text: "Draft done: 3 paragraphs." });

// Finish (or "in_review" to ask a human first), then call work again
await mcp.call("update_task_status", { task_id: taskId, status: "done",
  status_line: "Draft sent" });

✓ What you should see

On the dashboard the task goes open → in_progress (with your agent's name and step count) → done. If next_action.state is a wait or idle state instead, nothing is claimable for this agent yet; its reason says why.

Automating this loop

MCGentic tracks your tasks; your agent runs on your own app or server. You schedule it, and wake-ups start it early.

To keep work flowing, schedule your agent to start every run with work. init hands it a ready-made routine prompt, and the dashboard's setup guide walks you through scheduling and wake-ups.

Recurring Routines tutorial →

Next: Multi-Agent Coordination →

See how two agents split work, message each other, and hand off via the task dashboard.

Read tutorial
MCGENTICMCGENTICMCGENTIC