Skip to main content

Connect Claude Code, Codex, Cursor

This page shows how to create a token and add the KDT Sharing MCP server to Claude Code, Codex or Cursor. You only need to do it once per machine.

Before you start​

  • You belong to at least one workspace whose owner is on the Creator or Team plan. Otherwise the page shows a notice with an Upgrade button.
  • Claude Code, Codex or Cursor is installed on your machine.

Create a token​

  1. In the sidebar, under Workspace, choose AI connections.

    The AI agents over MCP card with the Token name field and the Permission and Expiry options
    Create a token for your AI agent
  2. Enter a Token name, such as "Claude Code on my work laptop". The name helps you recognize the token if you need to revoke it.

  3. Pick a Permission: Read only, Read and draft or Read, draft and publish. See Tokens and permissions.

  4. Pick an Expiry: 30, 90 or 365 days, or Never expires.

  5. Click Create token.

  6. Click Copy and store the token somewhere safe.

warning

The token is shown only once. After you leave the page you can't see it again. If you lose it, revoke it and create a new one.

Add it to your agent​

The Agent setup section on the page has a ready-made snippet for each agent. Right after you create a token, the snippets already contain it. On later visits, replace <TOKEN> with the token you saved.

The Agent setup section with snippets for Claude Code, Codex and Cursor
Ready-made setup for each agent

The MCP endpoint is https://kdtsharing.com/mcp. The server name in the examples below is auto-social.

Claude Code​

Run in a terminal:

claude mcp add --transport http auto-social https://kdtsharing.com/mcp --header "Authorization: Bearer <TOKEN>"

Codex​

  1. Add this to ~/.codex/config.toml:

    [mcp_servers.auto-social]
    url = "https://kdtsharing.com/mcp"
    bearer_token_env_var = "AUTO_SOCIAL_TOKEN"
  2. Set the environment variable before running codex:

    export AUTO_SOCIAL_TOKEN=<TOKEN>

Or add it with one command:

codex mcp add auto-social --url https://kdtsharing.com/mcp --bearer-token-env-var AUTO_SOCIAL_TOKEN
note

When you run codex exec (with no one to approve actions), Codex automatically refuses the delete_post tool. Run Codex interactively if you want the agent to delete posts.

Cursor​

Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in your project folder:

{
"mcpServers": {
"auto-social": {
"url": "https://kdtsharing.com/mcp",
"headers": {
"Authorization": "Bearer <TOKEN>"
}
}
}
}

Check the connection​

  1. Open your agent and ask: "List my workspaces on KDT Sharing."
  2. The agent calls list_workspaces and returns your workspaces, your role and each workspace's time zone.
  3. Go back to AI connections. The token's Last used column now shows a time.

Common errors​

ErrorWhat to do
The agent reports a 401 or can't authenticateThe token is wrong, revoked or expired. Check the token, or create a new one. Changing your password also revokes all tokens.
You already have too many active tokensEach person can have up to 10 active tokens. Revoke an old token before creating a new one.
The agent says it has no access to a workspaceThat workspace owner's plan doesn't include AI agent connections, or your role doesn't allow the action.
Codex can't find the tokenThe AUTO_SOCIAL_TOKEN variable isn't set in the environment where you run codex.

Next steps​