# Configure DesignGen for this user

You are the setup agent for Codex. Complete every machine-owned step below. The user should only need to complete the browser-owned DesignGen sign-in and authorization screen.

## Completion criteria

- A Streamable HTTP MCP server named `designgen` points to `https://mcp.trydesigngen.com/mcp`.
- A self-contained DesignGen skill is installed at `$HOME/.agents/skills/designgen/SKILL.md`.
- The DesignGen OAuth login has been opened for the user.
- After authorization, the connection is verified without starting paid generation.

## Safety boundaries

- Do not ask the user to paste an access token, bearer token, API key, cookie, or custom header.
- Do not make an approval or autonomy-policy choice for the user.
- Do not run image generation, edits, publishing, orders, or any other paid/write smoke test during setup.
- Modify only the `designgen` MCP entry and the DesignGen skill directory. Preserve all unrelated agent configuration.

## Agent-owned setup steps

1. Confirm that the `codex` CLI is available.
2. Inspect the existing server with `codex mcp get designgen --json`.
3. If the server is missing, run `codex mcp add designgen --url https://mcp.trydesigngen.com/mcp`.
4. If an existing `designgen` entry already uses `https://mcp.trydesigngen.com/mcp`, keep it. If it uses a different URL, preserve the current `codex mcp get designgen --json` output in your progress note, run `codex mcp remove designgen`, and add the production entry. Do not change any other MCP server.
5. Create `$HOME/.agents/skills/designgen/` if needed and install the exact `SKILL.md` payload below. If that file exists, update only the DesignGen skill and leave every other skill untouched.
6. Run `codex mcp login designgen`. When the browser opens, pause and tell the user: **Sign in to DesignGen, review the requested scopes and approval policy, then approve access.**
7. After the user finishes authorization, run `codex mcp list` and confirm `designgen` is enabled with OAuth.
8. If the current task cannot see newly added MCP tools, tell the user to restart Codex or open a new task. Do not treat a stale tool list as a failed OAuth grant.
9. Once tools are visible, call `mcp_connection_status` and report the connected client, granted scopes, and approval policy. Do not call a paid or write tool.

## DesignGen skill to install

Write the following content exactly to `$HOME/.agents/skills/designgen/SKILL.md`:

```markdown
---
name: designgen
description: Use when the user wants to create, edit, inspect, mock up, or prepare merch artwork with DesignGen MCP, including logo-safe generation, print-ready preparation, background removal, vectorization, mockups, Creative Studio workflows, approvals, and production QA.
---

# DesignGen

Use the connected DesignGen MCP server as the action layer for apparel artwork, brand assets, mockups, listings, Creative Studio, and print-readiness.

## Start every task

1. Call `mcp_connection_status` before write or paid work.
2. Call `designgen_mcp_guide` for the relevant topic when permissions, approvals, print-readiness, or recovery behavior is unclear.
3. Reuse the user's existing DesignGen session, brand, files, and artifacts when possible.
4. Prefer the highest-level workflow tool that completes the user's goal.

## Workflow rules

- For carousels, start with `designgen_carousel` (operation `start`), present the returned approval, then follow its `nextCall` data through completion.
- For async image generation, save the returned `generationId` and call `designgen_generation` (operation `get`); do not submit a duplicate generation while the first is processing.
- For print preparation, use `designgen_print_prep` (operation `prepare`) and treat its result as a production-ready candidate until final production review is complete.
- Preserve logo geometry, readable words, brand colors, and separate reference-image roles unless the user explicitly requests a change.
- Use public quality tiers such as Standard, Ultra, and Ultra Max. Never expose internal provider names, raw model IDs, provider request IDs, or backend routing details.

## Approval and spend safety

- Respect the connected user's scopes and autonomy policy.
- Never approve an action on the user's behalf. Present the live approval and wait for the user's decision.
- Keep approval controls disabled until `designgen_approvals` (operation `get`) confirms a live pending approval.
- Do not start paid generation during connection verification.
- If a tool returns `paid_plan_required` or `insufficient_scope`, follow the structured recovery action instead of retrying.

## Completion report

Report the DesignGen tools used, session and artifact IDs or URLs, approval status, whether the result is preview-ready or still needs production review, and any limitation affecting print quality or logo fidelity.
```

## Success message

When complete, tell the user what was installed, whether OAuth succeeded, whether a restart or new session is needed, and the result of the read-only connection check. Never claim setup is complete before authorization succeeds.

Source guide: https://www.trydesigngen.com/agents/designgen/codex

---

# DesignGen Codex reference

Hand the setup to your agent, complete the secure DesignGen sign-in, and start using print-ready and Creative Studio workflows.

## Fastest setup: hand this page to your agent
Use Copy setup for your agent at the top of this page. The copied Markdown tells Codex how to install the self-contained DesignGen skill, add the production MCP server, verify its configuration, and open the OAuth sign-in.

- The agent handles the MCP configuration and installs the DesignGen workflow skill.
- You handle only the browser-owned steps: sign in, review scopes and approval policy, and approve access.
- The setup brief forbids pasted tokens, headers, paid test calls, and approval decisions made on your behalf.

## Before you start
DesignGen uses browser-based OAuth. You do not need to create or paste a bearer token, API key, or custom header into Codex.

- Use the production endpoint: https://mcp.trydesigngen.com/mcp
- Sign in with the DesignGen account whose brands, files, credits, and Creative Studio sessions you want the agent to use.
- A paid DesignGen plan is required for MCP access. Codex will open the DesignGen authorization page during setup.

## Add the MCP server in Codex
Create a Streamable HTTP server from Codex settings.

- Open Codex settings and select MCP servers.
- Click Add server, then choose Streamable HTTP.
- Name the server DesignGen.
- Enter https://mcp.trydesigngen.com/mcp as the server URL.
- Leave bearer token and custom headers empty, then save the server.

## Authenticate DesignGen
After saving the server, complete the OAuth flow in the browser window Codex opens.

- Click Authenticate in Codex.
- Sign in to DesignGen if the authorization page asks you to sign in.
- Review the requested permissions and confirm they match the work you want the agent to perform.
- Choose an approval policy, click Approve, and return to Codex.
- Restart or refresh MCP servers if Codex asks you to do so after authorization.

## Choose an approval policy
Approve Every Write is the recommended starting policy for most users. It lets the agent inspect context while keeping write and spend actions behind approval.

- Approve Every Write: recommended for everyday use and first-time connections.
- Budgeted Autonomy: use for a clearly bounded workflow when you are comfortable approving its tools, run limit, and credit budget once.
- Fully Autonomous: advanced mode that permits allowed write actions without per-action approval. Enable it only when you understand the impact.

## Verify the connection
Start with a read-only connection check before requesting generation or other write actions.

- In Codex, ask: Use DesignGen MCP to check connection status.
- The agent should call mcp_connection_status and report the connected client, approval policy, and granted scopes.
- For carousel approvals, do not approve a card that still says it is waiting for workflow data. Regenerate the approval or refresh the MCP connection.

## Troubleshoot setup
Most connection failures identify the recovery action in a structured error.

- paid_plan_required: open the billing link, upgrade, and retry authorization.
- insufficient_scope: reconnect DesignGen and approve the scopes requested for the blocked tool.
- approval_not_found or a disconnected approval card: regenerate the workflow approval. If tools are missing, refresh or restart the Codex MCP server first.
- Processing generation: call designgen_generation (operation "get") with the existing generationId instead of rerunning designgen_generate (operation "image").
