Skip to main content Skip to page footer

CLI Commands

The MCP server of the AI Suite comes with three console commands. Without Composer, you call typo3/sysext/core/bin/typo3 instead of vendor/bin/typo3.

CommandPurpose
ai-suite-mcp:create-tokenGenerates a token without going through the OAuth flow. For tests, local clients and automation, not for regular operation.
ai-suite-mcp:cleanupCleans up expired OAuth data, session and task files. Mandatory in production.
ai-suite-mcp:serverStarts a local MCP server via stdio, see Local stdio transport.

Generate token

The command issues a token directly and thus bypasses the OAuth flow. This is practical for tests and automated environments, but does not belong in regular operation. For everyday use, the backend module “AI Suite” under “MCP” (in a narrow view via “More”) is the right way.

Since version 0.12.0, --user and --audience are required. --user takes the UID or the username, there is no default account any more. --audience is the canonical resource URI the token is bound to, for example [typo3-url]/aisuite-mcp, because the console has no request host to derive it from. --client sets the client ID (default mcp-inspector). Without --scopes, the token receives all scopes the user is authorized for, requested scopes are cut down to these. The validity is determined by mcpTokenLifetimeDays, such a token cannot be refreshed.

The command refuses to run while enableMcp is off, for a disabled user and for a user without the permission enable_mcp_access. Since version 0.12.0, the same applies to ai-suite-mcp:server.

--workspace=<uid> binds the token to a workspace.

vendor/bin/typo3 ai-suite-mcp:create-token --user=1 --audience="https://[typo3-url]/aisuite-mcp" --workspace=3
  • Show larger version “AI Suite” backend module, “MCP” tab: form for creating a personal token, MCP status with endpoint and available scopes, and the “Active Tokens” section, still without tokens

    In everyday use, tokens are not created on the command line but in the backend module “AI Suite” under “MCP” (if the bar does not fit the width, via “More”). There, every user creates their own token and sees their active tokens.

Generate token for a backend user

vendor/bin/typo3 ai-suite-mcp:create-token --user=1 --audience="https://[typo3-url]/aisuite-mcp"

Token with restricted scopes

vendor/bin/typo3 ai-suite-mcp:create-token --user=admin --audience="https://[typo3-url]/aisuite-mcp" --scopes="mcp:read mcp:write mcp:generate"

Token for a specific client

vendor/bin/typo3 ai-suite-mcp:create-token --user=1 --audience="https://[typo3-url]/aisuite-mcp" --client=claude-code

Cleanup

The command removes:

  • authorization codes older than 10 minutes
  • tokens whose access and refresh token expired more than 37 days ago (fixed value, independent of the lifetime settings)
  • revoked tokens older than 30 days. They are permanently deleted from tx_aisuite_oauth_tokens to comply with the right to erasure. Until then, they remain as soft deletes, so that the reuse of a rotated refresh token can still be detected as theft. After that, the signal is worthless anyway.
  • session files under var/aisuite_mcp_sessions/ older than twice mcpSessionTimeoutSeconds, but at least one hour (so one hour with the default value)
  • task files under var/mcp_tasks/ older than 30 days
  • since version 0.12.0, client registrations unused for 30 days that no longer hold an active token

In production, the command should run at least hourly, via the scheduler or via system cron. If it does not run, the table of authorization codes grows without limit, the directories for sessions and tasks fill up, and expired tokens pile up. On installations with many concurrent users, it is worth looking at the row count in tx_aisuite_oauth_tokens. If it grows faster than it is cleaned up, smaller values for mcpRefreshIdleDays and mcpRefreshMaxLifetimeDays (OAuth) or mcpTokenLifetimeDays (tokens from the MCP screen and the CLI) help.

  • Show larger version Cleanup task ai-suite-mcp:cleanup in the scheduler

    In the scheduler, ai-suite-mcp:cleanup runs as a recurring task. Under Timing we set the frequency, here hourly with the cron expression 0 * * * *.

Clean up expired data

vendor/bin/typo3 ai-suite-mcp:cleanup