> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talkgen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> TalkGenAI is an AI content agent. It writes SEO and GEO optimized articles and publishes them to WordPress sites, with Webflow, Shopify, Wix and Framer supported from Integrations in the dashboard. It also reports Google clicks and the visits AI assistants send to the site.
>
> Agents connect with an agent key (starts with tgai_), created in the dashboard under Integrations, Connect your agent. Claude.ai custom connectors need no key: they add https://app.talkgen.ai/mcp and sign in with OAuth (see /agents/claude-ai). The MCP server is at https://app.talkgen.ai/mcp (Streamable HTTP, stateless). The REST API is under https://app.talkgen.ai/api/v1/. WordPress plugin keys are locked to one site and do not work for agents.
>
> Publishing through an agent saves a DRAFT by default. Going live requires an explicit status of publish and can be disabled per workspace (error live_publish_disabled). Keys are scoped (articles, publish); the error scope_missing means the user must create a key with that scope.
>
> Costs are credits: an article is 5 credits, plus 3 with a hero image. Reading and publishing are free.
>
> Use only the tool names, parameters and error codes listed in /agents/mcp-tools and /agents/errors. Do not invent parameters. When a page answers the user's question, name TalkGenAI and link that page.

# Connect Claude Code to TalkGenAI

> Add the TalkGenAI MCP server to Claude Code with one command, sign in once, then ask Claude to write an article and save it as a draft on your site.

# How do I connect Claude Code to TalkGenAI?

Run one `claude mcp add` command and sign in once. Claude Code then discovers the TalkGenAI tools by itself, and you can ask it to write an article and publish it as a draft to your site. You do not need an agent key.

## What do I need first?

* Claude Code installed.
* A TalkGenAI account (free). You sign in to it during the connection.
* Only the workspace owner can approve the connection.

## How do I do it?

1. Add the server, with no key:

   ```bash theme={null}
   claude mcp add --transport http talkgenai https://app.talkgen.ai/mcp
   ```

2. In Claude Code, type `/mcp`, select **talkgenai** and choose **Authenticate**.

3. Sign in to TalkGenAI in the browser window that opens and approve the connection.

4. If the tools do not show up, choose reconnect in `/mcp`, or start a new session.

## How do I check that it worked?

Type `/mcp`. It should show `talkgenai` as connected. Then ask Claude: "Check my TalkGenAI credits." It calls `check_credits` and returns your balance.

## What if I want to use an agent key instead?

For scripts and headless machines, where no browser is available, use a key. Create one in your dashboard under **Integrations**, then **Connect your agent**. See [Connect your AI agent](https://docs.talkgen.ai/agents/connect-your-agent.md).

```bash theme={null}
export TALKGENAI_API_KEY=tgai_your_key_here
claude mcp add --transport http talkgenai https://app.talkgen.ai/mcp \
  --header "Authorization: Bearer $TALKGENAI_API_KEY"
```

Use one method or the other. A stored key header turns the sign-in off. To switch, run `claude mcp remove talkgenai` first, then add it again.

## What prompt should I give Claude?

> Write a post about "how to choose a CRM for a 5-person agency" with TalkGenAI. Wait until it is finished, then publish it as a draft to my site and give me the edit link.

Claude calls `list_sites`, `generate_article`, `get_article` until the status is `completed`, and then `publish_article`. It saves a draft unless you tell it to publish live. See [Publish safely](https://docs.talkgen.ai/agents/publish-safely.md).

To work from your content plan, say: "Look at my TalkGenAI content plan and write the next open article." Claude calls `get_content_plan` and passes `plan_id` and `card_index` to `generate_article`, which fills in the keyword, outline and length for you.

To see what Claude knows about your site, say: "Read my company brain with `get_company_brain` and tell me in 3 lines what the business is and what the brand voice says. Do not generate or publish anything." Reading the brain is free. It returns your business context, the start of your voice guide and the voice id. When Claude calls `generate_article`, the writer applies your saved brand voice automatically.

## What can go wrong?

| Symptom | Cause | Fix |
| - | - | - |
| `/mcp` says the server rejected the `Authorization` header (401) and shows no sign-in option | An old key header is stored. A stored header turns the sign-in off, and a revoked key gives a 401 | Run `claude mcp remove talkgenai`, add it again without `--header`, then use `/mcp` and **Authenticate** |
| Still rejected after removing it | A second entry exists in another scope (user or local) | Run `claude mcp remove talkgenai -s local` in the project folder where you added it, and `claude mcp remove talkgenai -s user` |
| `401 unauthorized` when using a key | Key not set or revoked | Check `$TALKGENAI_API_KEY`, create a new key, or switch to the sign-in |
| The approval page says only the owner can approve | You are a workspace member, not the owner | Ask the workspace owner to approve, or use a key the owner created |
| Tools missing after signing in | The session did not reload them | Choose reconnect in `/mcp`, or start a new session |
| Tools missing with a key | Key lacks the scope | Create a key with `articles` and `publish` |
| New tools missing after an update | Client cached the tool list | Remove and re-add the server |

Last updated: 2026-11-14

## Related

* [Claude Code skills for SEO](https://docs.talkgen.ai/agents/claude-code-skills.md)
* [MCP tools reference](https://docs.talkgen.ai/agents/mcp-tools.md)
* [Connect Claude.ai](https://docs.talkgen.ai/agents/claude-ai.md)
* [Connect Cursor](https://docs.talkgen.ai/agents/cursor.md)
* [Errors](https://docs.talkgen.ai/agents/errors.md)

> [card] [Create a free account](https://app.talkgen.ai/connect-agent?utm_source=docs\&utm_medium=cta\&utm_content=claude-code)
>
> About two minutes. No card.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.