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
This is a running process of the Firebase MCP server. This command should only be executed by an MCP client. An example MCP client configuration might be:
-`--dir <absolute_dir_path>`: The absolute path of a directory containing `firebase.json` to set a project context for the MCP server. If unspecified, the `{get|set}_firebase_directory` tools will become available and the default directory will be the working directory where the MCP server was started.
33
+
-`--only <feature1,feature2>`: A comma-separated list of feature groups to activate. Use this to limit the tools exposed to only features you are actively using.
|`get_firebase_directory`|`core`| When running without the `--dir` command, retrieves the current directory (defaults to current working directory). |
40
+
|`set_firebase_directory`|`core`| When running without the `--dir` command, sets the current project directory (i.e. one with `firebase.json` in it). |
41
+
|`get_project`|`project`| Get basic information about the active project in the current Firebase directory. |
42
+
|`list_apps`|`project`| List registered apps for the currently active project. |
43
+
|`get_sdk_config`|`project`| Get an Firebase client SDK config for a specific platform. |
"Gets the current Firebase project directory. If this has been set using the `set_firebase_directory` tool it will return that, otherwise it will look for a PROJECT_ROOT environment variable or the current working directory of the running Firebase MCP server.",
11
+
inputSchema: z.object({}),
12
+
annotations: {
13
+
title: "Get Firebase Project Directory",
14
+
readOnlyHint: true,
15
+
},
16
+
},
17
+
(_,{ host })=>{
18
+
if(!detectProjectRoot({cwd: host.projectRoot}))
19
+
returnPromise.resolve(
20
+
mcpError(
21
+
`There is no detected 'firebase.json' in directory '${host.projectRoot}'. Please use the 'set_firebase_directory' tool to activate a Firebase project directory.`,
22
+
),
23
+
);
24
+
returnPromise.resolve(
25
+
toContent(`The current Firebase project directory is '${host.projectRoot}'.`),
"Sets the project directory for the Firebase MCP server to utilize for project detection and authentication. This should be a directory with a `firebase.json` file in it. This information is persisted between sessions.",
12
+
inputSchema: z.object({
13
+
dir: z
14
+
.string()
15
+
.nullable()
16
+
.describe(
17
+
"the absolute path of the directory. set to null to 'unset' the value and fall back to the working directory",
18
+
),
19
+
}),
20
+
annotations: {
21
+
title: "Set Firebase Project Directory",
22
+
idempotentHint: true,
23
+
},
24
+
},
25
+
({ dir },{ host })=>{
26
+
if(dir===null){
27
+
host.setProjectRoot(null);
28
+
returnPromise.resolve(
29
+
toContent(
30
+
`Firebase MCP project directory setting deleted. New project root is: ${host.projectRoot||"unset"}`,
31
+
),
32
+
);
33
+
}
34
+
35
+
if(!existsSync(dir))returnPromise.resolve(mcpError(`Directory '${dir}' does not exist.`));
36
+
if(!existsSync(join(dir,"firebase.json")))
37
+
returnPromise.resolve(
38
+
mcpError(`Directory '${dir}' does not contain a 'firebase.json' file.`),
39
+
);
40
+
host.setProjectRoot(dir);
41
+
returnPromise.resolve(toContent(`Firebase MCP project directory set to '${dir}'.`));
0 commit comments