mcp-firebird

MCP Firebird node for n8n - Execute SQL queries through Model Context Protocol

Package Information

Downloads: 0 weekly / 6 monthly
Latest Version: 0.1.2
Author: Mateus Borges

Documentation

n8n-nodes-mcp-firebird

MCP Firebird node for n8n - Execute SQL queries and interact with Firebird databases through Model Context Protocol (MCP).

n8n is a fair-code licensed workflow automation platform.

Installation

Follow the installation guide in the n8n community nodes documentation.

Prerequisites

Before using this node, you need to have the MCP Firebird server running. You can install it using:

# Install MCP Firebird globally
npm install -g mcp-firebird

# Or use the latest alpha version
npm install -g mcp-firebird@alpha

Usage

This node allows you to interact with Firebird databases through the MCP (Model Context Protocol) server. You can execute SQL queries, get schema information, and even use natural language instructions.

Operations

Execute SQL Query

Execute SQL queries directly on your Firebird database.

Parameters:

  • SQL Query: The SQL query to execute
  • Parameters: Query parameters as JSON array (optional)
  • Return Type: How to return results (All Results, First Row, Count Only)
  • Max Rows: Maximum number of rows to return (optional)

Example:

SELECT * FROM users WHERE active = ? AND created_at > ?

Parameters: [true, "2024-01-01"]

Get Schema Info

Retrieve database schema information.

Schema Types:

  • All Tables: Get all tables in the database
  • All Views: Get all views in the database
  • All Procedures: Get all stored procedures
  • Complete Schema: Get complete database schema

Get Table Info

Get detailed information about a specific table.

Info Types:

  • Columns: Get table column information
  • Indexes: Get table index information
  • Constraints: Get table constraint information
  • Complete Info: Get complete table information

Execute Natural Language

Execute natural language instructions that will be converted to SQL queries.

Example Instructions:

  • "Show me all active users from the users table"
  • "Count the number of orders from last month"
  • "Get the top 10 customers by total purchases"

Credentials

You need to configure MCP Firebird credentials with the following options:

Transport Type

  • STDIO: Standard input/output transport (for Claude Desktop)
  • SSE: Server-Sent Events transport
  • HTTP: Streamable HTTP transport
  • Unified: Unified server (supports both SSE and HTTP) - Recommended

Server Configuration

  • Server URL: URL of the MCP Firebird server (e.g., http://localhost:3003)
  • Database Path: Path to Firebird database file (.fdb)
  • Host: Firebird server host (default: localhost)
  • Port: Firebird server port (default: 3050)
  • Username: Firebird database username (default: SYSDBA)
  • Password: Firebird database password
  • Timeout: Request timeout in milliseconds (default: 30000)
  • Session Timeout: Session timeout in milliseconds (default: 1800000)

Setup Examples

1. Start MCP Firebird Server

# Basic setup with unified transport
npx mcp-firebird \
  --transport-type unified \
  --http-port 3003 \
  --database /path/to/your/database.fdb \
  --user SYSDBA \
  --password masterkey

# Or with environment variables
export TRANSPORT_TYPE=unified
export SSE_PORT=3003
export DB_DATABASE=/path/to/your/database.fdb
export DB_USER=SYSDBA
export DB_PASSWORD=masterkey

npx mcp-firebird

2. Configure n8n Credentials

  1. Go to your n8n instance
  2. Navigate to Settings > Credentials
  3. Add new credential: "MCP Firebird"
  4. Configure with your server details

3. Use in Workflows

Add the "MCP Firebird" node to your workflow and configure the operation you want to perform.

Response Format

All operations return a standardized response format:

{
  "success": true,
  "data": [...], // Query results or schema information
  "count": 10,   // Number of results (for queries)
  "error": null  // Error message if any
}

Error Handling

The node includes comprehensive error handling:

  • Connection Errors: Network connectivity issues
  • Authentication Errors: Invalid credentials
  • Query Errors: SQL syntax or execution errors
  • Timeout Errors: Request timeout handling
  • Validation Errors: Invalid parameters or data

Advanced Features

Natural Language Processing

The node supports natural language instructions that are automatically converted to SQL queries using the MCP server's AI capabilities.

Schema Analysis

Get detailed information about your database structure, including tables, views, procedures, columns, indexes, and constraints.

Parameterized Queries

Use parameterized queries to prevent SQL injection and improve performance.

Result Formatting

Choose how to format query results:

  • All Results: Return all matching rows
  • First Row: Return only the first result
  • Count Only: Return only the count of affected rows

Troubleshooting

Common Issues

  1. Connection Refused

    • Ensure MCP Firebird server is running
    • Check server URL and port
    • Verify firewall settings
  2. Authentication Failed

    • Verify database credentials
    • Check database file path
    • Ensure user has proper permissions
  3. Query Timeout

    • Increase timeout value in credentials
    • Optimize your SQL query
    • Check database performance
  4. Invalid Response

    • Check MCP server logs
    • Verify server version compatibility
    • Ensure proper JSON-RPC format

Debug Mode

Enable debug logging in your MCP Firebird server:

export LOG_LEVEL=debug
npx mcp-firebird

Development

Building the Node

# Install dependencies
npm install

# Build the node
npm run build

# Development with watch
npm run dev

# Format code
npm run format

# Lint
npm run lint

Testing

# Run tests
npm test

# Test specific operation
npm test -- --grep "executeQuery"

Resources

License

MIT

Author

Mateus Borges

Support

For issues and questions:

Discussion