Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

docs(site): add the Use Twiligent from Claude page

spacesdrivebabc6443e66d
diff --git a/site/content/docs/reference/environment.mdx b/site/content/docs/reference/environment.mdx
index 8d28a4a..da0fb10 100644
--- a/site/content/docs/reference/environment.mdx
+++ b/site/content/docs/reference/environment.mdx
@@ -31,6 +31,8 @@ The backend only answers browsers on `FRONTEND_URL` and the addresses in `ALLOWE
| `RESEND_API_KEY` <Badge tone="secret">Secret</Badge> | <Badge tone="optional">Optional</Badge> | Resend, API Keys (sending access) | Sends sign-in and verification codes and other auth emails. |
| `EMAIL_FROM` | <Badge tone="optional">Optional</Badge> | A sender on a domain verified in Resend, for example {'Twiligent <[email protected]>'} | The sender of those emails. |
| `EMAIL_DAILY_LIMIT` | <Badge tone="optional">Optional</Badge> | A whole number; 100 when not set | Emails a day before the sign-in page pauses email codes and points people to Google or a password. |
+| `TOKEN_ENCRYPTION_KEY` <Badge tone="secret">Secret</Badge> | <Badge tone="optional">For Claude</Badge> | 32 or more random characters, for example from {'openssl rand -base64 48'} | Signs the confirmations Claude needs before it schedules or cancels a post. |
+| `MCP_OAUTH_ENABLED` | <Badge tone="optional">For Claude</Badge> | `true` | Lets Claude on the web, desktop and mobile connect, after you turn on Supabase's OAuth server. |
Platform keys are shared by every member of the instance. Missing ones only switch off that platform: Settings shows which are set, and members see a clear message instead of an error.
diff --git a/site/content/docs/use/claude.mdx b/site/content/docs/use/claude.mdx
new file mode 100644
index 0000000..9140c9f
--- /dev/null
+++ b/site/content/docs/use/claude.mdx
@@ -0,0 +1,71 @@
+export const meta = { title: 'Use Twiligent from Claude', description: 'Connect Claude Code or the Claude apps so Claude can read your analytics and manage scheduled posts.' }
+
+Twiligent includes a Model Context Protocol (MCP) server. Once you connect it, you can ask Claude things like "which of my videos did best this month" or "schedule this image for Friday at 9", and Claude uses your Twiligent account to answer.
+
+Each connection signs in as you and sees only your accounts. You decide whether it may only read, or also make changes.
+
+## What Claude can do
+
+| With | Claude can |
+| --- | --- |
+| Read only | List your accounts; read YouTube channel and Instagram account analytics; list videos and posts; compare your YouTube channels; read your scheduled posts, your settings (never keys or tokens) and an account's Instagram publishing limit |
+| Read and make changes | Everything above, plus schedule, edit and cancel Instagram posts, and change the GitHub scheduling setting |
+
+Before Claude schedules or cancels a post, it must ask you. Twiligent gives it a one-time confirmation for exactly that post, and it can only go ahead after you agree.
+
+## Connect Claude Code
+
+<Steps level={3}>
+<Step title="Create an access token">
+
+In Twiligent, open **Settings**, then **Claude**. Under **Access tokens**, give the token a name (such as the computer it is for), choose what Claude may do and when the token expires, then choose **Create token**.
+
+</Step>
+<Step title="Copy it now">
+
+The token is shown once. Copy the token, or the ready-made Claude Code command shown with it. Treat the token like a password: anyone who has it can act as you.
+
+</Step>
+<Step title="Add the server">
+
+Run the command in a terminal. It looks like this, with your own server address and token:
+
+```bash
+claude mcp add --transport http twiligent https://your-worker.example.com/mcp --header "Authorization: Bearer twl_your_token"
+```
+
+Then ask Claude Code about your accounts to check it works.
+
+</Step>
+</Steps>
+
+## Connect Claude on the web, desktop or mobile
+
+These apps sign in with OAuth instead of a token, which the instance owner turns on first (see below). Then:
+
+1. In Claude, open **Settings**, **Connectors**, **Add custom connector**, and paste the server address from **Settings**, **Claude** in Twiligent.
+2. Claude opens a Twiligent page that names the app and the site it returns to. Choose **Read only** or **Read and make changes**, then **Allow**.
+
+If the page names a site other than Claude's, choose **Deny**.
+
+## Remove access
+
+In **Settings**, **Claude**:
+
+- **Revoke** a token under **Your tokens**. Every client using it loses access at once.
+- **Remove** an app under **Approved apps**. It loses access at its next request, and connecting it again asks for your approval again.
+
+<Callout type="note" title="Text from your posts stays text">
+
+Captions, titles and comments that Claude reads come from people on YouTube and Instagram. Twiligent tells Claude to treat them as data, and the confirmation step means a caption cannot make Claude publish or delete anything without you.
+
+</Callout>
+
+## For the instance owner
+
+Access tokens work as soon as the backend is deployed. Two settings unlock the rest:
+
+- `TOKEN_ENCRYPTION_KEY`: 32 or more random characters (`openssl rand -base64 48`), set with `npx wrangler secret put TOKEN_ENCRYPTION_KEY`. Without it, Claude can read but cannot schedule or cancel posts.
+- For Claude's apps: in Supabase, open **Authentication**, **OAuth Server**, turn it on, allow dynamic client registration, and set the authorization path to `/oauth/consent`. Then set `MCP_OAUTH_ENABLED` to `true` with `npx wrangler secret put MCP_OAUTH_ENABLED` and deploy.
+
+The server address is your Worker address followed by `/mcp`. The settings are listed in [Environment variables](/docs/reference/environment).
diff --git a/site/src/docs/nav.ts b/site/src/docs/nav.ts
index bd279fa..44a5f1e 100644
--- a/site/src/docs/nav.ts
+++ b/site/src/docs/nav.ts
@@ -75,6 +75,7 @@ export const DOC_TABS: DocTab[] = [
{ slug: 'use/publishing', title: 'Publish and schedule', icon: Plane },
{ slug: 'use/automations', title: 'Reply to comments automatically', icon: ChatDots },
{ slug: 'use/tracked-content', title: 'Track content', icon: Bookmark },
+ { slug: 'use/claude', title: 'Use Twiligent from Claude', icon: Key },
],
},
{