Django Admin
Django admin of the MCPServer app: the audit trail of the operations tools, for superusers, read-only.
Every call to a staff-only tool of the MCPServer
(smarter.apps.mcpserver.protocol.staff) is recorded as an
OperationsToolCall. This module registers that model on
the restricted admin site, so that a superuser can see who called which tool, for which help desk
ticket, and whether it failed. The rows are evidence, so they cannot be added or changed here.
The repository indexes, RepositoryIndex and
RepositoryFile, are not registered: they are rebuilt by the
indexing tasks, and are not edited by hand.
Note
Experimental. The MCPServer was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.
- class smarter.apps.mcpserver.admin.OperationsToolCallAdmin(model, admin_site)[source]
Bases:
SmarterSuperUserOnlyModelAdminThe admin of the audit trail of the MCPServer’s staff-only tools.
The server writes a row on every tool call, so the admin is read-only: every field is read-only, and rows cannot be added or changed. Only superusers see it, through
SmarterSuperUserOnlyModelAdmin, and a superuser may delete rows, e.g. when they are no longer needed.- has_add_permission(request, obj=None)[source]
Refuse to add a tool call by hand: only the MCP server writes them.
- Parameters:
request – The admin request.
obj – Unused.
- Return type:
- Returns:
Always False.
- has_change_permission(request, obj=None)[source]
Refuse to change a tool call, so that the audit trail stays as the server wrote it.
- Parameters:
request – The admin request.
obj – The tool call, or None for the list.
- Return type:
- Returns:
Always False.
- list_display = ['created_at', 'username', 'tool', 'ticket', 'is_error', 'characters']
The columns of the list of tool calls.
- list_filter = ['tool', 'is_error']
The filters in the list’s sidebar.
- property media
- readonly_fields = ['id', 'created_at', 'updated_at', 'user', 'username', 'tool', 'ticket', 'arguments', 'is_error', 'characters']
Every field of the model, so that a tool call can be read but not edited.
- search_fields = ['ticket', 'tool', 'username']
The fields that the list’s search box searches.