Class GrouperMcpSqlSelect

java.lang.Object
edu.internet2.middleware.grouper.ws.mcp.GrouperMcpSqlSelect

public class GrouperMcpSqlSelect extends Object
MCP tool handler for executing read-only SQL SELECT queries against the Grouper database or other configured external systems. Only SELECT statements are allowed; DML and DDL are rejected. Results are returned as a JSON array of row objects. Uses paging (pageSize/pageNumber) and a read-only JDBC connection for defense-in-depth. The default database connection can be configured via grouper.mcp.sqlGrouperExternalSystem. Additional external systems are available when configured with grouper.mcp.<id>.sqlTablesViews or grouper.mcp.<id>.sqlTablesViewsQuery. Supports countOnly mode to return just the row count without fetching data.
  • Constructor Details

    • GrouperMcpSqlSelect

      public GrouperMcpSqlSelect()
  • Method Details

    • toolDefinition

      public static com.fasterxml.jackson.databind.node.ObjectNode toolDefinition()
      return the MCP tool definition for sql_select
      Returns:
      the tool definition as a Jackson ObjectNode
    • execute

      public static com.fasterxml.jackson.databind.node.ObjectNode execute(com.fasterxml.jackson.databind.JsonNode arguments, GrouperMcpAuthUser authUser)
      execute the sql_select tool
      Parameters:
      arguments - the tool arguments from the MCP request
      authUser - the authenticated user
      Returns:
      the MCP tool result