Firebird (2.5 to 5.0) MCP server with PLAN inspection and multi-database routing
π 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.
3050) using pure Python (firebirdsql).fbclient.dll (Windows) or libfbclient.so (Linux) on the host running the AI client or IDE.Legacy_Auth in FB 2.5) as well as modern pluggable SRP authentication in FB 3.0, 4.0, and 5.0.main, audit_logs, staging), switching dynamically via chat prompts or tool arguments..firebird-mcp.json):
PLAN):
PLAN) without scanning entire datasets, detecting unindexed full-table scans (NATURAL SCAN) and memory/disk sorting bottlenecks (SORT).fb_query enforces read-only operations (SELECT), guarding against accidental data modification..fdb database file growth.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).Real-world production codebases (such as enterprise ERPs in Delphi, Laravel, or Python) frequently require:
ERP_DATA.FDB and audit trail AUDIT_LOGS.FDB).Firebird MCP provides two flexible organization patterns:
~/.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:
{
"default": "erp_main",
"databases": {
"erp_main": {
"host": "localhost",
"port": 3050,
"database": "/var/data/ERP_DATA.FDB",
"user": "SYSDBA",
"password": "masterkey",
"charset": "WIN1252",
"description": "Primary ERP operational database",
"projects": ["web_projects", "erp-desktop"],
"tags": ["erp", "financial", "sales"]
},
"erp_audit": {
"host": "localhost",
"port": 3050,
"database": "/var/data/AUDIT_LOGS.FDB",
"user": "SYSDBA",
"password": "masterkey",
"charset": "WIN1252",
"description": "Secondary database for audit trails and logs",
"projects": ["web_projects", "erp-desktop"],
"tags": ["audit", "logs", "security"]
},
"pos_store": {
"host": "192.168.1.10",
"port": 3050,
"database": "C:\\POS\\STORE.FDB",
"user": "SYSDBA",
"password": "masterkey",
"charset": "WIN1252",
"description": "Store front checkout database",
"projects": ["pos-vcl"],
"tags": ["pos", "cashier"]
},
"shared_staging": {
"host": "localhost",
"port": 3050,
"database": "/data/STAGING.FDB",
"user": "SYSDBA",
"password": "masterkey",
"charset": "WIN1252",
"description": "Shared staging/test database accessible across all projects",
"projects": []
}
}
}
Tip on Shared Databases: Databases with an empty
"projects": []array or"*"are treated as global shared databases and remain visible across all workspaces.
.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.
/home/lucas/web_projects), the MCP automatically resolves the active project and filters databases matching that project.fb_use_database("audit") β the MCP matches exact names, substrings (e.g., erp_audit), and associated tags.CREATE, ALTER, DROP, RECREATE) and data mutation commands (INSERT, UPDATE, DELETE, EXECUTE PROCEDURE) are NEVER executed directly without prior explicit user consent.confirmed=True parameter is passed following the user's explicit affirmative response.| Tool | Parameters | Description |
|---|---|---|
fb_create_config | database, alias, host, port, user, password, charset, description, projects, tags, filepath | Creates and saves Central Global Catalog (~/.firebird-mcp.json) or local file with project tags. |
fb_list_databases | project_filter (optional) | Lists all databases in catalog, highlighting matches for the active project. |
fb_use_database | alias | Switches the active database for the current session (with smart match by name, substring, or tag). |
fb_configure_database | alias, database, host, port, user, password, charset, description, projects, tags, set_as_default, save_to_file | Registers or updates a connection with projects/tags dynamically and persists to file. |
fb_reload_config | config_path (optional) | Reloads the catalog from global or local file. |
| Tool | Parameters | Description |
|---|---|---|
fb_list_tables | db_alias (optional) | Lists all user tables (filters out RDB$ system tables). |
fb_list_views | db_alias (optional) | Lists all registered user views. |
fb_list_procedures | db_alias (optional) | Lists all user Stored Procedures. |
fb_list_generators | db_alias (optional) | Lists all user Generators / Sequences. |
fb_inspect_table | table_name, db_alias (optional) | Returns column definitions, precise data types, PK/FK constraints, and indices with real selectivity (RDB$STATISTICS). |
| Tool | Parameters | Description |
|---|---|---|
fb_explain_plan | sql, db_alias (optional) | Compiles the query in the engine, extracts the PLAN, highlights NATURAL SCAN warnings, and suggests indexing strategies. |
fb_query | sql, limit (default 50, max 1000), db_alias (optional) | Executes read-only SELECT queries with safety guards and immediate transaction commits. |
fb_execute_dml | sql, db_alias (optional), confirmed (default false) | Executes explicit INSERT, UPDATE, DELETE, or EXECUTE PROCEDURE statements. Requires mandatory double confirmation (confirmed=True). |
fb_execute_ddl | ddl, db_alias (optional), confirmed (default false) | Executes structural DDL statements (CREATE INDEX, ALTER TABLE, etc.) with explicit commit. Requires mandatory double confirmation (confirmed=True). |
fb_database_health | db_alias (optional) | Audits database health via MON$ tables (ODS version, page size, active attachments, and OAT-to-Next-Transaction gap). |
Running via Docker eliminates all local Python runtime and dependency requirements:
# Clone and build the image locally:
git clone https://github.com/lucasgabriel0802/firebird-mcp.git
cd firebird-mcp
docker build -t firebird-mcp:latest .
Configure your IDE to launch the container on-demand. This configuration works seamlessly on Windows, macOS, and Linux:
{
"mcpServers": {
"firebird": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v", "${workspaceFolder}:/workspace",
"-w", "/workspace",
"--add-host", "host.docker.internal:host-gateway",
"firebird-mcp:latest"
]
}
}
}
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.
If you prefer running the MCP server as a permanent background service on port 8000:
docker compose up -d firebird-mcp
Connect via SSE endpoint: http://localhost:8000/sse.
Spin up both the MCP server and a ready-to-test Firebird 5.0 database container:
docker compose --profile test-db up -d
This starts:
localhost:3050 (password: masterkey, database: TESTE.FDB).http://localhost:8000/sse.git clone https://github.com/lucasgabriel0802/firebird-mcp.git ~/firebird-mcp
cd ~/firebird-mcp
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
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):
#!/usr/bin/env bash
set -e
exec docker run -i --rm \
-v "${PWD}:/workspace" \
-w /workspace \
--add-host host.docker.internal:host-gateway \
firebird-mcp:latest "$@"
Ensure it is executable (chmod +x docker-mcp.sh) and reference it in your configuration:
{
"mcpServers": {
"firebird": {
"command": "/home/<userName>/firebird-mcp/docker-mcp.sh"
}
}
}
Or using Python Virtual Environment:
{
"mcpServers": {
"firebird": {
"command": "/home/<userName>/firebird-mcp/venv/bin/python",
"args": ["-m", "firebird_mcp.server"],
"cwd": "${workspaceFolder}"
}
}
}
In .cursor/mcp.json at your project root or in Settings > Features > MCP:
{
"mcpServers": {
"firebird": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v", "${workspaceFolder}:/workspace",
"-w", "/workspace",
"--add-host", "host.docker.internal:host-gateway",
"firebird-mcp:latest"
]
}
}
}
In cline_mcp_settings.json or Roo Code settings:
{
"mcpServers": {
"firebird": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v", "${workspaceFolder}:/workspace",
"-w", "/workspace",
"--add-host", "host.docker.internal:host-gateway",
"firebird-mcp:latest"
]
}
}
}
In claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"firebird": {
"command": "python",
"args": ["-m", "firebird_mcp.server", "--config", "C:\\my_project\\.firebird-mcp.json"],
"cwd": "C:\\my_project"
}
}
}
In ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"firebird": {
"command": "python3",
"args": ["-m", "firebird_mcp.server"],
"cwd": "${workspaceFolder}"
}
}
}
In Zed's settings.json:
{
"context_servers": {
"firebird": {
"command": {
"path": "python3",
"args": ["-m", "firebird_mcp.server"]
}
}
}
}
firebird-master Skill + firebird-mcpThis MCP server works hand-in-hand with the firebird-master skill:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI AGENT / COPILOT β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ€
β SKILL: firebird-master β MCP: firebird-mcp β
β (Brain) β (Muscle) β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββ€
β β’ Cross-version syntax β β’ TCP socket wire protocol β
β (FB 2.5 vs 3 vs 4 vs 5)β β’ Executes & fetches PLAN β
β β’ SQL anti-pattern rules β β’ Introspects RDB$ schema β
β β’ Delphi FireDAC best β β’ Gathers MON$ telemetry β
β practices & index hintsβ β’ Auto-discovers project DB β
ββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββ
Distributed under the MIT License.
Source-derived launch command. Check the maintainerβs required arguments and credentials before running:
uvx firebird-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-lucasgabriel0802-firebird-mcp": {
"command": "uvx",
"args": [
"firebird-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the clientβs tool list, then try a read-only example from its documentation.
Claude Desktop setup referencefirebird-mcppypiFirebird MCP Server works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.