> ## 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 and Wix enabled per account on request. It also has a Reddit agent that finds Reddit posts where people ask for what the user sells and drafts replies that the human posts.
>
> Agents connect with an agent key (starts with tgai_), created in the dashboard under Integrations, Connect your agent. 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, reddit); 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. The Reddit agent never posts for the user.
>
> 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, 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 with your agent key. 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.

## What do I need first?

* An agent key (starts with `tgai_`). See [Connect your AI agent](/agents/connect-your-agent).
* Claude Code installed.

## How do I do it?

1. Put your key in an environment variable:

   ```bash theme={null}
   export TALKGENAI_API_KEY=tgai_your_key_here
   ```

2. Add the server:

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

3. Restart Claude Code, or start a new session, so it loads the tools.

## How do I check that it worked?

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

## 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](/agents/publish-safely).

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.

## What can go wrong?

| Symptom | Cause | Fix |
| - | - | - |
| `401 unauthorized` | Key not set or revoked | Check `$TALKGENAI_API_KEY`, create a new key if needed |
| Tools missing | 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-10-05

## Related

* [MCP tools reference](/agents/mcp-tools)
* [Connect Cursor](/agents/cursor)
* [Errors](/agents/errors)

<Card title="Create an agent key" icon="key" href="https://app.talkgen.ai/connect-agent?utm_source=docs&utm_medium=cta&utm_content=claude-code">
  Free account, about two minutes.
</Card>


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