{% extends "account-base.html" %} {% from "ui.html" import csrf_field, action, when, copyable, reveal_notice, access_limits with context %} {% block section %} {# Freshly created token: at the top of the page, focus on "Copy" (preferences.js), and a confirmation before leaving as long as it has not been copied: it will not be shown again. #} {% if revealed %}

{{ _("Your new token") }}

{{ reveal_notice(revealed, _("Copy this token now: it will not be shown again.")) }}

{{ _("Command for Claude Code:") }}

{{ copyable("mcp-command", 'claude mcp add --transport http synaptane ' ~ mcp_url ~ ' --header "Authorization: Bearer ' ~ revealed ~ '"', block=true) }}
{% endif %}

{{ _("Connect an AI assistant (MCP)") }}

{{ _("MCP server address") }}

{{ copyable("mcp-url", mcp_url, block=true) }}
{{ _("Claude.ai and Claude Desktop") }}
  1. {{ _("Settings → Connectors → Add custom connector.") }}
  2. {{ _("Paste the address above, then authorize access on the page that opens (you can limit it to reading or to some spaces).") }}
{{ _("ChatGPT") }}
  1. {{ _("In ChatGPT's settings, turn on developer mode (Apps or Connectors section), then create a connector.") }}
  2. {{ _("Paste the address above, choose OAuth authentication, then authorize access. The search and fetch tools follow the format ChatGPT expects.") }}
{{ _("Claude Code") }}

{{ _("Create a personal token below: the command to paste is then shown.") }} {{ _("Create a token") }}

{{ _("Other MCP clients (Cursor, VS Code…)") }}

{{ _("Remote Streamable HTTP server at the address above. Authentication: OAuth if the client offers it, otherwise the “Authorization: Bearer” header with a personal token.") }}

{% if not member_spaces %}
{{ _("You are not a member of any space: an assistant connected now would see nothing. Ask to be added to a space, or create an organization you administer.") }}
{% endif %} {% if user.is_superadmin %}

{{ _("Super admin: your assistants only reach the spaces you are a member of (or whose organization you administer), never the whole instance.") }}

{% endif %}

{{ _("Test the connection") }}

{{ _("Ask your assistant: “List my Synaptane spaces”. The call shows up here as soon as it arrives.") }}

{{ _("Reload the page after asking: the latest calls are listed below.") }}

{% if uses %}
{% for name, kind, last_at, calls in uses %}{% endfor %}
{{ _("Latest calls from your assistants") }}
{{ _("Client") }}{{ _("Last call") }}
{% if kind %}{{ _("personal token") if kind == "token" else _("application") }}{% endif %}
{% endif %}

{{ _("Connected applications") }}

{{ _("Assistants authorized through the sign-in page (OAuth), such as Claude.ai or ChatGPT.") }}

{% for family, name, created in apps %}

{{ name }}

{{ _("Authorized") }} {{ when(created, "date") }} {{ action("/account/apps/" ~ family ~ "/revoke", _("Disconnect"), confirm=_("Disconnect {name}? It will need to be authorized again.", name=name), kind="danger") }}
{% else %}

{{ _("No connected application.") }}

{% endfor %}

{{ _("Personal tokens") }}

{{ _("For the REST API, Claude Code and your scripts. A token has your permissions, never more.") }}

{% for token in tokens %}

{{ token.name }}

…{{ token.hint }}
{% if token.read_only or token.inbox_only or token.space_ids is not none %}

{% if token.read_only %}{{ _("read only") }} {% elif token.inbox_only %}{{ _("reading and inbox") }} {% endif %}{% if token.space_ids is not none %}{{ _("Spaces:") }} {% for sid in token.space_ids %}{{ space_labels.get(sid, _("deleted space")) }}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}

{% endif %}
{% if token.expires_at %}{{ _("Expires") }} {{ when(token.expires_at, "date") }}{% else %}{{ _("No expiry") }}{% endif %}{% if token.last_used_at %} · {{ _("used") }} {{ when(token.last_used_at) }}{% endif %} {{ action("/account/tokens/" ~ token.id ~ "/revoke", _("Revoke"), confirm=_("Revoke the token “{name}”? Tools using it will lose access.", name=token.name), kind="danger") }}
{% else %}

{{ _("No tokens.") }}

{% endfor %}

{{ _("New token") }}

{{ csrf_field() }}
{{ access_limits(member_spaces) }}
{% endblock %}