!firestore
Manage and interact with Firestore databases by configuring project credentials and exploring data structures within the db-mcp-tool environment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | Yes |
Implementation Reference
- src/index.ts:100-122 (registration)Registration of the !firestore tool, including the inline handler function that sets up and connects to Firestore via DatabaseServiceserver.tool( "!firestore", firestoreConnectionSchema, async (args: { connection: DatabaseConnectionConfig }) => { try { const config: DatabaseConfig = { type: 'firestore', connection: args.connection }; dbService = new DatabaseService(config); await dbService.connect(); return { content: [{ type: "text", text: "Successfully connected to Firestore database!" }], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [{ type: "text", text: `Firestore connection error: ${errorMessage}` }], isError: true, }; } } );
- src/index.ts:42-47 (schema)Zod schema for validating !firestore tool input (projectId and keyFilename)const firestoreConnectionSchema = { connection: z.object({ projectId: z.string(), keyFilename: z.string(), }), };
- src/services/database.ts:29-33 (helper)Firestore-specific connection logic in DatabaseService.connect() method, initializes Firestore clientcase 'firestore': { const config = this.config.connection as any; this.firestoreClient = new Firestore(config); break; }
- src/types/database.ts:1-18 (schema)TypeScript type definitions for DatabaseConfig supporting Firestore connection parametersexport type DatabaseType = 'postgres' | 'mysql' | 'firestore'; export interface DatabaseConnectionConfig { // PostgreSQL ve MySQL için host?: string; port?: number; database?: string; user?: string; password?: string; // Firestore için projectId?: string; keyFilename?: string; } export interface DatabaseConfig { type: DatabaseType; connection: DatabaseConnectionConfig; }