
MCP火鸟
](https://smithery.ai/server/@PuroDelphi/mcpFirebird)
为Firebird数据库实现Anthropic的MCP(模型上下文协议)。
示例用法
https://github.com/user-attachments/assets/e68e873f-f87b-4afd-874f-157086e223af
什么是MCP火鸟?
主要特点
- sql查询:在Firebird数据库上执行SQL查询
- 模式分析:获取有关表、列和关系的详细信息
- 数据库管理:执行备份、还原和验证操作
- 性能分析:分析查询性能并提出优化建议
- 多个传输:支持STDIO、SSE(服务器发送事件)和流式HTTP传输
- 现代协议支持:完全支持MCP流式HTTP(2025-03-26)和传统SSE
- 统一服务器:自动协议检测和向后兼容性
- 克劳德集成:与Claude Desktop和其他MCP客户端无缝协作
- VSCode集成:在Visual Studio代码中与GitHub Copilot配合使用
- 会话管理:具有自动清理和可配置超时功能的强大会话处理
- 安全:包括SQL查询验证和安全配置选项
- 双驱动程序支持:在简单安装(默认)或支持有线加密的本机驱动程序之间进行选择
🚀 Smithery快速入门(建议用于云部署)
在5分钟内将MCP Firebird部署到云端!
](https://smithery.ai/server/@PuroDelphi/mcpFirebird)
史密瑟里 是将MCP Firebird部署到生产环境的最简单方法:
✅ 一键部署 -无需基础设施设置 ✅ 自动缩放 -自动处理流量峰值 ✅ 内置监控 -跟踪使用情况和性能 ✅ 安全凭据 -加密环境变量 ✅ 自动更新 -始终运行最新版本 ✅ 全球CDN -全球低延迟
如何在Smithery部署
- 访问 史密斯艾
- 连接 您的GitHub帐户
- 选择 这
mcpFirebird仓库 - 配置 您的Firebird数据库连接:
host: "your-firebird-server.com"
port: 3050
database: "/path/to/database.fdb"
user: "SYSDBA"
password: "your-secure-password"
useNativeDriver: true # Enable wire encryption (optional)
logLevel: "info"- 单击部署 -完成! ✨
您的MCP Firebird服务器将在以下网址提供:
https://server.smithery.ai/your-username/mcp-firebird与AI客户端一起使用
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const transport = new StreamableHTTPClientTransport(
"https://server.smithery.ai/your-username/mcp-firebird"
);
const client = new Client({
name: "my-ai-app",
version: "1.0.0"
});
await client.connect(transport);📚 有关Smithery部署的详细说明,请参阅 微笑_深度.md
🔒 有线加密支持
MCP Firebird支持 两种驾驶员选项:
| 驱动程序 | 安装 | 有线加密 | 用例 |
|---|---|---|---|
| 纯JavaScript (默认) | ✅ 简单(npx) | ❌ 否 | 大多数用户,快速设置 |
| 本机驱动程序 (可选) | ⚠️ 复杂(需要构建工具) | ✅ 是 | 企业,需要安全 |
快速启动(默认-无线加密)
npx mcp-firebird@alpha --database=/path/to/database.fdb高级(支持有线加密)
⚠️ 关键的: npx 不适用于本地驱动程序。您必须全局安装。
⚠️ 重要:必须在上配置有线加密 Firebird服务器 (firebird.conf)而不是在客户身上。
服务器配置 (先要求):
# 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@alpha
# 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为什么不是npx? 当 npx 从临时缓存运行包,它无法访问全局安装的模块,如 node-firebird-driver-native。这两个软件包必须全局安装在同一位置。
📚 有关详细的安装说明,请参阅:
- Smithery CLI安装指南 - ⭐ 建议用于本地设置
- 本机驱动程序安装指南 - Windows/Linux/macOS的分步操作
- 有线加密指南
- 高级安装指南
🖥️ 使用Smithery CLI进行本地安装
⭐ 推荐用于本地AI客户端(Claude Desktop、Cursor等)
Smithery CLI提供了安装和配置MCP Firebird以供本地使用的最简单方法:
快速安装
# Interactive installation (prompts for configuration)
npx -y @smithery/cli@latest install mcp-firebird --client claude
# Pre-configured installation (skip prompts)
npx -y @smithery/cli@latest install mcp-firebird --client claude --config '{
"database": "/path/to/database.fdb",
"user": "SYSDBA",
"password": "masterkey",
"useNativeDriver": false
}'特性
- ✅ 一个命令安装 -无需手动配置
- ✅ 多个客户端 -适用于Claude Desktop、Cursor等
- ✅ 交互式设置 -提示所有必需的设置
- ✅ 自动配置 -自动配置您的AI客户端
- ✅ 易于管理 -轻松列出、检查和卸载服务器
常用命令
# List installed servers
npx @smithery/cli list servers --client claude
# Inspect server configuration
npx @smithery/cli inspect mcp-firebird
# Uninstall server
npx @smithery/cli uninstall mcp-firebird --client claude📖 完整指南: Smithery CLI安装指南
手动安装
稳定版本
# Global installation (stable)
npm install -g mcp-firebird
# Run the server
npx mcp-firebird --database /path/to/database.fdb
# Or use specific stable version
npm install -g mcp-firebird@2.2.3稳定功能(v2.2.3):
- 🐛 固定的:SSE JSON解析错误-解决“无效消息:\[object object\]”错误
- ✨ 流式HTTP传输支持(MCP 2025-03-26)
- 🔄 具有自动协议检测功能的统一服务器
- 📊 增强会话管理和监控
- 🛠️ 现代MCP SDK集成(v1.13.2)
- 🔧 改进了错误处理和日志记录
- 🧪 全面的测试套件,包含9个以上的SSE功能测试
Alpha版本(最新功能)
# 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.0Alpha功能(v2.4.0-Alpha.0):
- � 新:为下一个开发周期做好准备
- ✨ 包括v2.2.3的所有稳定功能
- 🔄 具有自动协议检测功能的统一服务器
- 📊 增强会话管理和监控
- 🛠️ 现代MCP SDK集成(v1.13.2)
- 🔧 改进了错误处理和日志记录
- 🧪 全面的测试套件,包含9个以上的SSE功能测试
- 📚 通过故障排除指南增强文档
备注:SSE JSON解析错误修复现已在稳定的v2.2.3中提供
对于备份/还原操作,您需要安装Firebird客户端工具。看 完整安装 了解更多详情。
有关VSCode和GitHub Copilot集成,请参阅 VSCode集成.
基本用法
使用克劳德桌面
- 编辑Claude Desktop配置:
code $env:AppData\Claude\claude_desktop_config.json # Windows
code ~/Library/Application\ Support/Claude/claude_desktop_config.json # macOS- 添加MCP Firebird配置:
{
"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支持多种传输协议,以适应不同的客户端需求和部署场景。
STDIO传输(默认)
STDIO传输是Claude Desktop集成的标准方法:
{
"mcpServers": {
"mcp-firebird": {
"command": "npx",
"args": [
"mcp-firebird",
"--database", "C:\\path\\to\\database.fdb",
"--user", "SYSDBA",
"--password", "masterkey"
],
"type": "stdio"
}
}
}SSE传输(服务器发送事件)
SSE传输允许服务器作为web服务运行,这对于web应用程序和远程访问非常有用:
基本SSE配置
# 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 masterkeySSE的环境变量
# 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-firebirdSSE客户端连接
SSE服务器运行后,客户端可以连接到:
- SSE端点:
http://localhost:3003/sse - 消息端点:
http://localhost:3003/messages - 健康检查:
http://localhost:3003/health
流式HTTP传输(现代)
支持双向通信的最新MCP协议:
# Start with Streamable HTTP
npx mcp-firebird --transport-type http --http-port 3003 --database /path/to/database.fdb统一运输(推荐)
同时支持SSE和Streamable HTTP协议,并具有自动检测功能:
# Start unified server (supports both SSE and Streamable HTTP)
npx mcp-firebird --transport-type unified --http-port 3003 --database /path/to/database.fdb统一服务器端点
- SSE(传统):
http://localhost:3003/sse - 流式HTTP(现代):
http://localhost:3003/mcp - 自动检测:
http://localhost:3003/mcp-auto - 健康检查:
http://localhost:3003/health
配置示例
开发设置(SSE)
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_PASSWORDDocker与SSE
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高级SSE配置
会话管理
配置会话超时和限制:
# 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 sseCORS配置
对于web应用程序,配置CORS设置:
# 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 sseSSL/TLS支持
对于生产部署,使用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;
}
}故障排除
Firebird连接问题
- 有线加密不兼容(Firebird 3.0+) ⚠️ 关键的
错误: Incompatible wire encryption levels requested on client and server
重要:The node-firebird 库不支持Firebird 3.0+有线加密。这 --wire-crypt 参数不起作用。
唯一解决方案:您必须在Firebird服务器上禁用有线加密:
对于Firebird 3.0,添加 firebird.conf:
WireCrypt = Disabled
AuthServer = Srp, Legacy_Auth对于Firebird 4.0+,添加到 firebird.conf:
WireCrypt = Disabled
AuthServer = Srp256, Srp, Legacy_Auth对于Firebird 5.0 Docker:
environment:
FIREBIRD_CONF_WireCrypt: Disabled
FIREBIRD_CONF_AuthServer: Srp256, Srp如果您无法更改服务器配置,请参阅 有线加密限制 对于替代方案。
- Linux/Unix上的数据库路径问题
问题:远程连接字符串或Unix路径不起作用
解决方案:这在v2.4.0-alpha.1+中已修复。以下路径现在可以正常工作:
- 远程: server:/path/to/database.fdb - Unix绝对值: /var/lib/firebird/database.fdb - 基于IP: 192.168.1.100:/data/db.fdb
- Windows上混合大小写路径的I/O错误
错误: I/O error during CreateFile (open) operation
问题:混合情况下的数据库路径(例如。, C:\MyData\database.fdb)导致错误
权变措施:
- 使用所有大写路径: C:\MYDATA\DATABASE.FDB - 使用正斜杠: C:/MyData/database.fdb - 看 有线加密修复文档 详情请见
SSE连接问题
- 连接被拒绝
# 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- CORS错误
# Allow all origins (development only)
export CORS_ORIGIN="*"- 内存问题
# Reduce max sessions
export MAX_SESSIONS=100
# Enable more frequent cleanup
export SESSION_CLEANUP_INTERVAL_MS=30000- JSON解析问题(在v2.3.0-alpha.1+中修复)
# If experiencing "Invalid message: [object Object]" errors,
# upgrade to the latest alpha version:
npm install mcp-firebird@alpha
# Or use the latest alpha directly:
npx mcp-firebird@alpha --transport-type sse备注:2.3.0-alpha 1之前的版本有一个错误,POST请求 /messages 终结点未能正确解析JSON正文。此问题已通过改进得到解决 两者的中间件处理 application/json 和 text/plain 内容类型。
监控和日志记录
# Enable debug logging
export LOG_LEVEL=debug
# Monitor server health
curl http://localhost:3003/health | jq
# Check active sessions
curl http://localhost:3003/health | jq '.sessions'通过Smithery快速安装
通过以下方式自动安装MCP Firebird for Claude Desktop 史密瑟里:
npx -y @smithery/cli install @PuroDelphi/mcpFirebird --client claude文档
有关更多详细信息,请查看以下文件:
入门指南
- 完整安装
- 配置选项
- 可用工具
- 资源、工具和提示参考 -所有MCP功能的完整指南
传输协议
集成指南
高级主题
示例和用例
支持项目
捐款
如果您发现MCP Firebird对您的工作或项目有用,请考虑通过捐款支持其开发。您的贡献有助于维护和改进此工具。
- GitHub赞助商: 赞助商@PuroDelphi
- 贝宝: 通过PayPal捐款
雇佣我们的人工智能代理
支持这个项目的另一个好方法是通过以下方式雇佣我们的人工智能代理 自营职业者。我们为各种业务需求提供专业的人工智能助手,帮助您自动化任务并提高生产力。
优先支持
⭐ 捐助者、赞助商和客户获得优先支持和援助 包括问题、功能请求和实现指导。在我们努力帮助所有用户的同时,那些在财务上支持该项目的人将获得更快的响应时间和专门的帮助。
非常感谢您的支持,这有助于确保MCP Firebird的持续发展!
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

