Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Moved MCP server `firebase-debug.log` to `~/.cache/firebase/firebase-debug.log`. (#9982)
- Added a prompt to `firebase init` to install Agent Skills for Firebase.
9 changes: 7 additions & 2 deletions src/bin/mcp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node

import { resolve } from "path";
import { resolve, join } from "path";
import { mkdir } from "fs/promises";
import { homedir } from "os";
import { parseArgs } from "util";
import { useFileLogger } from "../logger";
import { FirebaseMcpServer } from "../mcp/index";
Expand Down Expand Up @@ -50,7 +52,7 @@
-h, --help Show this help message.
`;

export async function mcp(): Promise<void> {

Check warning on line 55 in src/bin/mcp.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
const { values } = parseArgs({
options: {
only: { type: "string", default: "" },
Expand Down Expand Up @@ -84,7 +86,10 @@
if (earlyExit) return;

setFirebaseMcp(true);
useFileLogger();
// Write debug logs to ~/.cache/firebase to avoid polluting the user's project directory.
const mcpLogDir = join(homedir(), ".cache", "firebase");
await mkdir(mcpLogDir, { recursive: true });
useFileLogger(join(mcpLogDir, "firebase-debug.log"));
Comment thread
joehan marked this conversation as resolved.
const activeFeatures = (values.only || "")
.split(",")
.map((f) => f.trim())
Expand Down
Loading