
Firebird MCP Server
io.github.lucasgabriel0802由 GitHub 账号 lucasgabriel0802 发布v0.1.0更新于 Oct 24, 2026
Firebird (2.5 to 5.0) MCP server with PLAN inspection and multi-database routing
概览
本地 MCP 服务器,让 AI 助手连接 Firebird 2.5–5.0 数据库,查看结构、执行只读查询、分析执行计划并运行 DDL/DML。
- 可以做什么
- 管理数据库连接:创建和编辑 Firebird 连接目录、列出数据库、切换当前数据库并重新加载配置,支持按项目过滤和自动发现项目配置文件。查看结构与元数据:列出表、视图、存储过程和生成器,并查看表的列、主外键和索引。分析性能:编译查询以提取执行计划,标记全表扫描并建议索引。执行查询:运行带行数限制的只读 SELECT 语句并立即提交事务。修改数据与结构:执行 INSERT、UPDATE、DELETE、存储过程调用和 DDL 语句,均需显式确认参数。
- 适用场景
- 适合助手需要在项目中处理 Firebird 数据库的场景:探索不熟悉的表结构、排查查询为何缓慢,或在开发和生产数据库上起草并执行 SQL。也适合一个工作区有多个 Firebird 数据库、希望助手自动选择正确数据库的团队。
- 运行要求
- 以 Python 包(firebird-mcp)或 Docker 方式在本地通过 stdio 运行。需要通过网络以 TCP 访问 Firebird 服务器(默认端口 3050)。数据库凭据(主机、端口、数据库路径、用户、密码、字符集)保存在 JSON 配置文件中,可以是用户主目录下的全局目录或项目级文件;FIREBIRD_CONFIG_PATH 变量可指定显式配置文件。
安装
在 SourceWeft 中
- 打开 控制台中的 Firebird MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Firebird MCP Server 🔥
[License: MIT] [MCP Standard] [Python 3.10+] [Firebird 2.5 to 5.0] [M8ven Score]
🌐 Language / Idioma: English | Português (Brasil)
Open-source Model Context Protocol (MCP) server for Firebird Database, developed for free and independent community use with support for all major releases (Firebird 2.5, 3.0, 4.0, and 5.0).
Built according to the open industry standards for MCP servers (stdio / JSON-RPC 2.0), ensuring turnkey compatibility with any AI client or IDE: Google Antigravity IDE, Cursor, Claude Desktop, VS Code (with Cline / Roo Code / Copilot extensions), Windsurf, Zed, and CLI tools.
🎯 Key Highlights
- Pure Python Wire Protocol (Zero DLL Dependencies):
- Connects directly over TCP (default port
3050) using pure Python (firebirdsql). - Requires no native C/C++ compilation and eliminates the need to install
fbclient.dll(Windows) orlibfbclient.so(Linux) on the host running the AI client or IDE. - Fully compatible with legacy authentication (
Legacy_Authin FB 2.5) as well as modern pluggable SRP authentication in FB 3.0, 4.0, and 5.0.
- Connects directly over TCP (default port
- Multi-Database Support per Project:
- Allows a single project workspace to declare and manage multiple databases (e.g.,
main,audit_logs,staging), switching dynamically via chat prompts or tool arguments.
- Allows a single project workspace to declare and manage multiple databases (e.g.,
- Workspace Auto-Discovery (
.firebird-mcp.json):- Automatically detects database configuration files placed at the root of your project or repository.
- Execution Plan & Performance Analysis (
PLAN):- Compiles queries to extract the Firebird optimizer's execution plan (
PLAN) without scanning entire datasets, detecting unindexed full-table scans (NATURAL SCAN) and memory/disk sorting bottlenecks (SORT).
- Compiles queries to extract the Firebird optimizer's execution plan (
- Strict Query Safety & MVCC Best Practices:
fb_queryenforces read-only operations (SELECT), guarding against accidental data modification.- Commits read transactions immediately upon completion, preventing OAT (Oldest Active Transaction) stalls, garbage collection starvation, and runaway
.fdbdatabase file growth.
- Broad System Catalog Mapping:
- Comprehensive introspection of Firebird system catalog tables (
RDB$), supporting types across versions:BOOLEAN(FB3+),INT128,DECFLOAT(16/34),TIMESTAMP WITH TIME ZONE(FB4+),BLOB SUB_TYPE TEXT/BINARY, and index selectivity (RDB$STATISTICS).
- Comprehensive introspection of Firebird system catalog tables (
🗄️ Multi-Database & Per-Project Configuration
Real-world production codebases (such as enterprise ERPs in Delphi, Laravel, or Python) frequently require:
- Different databases per project/workspace.
- Multiple databases within the same project (e.g., operational database
ERP_DATA.FDBand audit trailAUDIT_LOGS.FDB).
Where and How to Configure Databases:
Firebird MCP provides two flexible organization patterns:
Option A (Recommended Default): Central Global Catalog (~/.firebird-mcp.json)
Instead of scattering .firebird-mcp.json files across every repository, maintain a single central catalog in your user home directory (~/.firebird-mcp.json on Linux/macOS or C:\Users\YourUser\.firebird-mcp.json on Windows).
In this catalog, you register all databases on your machine and use the "projects" property to specify which projects/repositories use each database:
Tip on Shared Databases: Databases with an empty
"projects": []array or"*"are treated as global shared databases and remain visible across all workspaces.
Option B: Local Project Configuration (.firebird-mcp.json)
If you prefer a repository to isolate its own credentials, place a .firebird-mcp.json file in the project root. The MCP checks for a local project file first; if present, it has absolute precedence over the global catalog.
How the Agent Interacts with Databases:
- Automatic Workspace Context (CWD):
- When you open a workspace (e.g.,
/home/lucas/web_projects), the MCP automatically resolves the active project and filters databases matching that project. - Single Database in Project: The MCP auto-selects the database without asking unnecessary questions.
- Multiple Databases in Project (e.g., main and audit): For generic commands (e.g., "run a select on orders"), the MCP halts and asks which database to use.
- When you open a workspace (e.g.,
- Direct Investigation Targeting (Zero Friction):
- If you mention the database in your prompt (e.g., "investigate bug on audit database" or "check table X on pos"), the agent/MCP resolves the alias immediately and connects without asking confirmation questions.
- Smart Approximate Search:
- Switch databases using
fb_use_database("audit")— the MCP matches exact names, substrings (e.g.,erp_audit), and associated tags.
- Switch databases using
- ⚠️ Rigid Safety Rule: Mandatory Double Confirmation for DDL and Data Manipulation (DML):
- Structural commands (
CREATE,ALTER,DROP,RECREATE) and data mutation commands (INSERT,UPDATE,DELETE,EXECUTE PROCEDURE) are NEVER executed directly without prior explicit user consent. - The assistant must present the exact SQL/DDL statement, explain its technical purpose, detail the impact (affected rows/tables, lock risks, irreversibility), and request confirmation.
- The MCP server blocks execution with an error unless the
confirmed=Trueparameter is passed following the user's explicit affirmative response.
- Structural commands (
🛠️ Available MCP Tools
Database & Connection Management
Schema & Metadata Introspection
Performance Analysis & Execution
💻 Installation & Execution
🐳 Option 1: Docker (Gold Standard — Recommended for Windows, macOS & Linux)
Running via Docker eliminates all local Python runtime and dependency requirements:
Universal IDE Configuration via Docker (Stdio Mode):
Configure your IDE to launch the container on-demand. This configuration works seamlessly on Windows, macOS, and Linux:
Why this is the Gold Standard:
-i: Keeps stdin/stdout open for JSON-RPC without allocating a pseudo-TTY (no-tto avoid byte corruption).--rm: Cleans up the container automatically when the IDE closes.-v "${workspaceFolder}:/workspace": Mounts your current project for automatic.firebird-mcp.jsondiscovery.--add-host host.docker.internal:host-gateway: Resolves your host machine's IP (e.g. Firebird running on port 3050 in Windows, macOS, or Linux) usinghost.docker.internal.
🚀 Option 2: Docker Compose (Background Service & Batteried Testing DB)
A. Run as an HTTP/SSE Background Service
If you prefer running the MCP server as a permanent background service on port 8000:
Connect via SSE endpoint: http://localhost:8000/sse.
B. Full Local Testing Environment (with Firebird 5.0 Database)
Spin up both the MCP server and a ready-to-test Firebird 5.0 database container:
This starts:
- Firebird 5.0 on
localhost:3050(password:masterkey, database:TESTE.FDB). - Firebird MCP Server on
http://localhost:8000/sse.
🐍 Option 3: Local Python Virtual Environment
⚙️ Universal Configuration for Any IDE
1. Google Antigravity IDE
In ~/.gemini/config/mcp_config.json (or workspace configuration):
Using Docker (via wrapper script or shell):
💡 Note: Antigravity IDE passes arguments literally and does not expand VS Code variables like
${workspaceFolder}. Use the repository's includeddocker-mcp.shwrapper script:
Content of docker-mcp.sh (included in repository root):
Ensure it is executable (chmod +x docker-mcp.sh) and reference it in your configuration:
Or using Python Virtual Environment:
2. Cursor
In .cursor/mcp.json at your project root or in Settings > Features > MCP:
3. VS Code (Cline / Roo Code / Copilot MCP)
In cline_mcp_settings.json or Roo Code settings:
4. Claude Desktop
In claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
5. Windsurf
In ~/.codeium/windsurf/mcp_config.json:
6. Zed Editor
In Zed's settings.json:
🧠 Synergy: firebird-master Skill + firebird-mcp
This MCP server works hand-in-hand with the firebird-master skill:
⚖️ Disclaimer & Trademarks
- Firebird: "Firebird" is a registered trademark of the Firebird Foundation. This is an independent open-source community project licensed under the MIT License and is not affiliated with, funded by, endorsed by, or officially associated with the Firebird Project or the Firebird Foundation.
- Model Context Protocol: "Model Context Protocol" and "MCP" are trademarks of Anthropic, PBC. This project is an independent implementation compliant with open MCP standards.
- Limitation of Liability: This software connects directly to database servers and executes queries or commands per user/agent instruction. Always maintain regular database backups and verify queries prior to execution on production environments. Under the terms of the MIT License, the software is provided "AS IS", without warranty of any kind, and the authors shall not be liable for any damages or data loss.
📄 License
Distributed under the MIT License.
来源:README.md,提交 036704e
工具
0版本历史
1- v0.1.0最新Oct 17, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分