You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,15 +16,82 @@ The [Model Context Protocol (MCP)](https://github.com/modelcontextprotocol) is a
16
16
-**Firestore**: Document database operations
17
17
-**Storage**: File storage and retrieval
18
18
19
-
The server exposes Firebase services through MCP tools, making them accessible to LLM clients including [Claude Desktop](https://claude.ai/download), [Cursor](https://www.cursor.com/), [Roo Code](https://github.com/RooVetGit/Roo-Code), and [Cline](https://cline.bot/), while handling authentication and connection management.
19
+
The server exposes Firebase services through MCP tools, making them accessible to LLM clients including [Claude Desktop](https://claude.ai/download), [Augment](https://docs.augmentcode.com/setup-augment/mcp#about-model-context-protocol-servers), [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers), [Cursor](https://www.cursor.com/), and others, while handling authentication and connection management.
20
20
21
-
## π₯ New in v1.3.0: Collection Group Queries
21
+
## π₯ New in v1.3.3: Storage Upload Features
22
22
23
-
Firebase MCP now supports querying sub-collections (collection groups) in Firestore! This allows you to query across all sub-collections with the same name, regardless of their parent document - making it easy to search across your entire database hierarchy with a single query. Perfect for cross-document searches, activity feeds, and unified dashboards.
23
+
Firebase MCP now supports direct file uploads to Firebase Storage! Version 1.3.3 introduces two new tools:
24
24
25
-
## Setup
25
+
-**`storage_upload`**: Upload files directly from text or base64 content with automatic content type detection
26
+
-**`storage_upload_from_url`**: Import files from external URLs with a single command
27
+
28
+
Both tools provide **permanent public URLs** that don't expire, making it easier to share and access your uploaded files. They also include user-friendly response formatting to display file information and download links in a clean, readable format.
29
+
30
+
#### File Upload Options for MCP Clients
31
+
32
+
MCP clients can upload files to Firebase Storage in three ways:
33
+
34
+
1.**Direct Local File Path** (RECOMMENDED for binary files)
35
+
```ts
36
+
{
37
+
`filePath`: `my-image.png`,
38
+
`content`: `/path/to/local/image.png`
39
+
}
40
+
```
41
+
The server will read the file, detect its content type, and upload it to Firebase Storage.
42
+
43
+
> βΌοΈ **Note for MCP Clients**: This method is strongly recommended for all file types, especially binary files like PDFs and images. Path-based uploads are faster and more reliable than base64 encoding, which often fails with large files. MCP clients are made aware of this recommendation via the tool description. βΌοΈ
The server will automatically detect the content type from the data URL prefix. This method works (most of the time) for small files but **clients may struggle with larger files due to the base64 encoding string length**.
53
+
54
+
3.**Plain Text** (For text files)
55
+
```ts
56
+
{
57
+
`filePath`: `readme.md`,
58
+
`content`: `# My README\n\nThis is a markdown file.`
59
+
}
60
+
```
61
+
62
+
The server handles all the necessary conversion and content type detection, making it easy for MCP clients to upload files without complex preprocessing.
63
+
64
+
#### Best Practices for File Uploads
65
+
66
+
When using this server with any MCP client, follow these best practices for file uploads:
67
+
68
+
1.**Use Direct File Paths**: Always use the full path to files on your system
69
+
```ts
70
+
{
71
+
`filePath`: `financial_report.pdf`,
72
+
`content`: `/Users/username/Downloads/report.pdf`
73
+
}
74
+
```
75
+
76
+
2.**URL-Based Uploads**: For files available online, use the `storage_upload_from_url` tool
77
+
```ts
78
+
{
79
+
`filePath`: `financial_report.pdf`,
80
+
`url`: `https://example.com/report.pdf`
81
+
}
82
+
```
83
+
84
+
3.**Text Extraction**: For text-based files, Claude can extract and upload the content directly
85
+
```ts
86
+
{
87
+
`filePath`: `report_summary.txt`,
88
+
`content`: `This quarterly report shows a 15% increase in revenue...`
89
+
}
90
+
```
91
+
92
+
> βΌοΈ **Important**: Document references (like `/document/123` or internal references) are not directly accessible by external tools. Always use the actual file path or URL for reliable uploads. βΌοΈ
26
93
27
-
> The easiest way to install the Firebase MCP server is to simply feed your LLM client (like Cline) the [llms-install.md](./llms-install.md) file.
94
+
## Setup
28
95
29
96
### 1. Firebase Configuration
30
97
@@ -46,9 +113,8 @@ The server requires the following environment variables:
46
113
Add the server configuration to your MCP settings file:
47
114
48
115
- Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.json`
When displaying responses from the Firebase MCP server, clients should format the responses in a user-friendly way. This is especially important for storage operations where users benefit from seeing file information in a structured format with clickable links.
316
+
317
+
#### Example: Formatting Storage Upload Responses
318
+
319
+
Raw response from `storage_upload` or `storage_upload_from_url`:
- **Last Updated:** April 10, 2025 at 22:37:10 UTC
341
+
342
+
**[Click here to download your file](https://storage.googleapis.com/bucket/example.txt?token...)**
343
+
```
344
+
345
+
This formatting provides a better user experience by:
346
+
1. Clearly indicating success with a descriptive heading
347
+
2. Organizing file details in an easy-to-read format
348
+
3. Providing a clickable download link
349
+
4. Using appropriate formatting and emoji for visual appeal
350
+
225
351
## Development
226
352
227
353
### Building
@@ -250,22 +376,33 @@ The project uses Vitest for testing. Tests can be run against Firebase emulators
250
376
3.**Run Tests**
251
377
252
378
```bash
379
+
# Run tests with emulator
253
380
npm run test:emulator
381
+
382
+
# Run tests with coverage report
383
+
npm run test:coverage
384
+
385
+
# Run tests with coverage report in emulator mode
386
+
npm run test:coverage:emulator
254
387
```
255
388
389
+
The coverage reports will be generated in the `coverage` directory. The project aims to maintain at least 90% code coverage across all metrics (lines, statements, functions, and branches).
390
+
256
391
### Architecture
257
392
258
393
The server is structured into three main components:
0 commit comments