Skip to content

Allow EXPLAIN ANALYZE for SELECT queries when in restricted mode #153

@sargue

Description

@sargue

Currently, it seems the validator doesn't allow it.

[02/12/26 10:59:51] INFO     Processing request of type            server.py:534
                             CallToolRequest
                    ERROR    Error executing query: Error          server.py:401
                             validating query: EXPLAIN (ANALYZE,
                             BUFFERS) SELECT chats.chat_id,
                             chats.creator, chats.other_user
                             FROM chats
                             JOIN users AS creator_user ON
                             chats.creator = creator_user.id
                             JOIN users AS other_user ON
                             chats.other_user = other_user.id
                             WHERE chats.chat_type = (SELECT
                             'ONE_ON_ONE'::chat_type)
                               AND (chats.creator =
                             '63ec322b-4a93-4d7a-aea8-7cdb3259e4b8
                             '
                                 OR chats.other_user =
                             '63ec322b-4a93-4d7a-aea8-7cdb3259e4b8
                             ')
                               AND creator_user.deletion_time = 0
                               AND other_user.deletion_time = 0

I stumbled upon this while using the MCP server from Claude Code, using Opus 4.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions