macOS: BigQuery MCP `browse_table` blocked in Read-Only Safe Mode

未关闭 适合新手
#4,385 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
google-cloud, sql, swift
领域
database

调研方向

从 apple/TablePro/Core/MCP/Protocol/Tools/DataTools.swift(第 93-119 行)中的 BrowseTableTool 和 BigQueryQueryBuilder.swift(第 110-166 行)中的 BigQuery 构建器开始;注意带标签的 BIGQUERY_BROWSE: 请求。然后阅读 DefaultExecutionGate.swift(第 60-85 行)中的 DefaultExecutionGate 以及 BigQueryPluginDriver+Execution.swift(第 281-287 行)中的 SELECT 渲染。用 issue 的离线 statement-scanner 检查复现,比较带标签的请求和渲染后的 SQL 层级;当只读浏览返回一行且写入阻塞保持不变时完成。

由索引模型根据 Issue 内容生成。

描述

What happened?

With Safe Mode set to Read-Only on a BigQuery connection, MCP browse_table returned:

Cannot execute write queries: TablePro's Safe Mode is set to read-only for this connection

list_databases, list_schemas, and describe_table succeeded on the same BigQuery connection.

Steps to reproduce
  1. Connect TablePro to a BigQuery test dataset, such as sample_dataset, with a table sample_rows(id INT64) containing one row. Set the connection’s Safe Mode to Read-Only.

  2. From an approved MCP client, call browse_table with the following arguments, replacing the placeholder with the test connection’s UUID:

    {"connection_id":"<test connection UUID>","schema":"sample_dataset","table":"sample_rows","limit":1}
    
Expected behavior

The browse returns up to one row, and Read-Only Safe Mode continues to block writes.

Environment
  • TablePro: 0.87.0 (870099)
  • Platform: macOS 27.2.1, Apple Silicon
  • Database: Google BigQuery (managed service; no server version reported)
Source and offline reproduction

BrowseTableTool submits a .readQuery operation, but the BigQuery builder returns a tagged request (BIGQUERY_BROWSE: or BIGQUERY_FILTER:). DefaultExecutionGate classifies that text before the driver renders the SELECT.

The offline check generated plain and filtered browse requests with the upstream builder, normalized them with the statement scanner, and used SQLStatementClassifier.classify to grade the requests and the SQL they render. The results matched on v0.87.0 and main at c422096:

Input Statement tier
Plain or filtered BigQuery browse request .write
SELECT rendered from either request .safe

The offline check did not run the application or contact BigQuery.

主要语言
Swift
星标
6.2k
派生
412
平均合并
7 小时 38 分钟
30 天内合并 PR
536

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TableProApp/TablePro 的其他 Issue

查看 TableProApp/TablePro 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。