Mcp Firebird

by PuroDelphi

490 downloads
Not rated
GitHub

About

MCP Firebird is a server that implements Anthropic's Model Context Protocol (MCP) for Firebird SQL databases. It allows Large Language Models (LLMs) like Claude to access, analyze, and manipulate data in Firebird databases securely and in a controlled manner.

Details

Author
PuroDelphi
Downloads
490
Categories
Other, Database

- List all databases, tables, views, and stored procedures
- Retrieve detailed table schemas and field descriptions
- Execute arbitrary SQL queries with optional parameters
- Four built-in prompts: query-data, analyze-table, optimize-query, generate-sql
- Retrieve field comments from Firebird’s RDB$DESCRIPTION metadata

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Mcp Firebird
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Quick Start Default No Wire Encryption

npx -y mcp-firebird --database=/path/to/database.fdb

⚠️CRITICAL:npxdoes NOT work with the native driver. You MUST install globally.

⚠️IMPORTANT: Wire encryption must be configured on theFirebird server(firebird.conf), not on the client.

# In firebird.conf on the server WireCrypt = Required # or Enabled
# Step 1: Install build tools # Windows: Visual Studio Build Tools (https://visualstudio.microsoft.com/downloads/) # Linux: sudo apt-get install build-essential python3 firebird-dev # macOS: xcode-select --install && brew install firebird # Step 2: Install MCP Firebird globally npm install -g mcp-firebird # Step 3: Install native driver globally npm install -g node-firebird-driver-native # Step 4: Run directly (WITHOUT npx) mcp-firebird --use-native-driver \ --database=/path/to/database.fdb \ --host=localhost \ --user=SYSDBA \ --password=masterkey

Why not npx?Whennpxruns a package from its temporary cache, it cannot access globally installed modules likenode-firebird-driver-native. Both packages must be installed globally in the same location.

📚 For detailed installation instructions, see:

- Native Driver Installation Guide-Step-by-step for Windows/Linux/macOS
-
Wire Encryption Guide
-
Advanced Installation Guide

# Global installation npm install -g mcp-firebird # Run the server npx -y mcp-firebird --database /path/to/database.fdb

- 🐛FIXED: SSE JSON parsing bug - resolves "Invalid message: [object Object]" errors
- ✨ Streamable HTTP transport support (MCP 2025-03-26)
- 🔄 Unified server with automatic protocol detection
- 📊 Enhanced session management and monitoring
- 🛠️ Modern MCP SDK integration (v1.13.2)
- 🔧 Improved error handling and logging
- 🧪 Comprehensive test suite with 9+ tests for SSE functionality

# Install alpha version with latest features npm install -g mcp-firebird@alpha # Or use specific alpha version npm install -g mcp-firebird@2.4.0-alpha.0

- �NEW: Ready for next development cycle
- ✨ All stable features from v2.2.3 included
- 🔄 Unified server with automatic protocol detection
- 📊 Enhanced session management and monitoring
- 🛠️ Modern MCP SDK integration (v1.13.2)
- 🔧 Improved error handling and logging
- 🧪 Comprehensive test suite with 9+ tests for SSE functionality
- 📚 Enhanced documentation with troubleshooting guides

Note: The SSE JSON parsing bug fix is now available in stable v2.2.3

For VSCode and GitHub Copilot integration, seeVSCode Integration.

code $env:AppData\Claude\claude_desktop_config.json # Windows code ~/Library/Application\ Support/Claude/claude_desktop_config.json # macOS
{ "mcpServers": { "mcp-firebird": { "command": "npx", "args": [ "mcp-firebird", "--host", "localhost", "--port", "3050", "--database", "C:\\path\\to\\database.fdb", "--user", "SYSDBA", "--password", "masterkey" ], "type": "stdio" } } }

MCP Firebird supports multiple transport protocols to accommodate different client needs and deployment scenarios.

The STDIO transport is the standard method for Claude Desktop integration:

{ "mcpServers": { "mcp-firebird": { "command": "npx", "args": [ "mcp-firebird", "--database", "C:\\path\\to\\database.fdb", "--user", "SYSDBA", "--password", "masterkey" ], "type": "stdio" } } }

SSE transport allows the server to run as a web service, useful for web applications and remote access:

# Start SSE server on default port 3003 npx mcp-firebird --transport-type sse --database /path/to/database.fdb # Custom port and full configuration npx mcp-firebird \ --transport-type sse \ --sse-port 3003 \ --database /path/to/database.fdb \ --host localhost \ --port 3050 \ --user SYSDBA \ --password masterkey
# Set environment variables export TRANSPORT_TYPE=sse export SSE_PORT=3003 export DB_HOST=localhost export DB_PORT=3050 export DB_DATABASE=/path/to/database.fdb export DB_USER=SYSDBA export DB_PASSWORD=masterkey # Start server npx mcp-firebird

Once the SSE server is running, clients can connect to:

- SSE Endpoint:http://localhost:3003/sse
- Messages Endpoint:http://localhost:3003/messages
- Health Check:http://localhost:3003/health

The latest MCP protocol supporting bidirectional communication:

# Start with Streamable HTTP npx mcp-firebird --transport-type http --http-port 3003 --database /path/to/database.fdb

Supports both SSE and Streamable HTTP protocols simultaneously with automatic detection:

# Start unified server (supports both SSE and Streamable HTTP) npx mcp-firebird --transport-type unified --http-port 3003 --database /path/to/database.fdb

- SSE (Legacy):http://localhost:3003/sse
- Streamable HTTP (Modern):http://localhost:3003/mcp
- Auto-Detection:http://localhost:3003/mcp-auto
- Health Check:http://localhost:3003/health

npx mcp-firebird \ --transport-type sse \ --sse-port 3003 \ --database ./dev-database.fdb \ --user SYSDBA \ --password masterkey
npx mcp-firebird \ --transport-type unified \ --http-port 3003 \ --database /var/lib/firebird/production.fdb \ --host db-server \ --port 3050 \ --user APP_USER \ --password $DB_PASSWORD
docker run -d \ --name mcp-firebird \ -p 3003:3003 \ -e TRANSPORT_TYPE=sse \ -e SSE_PORT=3003 \ -e DB_DATABASE=/data/database.fdb \ -v /path/to/database:/data \ purodelhi/mcp-firebird:latest
# Environment variables for session management export SSE_SESSION_TIMEOUT_MS=1800000 # 30 minutes export MAX_SESSIONS=1000 # Maximum concurrent sessions export SESSION_CLEANUP_INTERVAL_MS=60000 # Cleanup every minute npx mcp-firebird --transport-type sse

For web applications, configure CORS settings:

# Allow specific origins export CORS_ORIGIN="https://myapp.com,https://localhost:3000" export CORS_METHODS="GET,POST,OPTIONS" export CORS_HEADERS="Content-Type,mcp-session-id" npx mcp-firebird --transport-type sse

For production deployments, use a reverse proxy like nginx:

server { listen 443 ssl; server_name mcp-firebird.yourdomain.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; location / { proxy_pass http://localhost:3003; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }

-

Wire Encryption Incompatibility (Firebird 3.0+)⚠️CRITICAL

Error:Incompatible wire encryption levels requested on client and server

IMPORTANT: Thenode-firebirdlibrary does NOT support Firebird 3.0+ wire encryption. The--wire-cryptparameter does NOT work.

ONLY Solution: You MUST disable wire encryption on the Firebird server:

For Firebird 3.0, add tofirebird.conf:

WireCrypt = Disabled AuthServer = Srp, Legacy_Auth

For Firebird 4.0+, add tofirebird.conf:

WireCrypt = Disabled AuthServer = Srp256, Srp, Legacy_Auth
environment: FIREBIRD_CONF_WireCrypt: Disabled FIREBIRD_CONF_AuthServer: Srp256, Srp

If you cannot change server configuration, seeWire Encryption Limitationfor alternatives.

Problem: Remote connection strings or Unix paths not working

Solution: This is fixed in v2.4.0-alpha.1+. The following paths now work correctly:

- Remote:server:/path/to/database.fdb
- Unix absolute:/var/lib/firebird/database.fdb
- IP-based:192.168.1.100:/data/db.fdb

I/O Error with Mixed-Case Paths on Windows

Error:I/O error during CreateFile (open) operation

Problem: Database path with mixed case (e.g.,C:\MyData\database.fdb) causes errors

- Use all-uppercase paths:C:\MYDATA\DATABASE.FDB
- Use forward slashes:C:/MyData/database.fdb
- See
Wire Encryption Fix Documentationfor more details

# Check if server is running curl http://localhost:3003/health # Check port availability netstat -an | grep 3003
# Increase session timeout export SSE_SESSION_TIMEOUT_MS=3600000 # 1 hour

execute-query

Executes a SQL query in the Firebird database. Uses FIRST/ROWS for pagination.

list-tables

Lists all user tables in the current Firebird database.

describe-table

Gets the detailed schema (columns, types, etc.) of a specific table.

get-field-descriptions

Gets the stored descriptions for fields of a specific table (if they exist).

analyze-query-performance

Analyzes the performance of a SQL query by executing it multiple times and measuring execution time

get-execution-plan

Gets the execution plan for a SQL query to understand how the database will execute it

analyze-missing-indexes

Analyzes a SQL query to identify missing indexes that could improve performance

execute-batch-queries

Executes multiple SQL queries in parallel for improved performance.

describe-batch-tables

Gets the detailed schema of multiple tables in parallel for improved performance.

get-table-data

Retrieves data from a specific table with optional filtering, pagination, and ordering.

analyze-table-statistics

Analyzes statistical information about a table including row count, column statistics, and data distribution.

verify-wire-encryption

Verifies if the current database connection is using wire encryption (requires native driver).

get-database-info

Retrieves general information about the connected Firebird database.

get-server-info

Gets information about the Firebird MCP server and its available tools

list-available-tools

Lists all tools available on the MCP server

get-tool-help

Gets detailed information about a specific tool

system-health-check

Checks system health and database connectivity

list-available-events

Lists native events (POST_EVENT) available in database triggers and procedures

list-triggers

Lists all database triggers with their associated table, trigger type, and status

describe-trigger

Gets detailed information about a specific trigger, including its source code, type, sequence, and status

list-procedures

Lists all stored procedures in the database with input and output parameter information

describe-procedure

Gets detailed information about a specific stored procedure, including its source code and parameters

list-functions

Lists all functions in the database (UDFs and PSQL functions)

describe-function

Gets detailed information about a specific function, including its source code (for PSQL functions)

list-packages

Lists all packages in the database (available in Firebird 3.0+)

describe-package

Gets detailed information about a specific package, including its header and body source

subscribe_to_event

Subscribe to a Firebird event (POST_EVENT) to receive proactive notifications

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp firebird": {
            "mcp-firebird": {
                "command": "npx",
                "type": "stdio",
                "args": [
                    "mcp-firebird",
                    "--host",
                    "localhost",
                    "--port",
                    "3050",
                    "--database",
                    "C:\\Databases\\example.fdb",
                    "--user",
                    "SYSDBA",
                    "--password",
                    "masterkey"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-firebird": {
        "command": "npx",
        "type": "stdio",
        "args": [
            "mcp-firebird",
            "--host",
            "localhost",
            "--port",
            "3050",
            "--database",
            "C:\\Databases\\example.fdb",
            "--user",
            "SYSDBA",
            "--password",
            "masterkey"
        ]
    }
}

MCP Firebird

Implementation of Anthropic's MCP protocol for Firebird databases.

What is MCP Firebird and what is it for?

MCP Firebird is a server that implements Anthropic's Model Context Protocol (MCP) for Firebird SQL databases. It allows Large Language Models (LLMs) like Claude to access, analyze, and manipulate data in Firebird databases securely and in a controlled manner.

You'll find use cases and examples below.

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.