
Boyce
io.github.boyce-io由 GitHub 帳號 boyce-io 發布v0.1.1更新於 Oct 24, 2026
Deterministic SQL compiler for AI agents. Your agent stops guessing SQL.
概覽
本機 MCP 伺服器,為 AI 助理提供結構化資料庫脈絡與確定性 SQL 編譯器,讓助理產生並驗證 SQL 而非憑空猜測
- 可以做什麼
- 從 dbt、LookML、DDL、SQLite、Django、SQLAlchemy、Prisma、CSV 或 Parquet 來源匯入結構與語意脈絡,並儲存查詢時自動套用的認證業務定義。回傳完整結構脈絡與 StructuredFilter 格式,讓宿主模型自行建構查詢。將自然語言請求轉為確定性 SQL,並附上 NULL 風險檢查與 EXPLAIN 預檢。在不執行的情況下驗證手寫 SQL,包含 Redshift 語法檢查。執行唯讀 SELECT 查詢,並剖析欄位的空值率、相異計數與最小/最大值。檢查資料庫連線、快照新鮮度與環境健康狀態。
- 適用情境
- 適合助理需要針對 Postgres、Redshift、DuckDB 或 BigQuery 撰寫 SQL,並希望依據真實結構與關聯資訊而非猜測的情況。也適合需要可重現、逐位元組一致的 SQL 輸出,以及在查詢送到正式資料庫前先做預檢的團隊。
- 執行需求
- 需要 Python 3.10+ 並在本機安裝 boyce 套件(pip 或 uv);postgres 附加元件可啟用即時轉接器。BOYCE_DB_URL 連線字串為選用,啟用後可即時查詢、資料剖析與 EXPLAIN 預檢。使用自身模型的 MCP 宿主不需 LLM 金鑰;CLI 或 HTTP 方式需要 BOYCE_PROVIDER 以及 ANTHROPIC_API_KEY 或 OPENAI_API_KEY 等供應商金鑰。僅支援桌面 MCP 宿主。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Boyce,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Boyce: Semantic Protocol & Safety Layer for Agentic Database Workflows
The semantic safety layer for agentic database workflows. Boyce connects LLMs to live database context with built-in safety rails.
Named for Raymond F. Boyce, co-inventor of SQL (1974) and co-author of Boyce-Codd Normal Form (BCNF).
AI agents querying databases without proper context generate unreliable SQL — working from incomplete schemas, inferring column names, guessing join paths. Boyce gives agents the structured database intelligence they need to generate correct, safe SQL every time — through three interconnected systems:
Why does this matter? → The Null Trap: Your AI Agent's SQL Is Correct. The Answer Is Still Wrong.
Install
Requires Python 3.10+
From source:
Quickstart
After installing, run boyce init to configure your MCP host automatically:
The wizard detects Claude Desktop, Cursor, Claude Code, and JetBrains (DataGrip, IntelliJ, etc.), and writes the correct config block for each.
Developing from source? The repo includes a setup script:
Configure Your MCP Host
The fastest path is boyce init — it detects your MCP host and writes the config automatically:
Or configure manually. There are two setup paths depending on your host:
Path 1 — MCP Hosts (No LLM key required)
If you're using Claude Desktop, Cursor, Claude Code, Codex, Cline, Windsurf, JetBrains (DataGrip,
IntelliJ), or any MCP-compatible host, you do not need to configure an LLM provider for Boyce.
The host's own model handles reasoning — Boyce supplies the schema context and deterministic SQL
compiler via get_schema and ask_boyce. Only BOYCE_DB_URL is needed (and even that is optional).
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
Cursor (.cursor/mcp.json in project root):
Path 2 — With Boyce's Built-in NL→SQL
If you're using the CLI (boyce ask), HTTP API, or a non-MCP client (e.g., the VS Code
extension), configure Boyce's internal query planner with your LLM provider:
Boyce supports any LLM provider available through LiteLLM: Anthropic, OpenAI, Ollama (local), vLLM (local), Azure, Bedrock, Vertex, Mistral, and more.
BOYCE_DB_URL is optional on both paths. Without it, Boyce runs in schema-only mode — SQL
generation still works; EXPLAIN pre-flight and live query tools return "status": "unchecked".
Environment Variables
MCP Tools
Architecture
Dialect support: redshift, postgres, duckdb, bigquery
Redshift safety rails (safety.py): Automatic linting for LATERAL, JSONB, REGEXP_COUNT, lookahead regex patterns, and numeric cast rewrites for Redshift 1.0 (PG 8.0.2).
Scan CLI
10 parsers: dbt manifest, dbt project, LookML, SQLite, DDL, CSV, Parquet, Django, SQLAlchemy, Prisma.
Verify the Install
SemanticSnapshot Format
The ingest_source tool accepts a SemanticSnapshot JSON dict. Minimal example:
See boyce/tests/live_fire/mock_snapshot.json for a complete field/entity example.
Project Layout
Status
Support
- Troubleshooting guide: docs/troubleshooting.md
- Local LLM setup (Ollama/vLLM): docs/local-llm-setup.md
- Bug reports: GitHub Issues
- Setup help: GitHub Issues
- Email: [email protected] — for issues involving credentials or sensitive config
Copyright 2026 Convergent Methods, LLC. MIT License.
來源:README.md,提交 9aad343
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分