---
name: metorial-setup
description: Step-by-step instructions for an AI agent setting up Metorial for a user, either by running commands itself or by guiding the user through the dashboard. Covers connecting an AI client with a Magic MCP URL, building on the API or SDK, and self-hosting.
---

# Set up Metorial

Follow these steps in order. Background on what Metorial is and which path fits: <https://metorial.com/docs-static/skill.md>. Full docs: <https://metorial.com/llms.txt>.

## 1. Ask two questions first

1. **Which path?** Ask the user which of these they want, unless the task already makes it clear:
   - **A. Connect an AI client** (Claude Code, Cursor, Codex, ChatGPT, Claude) to company tools through their Metorial portal.
   - **B. Build on the API or SDK** (an agent or product that calls tools for its users).
   - **C. Self-host** the open-source Metorial Platform.
2. **Can you run commands?** Check whether you can run shell commands on the user's machine.
   - If yes, follow the **With a terminal** steps and run the commands yourself.
   - If no, follow the **Without a terminal** steps and give the user each step to do.

Some steps always need the user: signing in with their company account, approving OAuth consent, and creating API keys in the dashboard. Ask them to do these and wait for them to confirm.

## 2. Optional: give yourself the docs

If you can edit your own MCP config, add the read-only docs server so you can look things up while you work. It needs no sign-in.

- Claude Code: `claude mcp add --transport http metorial-docs https://metorial.com/docs-api/mcp`
- Codex: `codex mcp add metorial-docs --url https://metorial.com/docs-api/mcp`
- Cursor: add `"metorial-docs": { "url": "https://metorial.com/docs-api/mcp" }` under `mcpServers` in `.cursor/mcp.json`

Guide: https://metorial.com/docs/build/use-docs-in-your-ai-client.md

## Path A: connect an AI client

The user needs a Metorial portal with the integrations they want. If they are the admin and have none yet, start with <https://metorial.com/docs/platform/workforce/portals.md> and <https://metorial.com/docs/platform/workforce/grant-access.md>.

1. Ask the user to open their company's Metorial portal, sign in, and copy the URL from the **Magic MCP URL** card on the portal home page. Do not guess this URL.
2. Add it to the client.

**With a terminal**

- Claude Code: `claude mcp add --transport http metorial <magic-mcp-url>` (add `--scope user` for every project).
- Codex: `codex mcp add metorial --url <magic-mcp-url>`
- Cursor: write this to `.cursor/mcp.json` in the project, or `~/.cursor/mcp.json` for every project:

  ```json
  { "mcpServers": { "metorial": { "url": "<magic-mcp-url>" } } }
  ```

**Without a terminal**

Send the user the guide for their client and the URL to paste:

- Claude Code: https://metorial.com/docs/platform/clients/claude-code.md
- Cursor: https://metorial.com/docs/platform/clients/cursor.md
- Codex: https://metorial.com/docs/platform/clients/codex.md
- ChatGPT: https://metorial.com/docs/platform/clients/chatgpt.md
- Claude: https://metorial.com/docs/platform/clients/claude.md

3. Ask the user to sign in with their company account, then choose which integrations and tools the client may use:
   - Claude Code: run `/mcp`, select **metorial**, and sign in.
   - Codex: run `codex mcp login metorial` (add `--no-browser` in a terminal without a browser).
   - Cursor: open **Customize** in the sidebar, find Metorial, and sign in.

   If the browser sign-in fails to return to a CLI client, the portal's **Allowed OAuth Redirects** must include **Localhost apps** (`http://localhost:*/*`).
4. Check: list the Metorial tools you can now see. If an integration is missing, the user's groups may not grant it, or it was not selected on the consent screen.

## Path B: build on the API or SDK

1. Ask the user to sign in at https://platform.metorial.com, open **Developer**, **API Keys**, select **Create API Key**, and give you the secret key (`metorial_sk_...`) through an environment variable, not in chat or a committed file.
2. Ask the user to deploy a provider (for example Exa for search) in the dashboard and give you its provider deployment ID.

**With a terminal**

```bash
export METORIAL_API_KEY=metorial_sk_...   # the user sets this; keep it out of git
npm install metorial @metorial/ai-sdk     # or @metorial/anthropic, @metorial/openai, @metorial/google
# Python: pip install metorial
```

Then write the agent from the quickstart, which shows the full TypeScript and Python code: https://metorial.com/docs/build/quickstart.md

**Without a terminal**

Give the user the install commands above and the quickstart link, and write the code for them to paste.

3. Check: call the API with the key, for example `curl https://api.metorial.com/provider-deployments -H "Authorization: Bearer $METORIAL_API_KEY"`. Reference: https://metorial.com/docs/build/api.md and https://metorial.com/api.md

For users who connect their own accounts through OAuth, see <https://metorial.com/docs/build/sdk/oauth.md>.

## Path C: self-host

Requirements: Docker with Compose, at least 8 GB of RAM, about 20 GB of free disk, and Node.js, npm and Bun. The repository setup is meant for running and evaluating the platform; for production with strict compliance needs, point the user to <https://metorial.com/features/on-prem>.

**With a terminal**

```bash
git clone https://github.com/metorial/metorial-platform.git
cd metorial-platform
./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)"
```

**Without a terminal**

Give the user the commands above.

Then ask the user to open `http://localhost:3300` and create an account. The core API runs on `http://localhost:4310`.

## When you are stuck

- Search the docs with the `search_docs` tool, or fetch https://metorial.com/docs/api/v1/pages/search?q=<terms>.
- Read any docs page as markdown by adding `.md` to its URL.
- FAQ: https://metorial.com/docs/platform/guides/faq.md
