{"id":26570826,"url":"https://github.com/gannonh/firebase-mcp","last_synced_at":"2025-12-30T09:25:06.064Z","repository":{"id":281413031,"uuid":"945181573","full_name":"gannonh/firebase-mcp","owner":"gannonh","description":"Model Context Protocol (MCP) server to interact with Firebase services.","archived":false,"fork":false,"pushed_at":"2025-03-19T18:58:48.000Z","size":296,"stargazers_count":11,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T19:39:35.502Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gannonh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T21:00:09.000Z","updated_at":"2025-03-19T18:58:51.000Z","dependencies_parsed_at":"2025-03-08T23:31:31.857Z","dependency_job_id":null,"html_url":"https://github.com/gannonh/firebase-mcp","commit_stats":null,"previous_names":["gannonh/firebase-mcp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gannonh%2Ffirebase-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gannonh%2Ffirebase-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gannonh%2Ffirebase-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gannonh%2Ffirebase-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gannonh","download_url":"https://codeload.github.com/gannonh/firebase-mcp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245026560,"owners_count":20549160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-22T22:19:16.687Z","updated_at":"2025-12-30T09:25:06.057Z","avatar_url":"https://github.com/gannonh.png","language":"TypeScript","funding_links":[],"categories":["Databases","Cloud \u0026 DevOps MCP Servers","📚 Projects (1974 total)","Community Servers","TypeScript","MCP 服务器精选列表","پیاده‌سازی‌های سرور","Cloud Platforms","File Management","Legend","MCP Servers","Uncategorized","🌐 Web Development","🗂️ Extensions by Category","Table of Contents"],"sub_categories":["Cloud Platforms","MCP Servers","🗄️ 数据库交互","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eپایگاه‌های داده","How to Submit","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","🗄️ Databases","Uncategorized","AI Services"],"readme":"# Firebase MCP\n\n\n![Project Logo](./assets/logo.png)\n\n\u003ca href=\"https://glama.ai/mcp/servers/x4i8z2xmrq\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/x4i8z2xmrq/badge\" alt=\"Firebase MCP server\" /\u003e\n\u003c/a\u003e\n\n[![Firebase Tests CI](https://github.com/gannonh/firebase-mcp/actions/workflows/tests.yml/badge.svg)](https://github.com/gannonh/firebase-mcp/actions/workflows/tests.yml)\n\n## Overview\n\n**Firebase MCP** enables AI assistants to work directly with Firebase services, including:\n\n- **Firestore**: Document database operations\n- **Storage**: File management with robust upload capabilities\n- **Authentication**: User management and verification\n\nThe server works with MCP client applicatios such as [Claude Desktop](https://claude.ai/download), [Augment Code](https://docs.augmentcode.com/setup-augment/mcp), [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers), and [Cursor](https://www.cursor.com/).\n\n\u003e ⚠️ **Known Issue**: The `firestore_list_collections` tool may return a Zod validation error in the client logs. This is an erroneous validation error in the MCP SDK, as our investigation confirmed no boolean values are present in the response. Despite the error message, the query still works correctly and returns the proper collection data. This is a log-level error that doesn't affect functionality.\n\n## ⚡ Quick Start\n\n### Prerequisites\n- Firebase project with service account credentials\n- Node.js environment\n\n### 1. Install MCP Server\n\nAdd the server configuration to your MCP settings file:\n\n- Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- Augment: `~/Library/Application Support/Code/User/settings.json`\n- Cursor: `[project root]/.cursor/mcp.json`\n\nMCP Servers can be installed manually or at runtime via npx (recommended). How you install determines your configuration:\n\n#### Configure for npx (recommended)\n\n   ```json\n   {\n     \"firebase-mcp\": {\n       \"command\": \"npx\",\n       \"args\": [\n         \"-y\",\n         \"@gannonh/firebase-mcp\"\n       ],\n       \"env\": {\n         \"SERVICE_ACCOUNT_KEY_PATH\": \"/absolute/path/to/serviceAccountKey.json\",\n         \"FIREBASE_STORAGE_BUCKET\": \"your-project-id.firebasestorage.app\"\n       }\n     }\n   }\n   ```\n\n#### Configure for local installation\n\n   ```json\n   {\n     \"firebase-mcp\": {\n       \"command\": \"node\",\n       \"args\": [\n         \"/absolute/path/to/firebase-mcp/dist/index.js\"\n       ],\n       \"env\": {\n         \"SERVICE_ACCOUNT_KEY_PATH\": \"/absolute/path/to/serviceAccountKey.json\",\n         \"FIREBASE_STORAGE_BUCKET\": \"your-project-id.firebasestorage.app\"\n       }\n     }\n   }\n```\n\n\n### 2. Test the Installation\n\nAsk your AI client: \"Please test all Firebase MCP tools.\"\n\n## 🛠️ Setup \u0026 Configuration\n\n### 1. Firebase Configuration\n\n1. Go to [Firebase Console](https://console.firebase.google.com) → Project Settings → Service Accounts\n2. Click \"Generate new private key\"\n3. Save the JSON file securely\n\n### 2. Environment Variables\n\n#### Required\n- `SERVICE_ACCOUNT_KEY_PATH`: Path to your Firebase service account key JSON (required)\n\n#### Optional\n- `FIREBASE_STORAGE_BUCKET`: Bucket name for Firebase Storage (defaults to `[projectId].appspot.com`)\n- `MCP_TRANSPORT`: Transport type to use (`stdio` or `http`) (defaults to `stdio`)\n- `MCP_HTTP_PORT`: Port for HTTP transport (defaults to `3000`)\n- `MCP_HTTP_HOST`: Host for HTTP transport (defaults to `localhost`)\n- `MCP_HTTP_PATH`: Path for HTTP transport (defaults to `/mcp`)\n- `DEBUG_LOG_FILE`: Enable file logging:\n  - Set to `true` to log to `~/.firebase-mcp/debug.log`\n  - Set to a file path to log to a custom location\n\n### 3. Client Integration\n\n#### Claude Desktop\nEdit: `~/Library/Application Support/Claude/claude_desktop_config.json`\n\n#### VS Code / Augment\nEdit: `~/Library/Application Support/Code/User/settings.json`\n\n#### Cursor\nEdit: `[project root]/.cursor/mcp.json`\n\n## 📚 API Reference\n\n### Firestore Tools\n\n| Tool                               | Description                    | Required Parameters        |\n| ---------------------------------- | ------------------------------ | -------------------------- |\n| `firestore_add_document`           | Add a document to a collection | `collection`, `data`       |\n| `firestore_list_documents`         | List documents with filtering  | `collection`               |\n| `firestore_get_document`           | Get a specific document        | `collection`, `id`         |\n| `firestore_update_document`        | Update an existing document    | `collection`, `id`, `data` |\n| `firestore_delete_document`        | Delete a document              | `collection`, `id`         |\n| `firestore_list_collections`       | List root collections          | None                       |\n| `firestore_query_collection_group` | Query across subcollections    | `collectionId`             |\n\n### Storage Tools\n\n| Tool                      | Description               | Required Parameters              |\n| ------------------------- | ------------------------- | -------------------------------- |\n| `storage_list_files`      | List files in a directory | None (optional: `directoryPath`) |\n| `storage_get_file_info`   | Get file metadata and URL | `filePath`                       |\n| `storage_upload`          | Upload file from content  | `filePath`, `content`            |\n| `storage_upload_from_url` | Upload file from URL      | `filePath`, `url`                |\n\n### Authentication Tools\n\n| Tool            | Description             | Required Parameters |\n| --------------- | ----------------------- | ------------------- |\n| `auth_get_user` | Get user by ID or email | `identifier`        |\n\n## 💻 Developer Guide\n\n### Installation \u0026 Building\n\n```bash\ngit clone https://github.com/gannonh/firebase-mcp\ncd firebase-mcp\nnpm install\nnpm run build\n```\n\n### Running Tests\n\nFirst, install and start Firebase emulators:\n```bash\nnpm install -g firebase-tools\nfirebase init emulators\nfirebase emulators:start\n```\n\nThen run tests:\n```bash\n# Run tests with emulator\nnpm run test:emulator\n\n# Run tests with coverage\nnpm run test:coverage:emulator\n```\n\n### Project Structure\n\n```bash\nsrc/\n├── index.ts                  # Server entry point\n├── utils/                    # Utility functions\n└── lib/\n    └── firebase/              # Firebase service clients\n        ├── authClient.ts     # Authentication operations\n        ├── firebaseConfig.ts   # Firebase configuration\n        ├── firestoreClient.ts # Firestore operations\n        └── storageClient.ts  # Storage operations\n```\n\n## 🌐 HTTP Transport\n\nFirebase MCP now supports HTTP transport in addition to the default stdio transport. This allows you to run the server as a standalone HTTP service that can be accessed by multiple clients.\n\n### Running with HTTP Transport\n\nTo run the server with HTTP transport:\n\n```bash\n# Using environment variables\nMCP_TRANSPORT=http MCP_HTTP_PORT=3000 node dist/index.js\n\n# Or with npx\nMCP_TRANSPORT=http MCP_HTTP_PORT=3000 npx @gannonh/firebase-mcp\n```\n\n### Client Configuration for HTTP\n\nWhen using HTTP transport, configure your MCP client to connect to the HTTP endpoint:\n\n```json\n{\n  \"firebase-mcp\": {\n    \"url\": \"http://localhost:3000/mcp\"\n  }\n}\n```\n\n### Session Management\n\nThe HTTP transport supports session management, allowing multiple clients to connect to the same server instance. Each client receives a unique session ID that is used to maintain state between requests.\n\n## 🔍 Troubleshooting\n\n### Common Issues\n\n#### Storage Bucket Not Found\nIf you see \"The specified bucket does not exist\" error:\n1. Verify your bucket name in Firebase Console → Storage\n2. Set the correct bucket name in `FIREBASE_STORAGE_BUCKET` environment variable\n\n#### Firebase Initialization Failed\nIf you see \"Firebase is not initialized\" error:\n1. Check that your service account key path is correct and absolute\n2. Ensure the service account has proper permissions for Firebase services\n\n#### Composite Index Required\nIf you receive \"This query requires a composite index\" error:\n1. Look for the provided URL in the error message\n2. Follow the link to create the required index in Firebase Console\n3. Retry your query after the index is created (may take a few minutes)\n\n#### Zod Validation Error with `firestore_list_collections`\nIf you see a Zod validation error with message \"Expected object, received boolean\" when using the `firestore_list_collections` tool:\n\n\u003e ⚠️ **Known Issue**: The `firestore_list_collections` tool may return a Zod validation error in the client logs. This is an erroneous validation error in the MCP SDK, as our investigation confirmed no boolean values are present in the response. Despite the error message, the query still works correctly and returns the proper collection data. This is a log-level error that doesn't affect functionality.\n\n### Debugging\n\n#### Enable File Logging\nTo help diagnose issues, you can enable file logging:\n\n```bash\n# Log to default location (~/.firebase-mcp/debug.log)\nDEBUG_LOG_FILE=true npx @gannonh/firebase-mcp\n\n# Log to a custom location\nDEBUG_LOG_FILE=/path/to/custom/debug.log npx @gannonh/firebase-mcp\n```\n\nYou can also enable logging in your MCP client configuration:\n\n```json\n{\n  \"firebase-mcp\": {\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"@gannonh/firebase-mcp\"],\n    \"env\": {\n      \"SERVICE_ACCOUNT_KEY_PATH\": \"/path/to/serviceAccountKey.json\",\n      \"FIREBASE_STORAGE_BUCKET\": \"your-project-id.firebasestorage.app\",\n      \"DEBUG_LOG_FILE\": \"true\"\n    }\n  }\n}\n```\n\n#### Real-time Log Viewing\nTo view logs in real-time:\n\n```bash\n# Using tail to follow the log file\ntail -f ~/.firebase-mcp/debug.log\n\n# Using a split terminal to capture stderr\nnpm start 2\u003e\u00261 | tee logs.txt\n```\n\n#### Using MCP Inspector\nThe MCP Inspector provides interactive debugging:\n\n```bash\n# Install MCP Inspector\nnpm install -g @mcp/inspector\n\n# Connect to your MCP server\nmcp-inspector --connect stdio --command \"node ./dist/index.js\"\n```\n\n## 📋 Response Formatting\n\n### Storage Upload Response Example\n\n```json\n{\n  \"name\": \"reports/quarterly.pdf\",\n  \"size\": \"1024000\",\n  \"contentType\": \"application/pdf\",\n  \"updated\": \"2025-04-11T15:37:10.290Z\",\n  \"downloadUrl\": \"https://storage.googleapis.com/bucket/reports/quarterly.pdf?alt=media\",\n  \"bucket\": \"your-project.appspot.com\"\n}\n```\n\nDisplayed to the user as:\n\n```markdown\n## File Successfully Uploaded! 📁\n\nYour file has been uploaded to Firebase Storage:\n\n**File Details:**\n- **Name:** reports/quarterly.pdf\n- **Size:** 1024000 bytes\n- **Type:** application/pdf\n- **Last Updated:** April 11, 2025 at 15:37:10 UTC\n\n**[Click here to download your file](https://storage.googleapis.com/bucket/reports/quarterly.pdf?alt=media)**\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Implement changes with tests (80%+ coverage required)\n4. Submit a pull request\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details\n\n## 🔗 Related Resources\n\n- [Model Context Protocol Documentation](https://github.com/modelcontextprotocol)\n- [Firebase Documentation](https://firebase.google.com/docs)\n- [Firebase Admin SDK](https://firebase.google.com/docs/admin/setup)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgannonh%2Ffirebase-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgannonh%2Ffirebase-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgannonh%2Ffirebase-mcp/lists"}