Connect · Product guide

Connect an MCP client

Use OAuth or a site-scoped token, discover the active tools, and recover from common connection states without weakening authorization.

10 min readSource on GitHub ↗

Watch the steps

Animated walkthrough: Connect an AI client over MCP

BlogFactory · example product “Plantwise”Illustrative UI

Control · MCP Connections

Create token
Site: Plantwise
Token: ••••••••••••••••
Shown once. Copy it now.

Step 1 of 5

Create a site-scoped token

In Control → MCP Connections, create a token for one site. It is shown once and stored hashed.

Terminal · your machine

$ export BLOGFACTORY_MCP_TOKEN=<paste token>
Run ⏎

Set for this session. Nothing is sent anywhere.

Step 2 of 5

Keep it in the client environment

Store the token as BLOGFACTORY_MCP_TOKEN in the client environment. Never paste it into a prompt, an issue or a chat.

Terminal · your machine

$ codex mcp add blogfactory \
    --url https://content.example.com/mcp \
    --bearer-token-env-var BLOGFACTORY_MCP_TOKEN
Run ⏎

Server “blogfactory” added.

Step 3 of 5

Add the MCP server

Add the endpoint to your client. This is the Codex form; other clients take the same URL and bearer token.

AI client · first session

Ask: what can you do here?
  • whoamisigned in
  • list_sitesPlantwise
  • get_workspace_digestread
  • list_action_itemsread

Step 4 of 5

Discover the tools

Start with whoami and list_sites, and read the live tool list instead of assuming one. Every call stays inside the site you approved.

AI client · playbook

Run playbook prompt
  • discover_topicsDone
  • research_keywordDone
  • generate_draftAsked first
  • review_postWaiting for you

Step 5 of 5

Let it work, then stop at review

Paste the playbook prompt. The agent researches, drafts, checks and fixes, asks before it spends your model budget, and stops at review.

Illustrative UI: a composite of the real screens with an invented example product. It is not a recording, and no real account or data is shown.

Connection model

Your BlogFactory instance exposes a site-scoped Streamable HTTP endpoint at <instance-origin>/mcp.

More

OAuth is the normal connection path when configured. A compatible client follows protected-resource metadata and receives only the sites and draft-only scopes the user approved.

A personal token is an advanced fallback. It is created in Control → MCP Connections, shown once, stored hashed, and belongs in the client environment—not a prompt, issue, or chat message.

Connect with OAuth

Codex
codex mcp add blogfactory --url https://content.example.com/mcp
codex mcp login blogfactory
More

Use a personal connection token

Codex
codex mcp add blogfactory \
  --url https://content.example.com/mcp \
  --bearer-token-env-var BLOGFACTORY_MCP_TOKEN
Steps and detail
  1. Open Control → MCP Connections on your instance and create a site-scoped token.
  2. Save it when shown; it cannot be displayed again.
  3. Store it as BLOGFACTORY_MCP_TOKEN in the client environment.
  4. Add the MCP server with that environment variable.

Discover before you work

Run authenticated MCP initialization and tools/list instead of assuming a fixed client-side catalog.

More

The current server catalog contains reading, generation, revision, Search Console, review, and CMS-draft tools; authority is always site-scoped and server-enforced.

401
Start the advertised OAuth flow or verify the local token environment variable
403
Request the approved site scope; do not bypass authorization
Conflict
Reread the post and send the current expected_updated_at value
Generation pending
Poll get_job; do not start a duplicate run