• READY
  • SCOPED
  • VERIFIED
  • HUMAN

How to generate API access tokens with your AI

Connect Forgejo to your AI client once. After that, you can manage repository access through simple chat commands.

Ask AI about this page

Short answer

How do I make a new API token for my Forgejo repo?

Just tell your AI which repository needs access and what permissions to grant. It uses the create_token tool to build a scoped personal access token immediately. You'll get the token string to use in your scripts or CLI.

Token generation outcomes

What you get from your AI

The results of your conversational commands.

READY

New token created

The AI uses create_token to generate a unique string. You get the token text to copy into your environment variables.

SCOPED

Specific permissions set

The AI applies only the scopes you requested. This keeps your repositories safe by limiting what the token can touch.

VERIFIED

Scope confirmation

Your AI confirms exactly which permissions were applied to the new token. You can double-check the logic before you use it.

HUMAN

Manual token storage

The AI provides the token, but you must save it yourself. It won't store your secrets or keep them in a database for you.

The workflow

What your AI does when you ask for a token.

The AI translates your plain English request into a specific API call.

  1. Identify the target

    Your AI looks at your request to find the specific Forgejo repository you want to access.

    create_token
  2. Define permissions

    The AI maps your words like 'read-only' or 'write access' to the correct technical scopes.

    create_token
  3. Execute generation

    The AI calls the specific tool to create the token with the chosen settings.

    create_token
  4. Deliver the secret

    The AI presents the raw token string in the chat so you can grab it.

    create_token

Try it

Copy these to start.

Use these prompts to trigger the token creation process.

Starting points

Swap out the repository names and permission levels to match your actual needs.

Forgejo Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_OGbMMQVsinb0BjKH6qJI5Qwlr4pWGYjZRMU7QWs7/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Forgejo capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "forgejo-gitea-fork-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_OGbMMQVsinb0BjKH6qJI5Qwlr4pWGYjZRMU7QWs7/mcp"
    }
  }
}
Copy into chat04
  • Create a read-only token for my 'web-app' repository.

  • I need a new token with write access for the 'backend-api' repo.

  • Generate a scoped token for 'data-science-project' that only allows repo metadata access.

  • Make a token for the 'frontend-assets' repo with full repository permissions.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Forgejo once, then ask.

Click the link to link your Forgejo instance. Your credentials stay encrypted and private, and you can start chatting with your repos immediately.

Connect Forgejo to your AI

FAQ

How this task behaves

  • 01

    Can the AI delete my existing tokens?

    No. This MCP only has the capability to create new tokens via the create_token tool.

  • 02

    Will the AI remember my token for next time?

    No. For security reasons, the AI does not store your tokens. You need to copy and save the token as soon as it is generated.

  • 03

    Can I ask for admin-level permissions?

    Yes, as long as your Forgejo account has the authority to grant those permissions.

  • 04

    Does the AI choose the scopes for me?

    The AI suggests scopes based on your language, but it will only execute the creation once it matches your intent.

  • 05

    Can the AI create tokens for other users?

    No. The AI can only create tokens using the permissions of the user who connected the Forgejo MCP.

  • More questions about Forgejo? The Connector page answers them. See everything the Forgejo Connector can do

Connect Forgejo to Claude, Cursor, ChatGPT & more