Token导航 LogoToken导航TokenDH.com
Fire MCP logo
AI代理未说明官方级别未说明来源级核验

Fire MCP

MCP Server

一个为Firestore设计的模型上下文协议服务器,使AI代理和LLM能够通过多种传输协议安全地与Firestore数据库交互。

工具数

5

提示词数

0

GitHub Stars

1

资源数

0
安全协议TypeScriptClaude多协议支持Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

iamanishroy

提供方

iamanishroy

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

FireMCP🔥

A. 模型上下文协议(MCP) 服务器 四大,使AI代理和LLM能够通过多种传输协议安全地与Firestore数据库交互。

![License: MIT](https://opensource.org/licenses/MIT)

🌟 特性

  • 多种传输协议:支持stdio、HTTP流式传输和服务器发送事件(SSE)
  • 设计安全:使用带有Firestore安全规则的Firebase客户端SDK,而不是Admin SDK
  • 完成CRUD操作:获取、设置、添加、删除和查询Firestore文档
  • 类型安全:使用TypeScript和Zod模式构建
  • MCP兼容:适用于任何兼容MCP的客户端(Claude Desktop等)

🔒 安全哲学

FireMCP使用 Firebase客户端SDK 出于关键的安全原因,不使用Admin SDK:

客户端SDK遵守Firestore安全规则,确保AI代理只能访问他们明确允许的数据。这可以防止对敏感资源的未经授权的访问,即使AI的行为出乎意料。

使用Admin SDK,AI将可以不受限制地访问所有Firestore数据,这在生产环境中可能是一个重大的安全风险。

📋 先决条件

  • 包子 v1.0或更高版本
  • 启用了Firestore的Firebase项目
  • Firebase身份验证已配置至少一个用户

🚀 快速开始

1.克隆存储库

git clone https://github.com/iamanishroy/firemcp.git
cd firemcp

2.安装依赖项

bun install

3.配置环境变量

复制示例环境文件并填写Firebase凭据:

cp .env.example .env

编辑 .env 使用Firebase配置:

# Required
FIREBASE_API_KEY=your-api-key-here
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_USER_EMAIL=user@example.com
FIREBASE_USER_PASSWORD=your-password-here

# Optional
PORT=3003
备注:您可以在您的 Firebase控制台 在“项目设置”下。

4.运行服务器

选择您喜欢的传输协议:

# stdio (default - for MCP clients like Claude Desktop)
bun run stdio

# HTTP Streamable
bun run http

# Server-Sent Events (SSE)
bun run sse

🔧 可用工具

FireMCP提供五种Firestore操作作为MCP工具:

1. get_document

按路径从Firestore检索文档。

输入:

{
  "path": "users/userId"
}

输出:

{
  "exists": true,
  "data": { "name": "John Doe", "email": "john@example.com" }
}

2. set_document

在Firestore中创建或覆盖文档。

输入:

{
  "path": "users/userId",
  "data": { "name": "Jane Doe", "email": "jane@example.com" },
  "merge": false
}

输出:

{
  "success": true
}

3. add_document

使用自动生成的ID将新文档添加到集合中。

输入:

{
  "collection": "users",
  "data": { "name": "Bob Smith", "email": "bob@example.com" }
}

输出:

{
  "id": "auto-generated-id"
}

4. delete_document

从Firestore中删除文档。

输入:

{
  "path": "users/userId"
}

输出:

{
  "success": true
}

5. query_collection

使用过滤器和限制查询Firestore集合。

输入:

{
  "collection": "users",
  "filters": [
    {
      "field": "age",
      "operator": ">",
      "value": 18
    },
    {
      "field": "active",
      "operator": "==",
      "value": true
    }
  ],
  "limit": 10
}

输出:

{
  "documents": [
    { "id": "doc1", "name": "Alice", "age": 25, "active": true },
    { "id": "doc2", "name": "Bob", "age": 30, "active": true }
  ]
}

🔌 与MCP客户端集成

克劳德桌面

添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "firestore": {
      "command": "bun",
      "args": ["run", "/path/to/firemcp/index.ts"],
      "env": {
        "FIREBASE_API_KEY": "your-api-key",
        "FIREBASE_PROJECT_ID": "your-project-id",
        "FIREBASE_USER_EMAIL": "user@example.com",
        "FIREBASE_USER_PASSWORD": "your-password"
      }
    }
  }
}

MCP检查员

调试和测试:

bun run inspect

🛠️ 发展

脚本

  • bun run start -从默认传输(stdio)开始
  • bun run dev -与开始时相同
  • bun run http -从HTTP流传输开始
  • bun run sse -从SSE运输开始
  • bun run stdio -从stdio传输开始
  • bun run inspect -启动MCP检查器进行调试
  • bun run kill -终止端口3003上运行的任何进程

添加新工具

  1. 在中创建新文件 src/tools/
  2. 使用Zod定义输入/输出模式
  3. 执行工具功能
  4. 在中注册该工具 src/server.ts

例子:

import { z } from "zod";
import { getFirestoreInstance } from "../firestore.js";

const inputSchemaObject = z.object({
  // Define your input schema
});

const outputSchemaObject = z.object({
  // Define your output schema
});

export const inputSchema = inputSchemaObject.shape;
export const outputSchema = outputSchemaObject.shape;

export const myTool = async (input: z.infer) => {
  const db = await getFirestoreInstance();
  // Implement your tool logic
  
  return {
    content: [{ type: 'text' as const, text: JSON.stringify(result) }],
    structuredContent: result
  };
};

🔐 消防安全规则

由于FireMCP使用客户端SDK,您 必须 配置Firestore安全规则。示例规则:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    // Allow authenticated users to read/write their own data
    match /users/{userId} {
      allow read, write: if request.auth != null && request.auth.uid == userId;
    }
    
    // Allow authenticated users to read public collections
    match /public/{document=**} {
      allow read: if request.auth != null;
    }
  }
}

📝 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

🙏 致谢

📧 支持

如果您有任何疑问或遇到问题,请 打开一个问题 在GitHub上。

目录标签

目录标签

安全协议TypeScriptClaude多协议支持Firestore本地部署数据库交互AI代理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明noneremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP