SQLite-authoritative entity database with an async Google Sheets projection for AI agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Keep your app fast with SQLite. Keep your workflow visible in Google Sheets.
A typed repository and safe write layer for Google Sheets-backed MVPs: your application reads and writes local SQLite through typed entities, and committed changes are asynchronously projected to Google Sheets for human review and lightweight collaboration.
npm Β· Quick start Β· Issues
Hikoutei gives TypeScript applications a typed entity API backed by local SQLite, then asynchronously synchronizes committed changes to Google Sheets.
Your application does not wait on Google Sheets for normal reads and writes. Sheets remains available for inspection, operations, and lightweight human collaboration.
Hikoutei is not a raw Sheets API wrapper, not a replacement for PostgreSQL, and it does not treat Google Sheets as the authoritative application database. SQLite is the source of truth; Sheets is the human-facing view.
Define a scalar entity and use the local SQLite authority through a request-local manager.
What happens to the Sheet? The write commits to local SQLite immediately β the application request never waits on Google. When the sync service is enabled, Hikoutei later projects the entity to the registered Google Sheet in the background. Human edits made in the sheet are observed, validated, and either accepted back into SQLite or recorded as conflicts, never silently overwritten.
Hikoutei is a good fit for:
Use a conventional database and direct Google APIs when you need:
Hikoutei does not replace google-spreadsheet or @googleapis/sheets β it
sits one level above them. If you only need raw spreadsheet access, use the API
client directly.
| Capability | Hikoutei | google-spreadsheet | @googleapis/sheets |
|---|---|---|---|
| Typed entity model | β | β | β |
| Fast local application reads | β | β | β |
| Async projection to Sheets | β | β | β |
| Durable write retry and deduplication | β | β | β |
| Conflict-aware Sheet updates | β | β | β |
| Direct row and cell manipulation | Limited | β | β |
| Full Google Sheets API access | Provider only | Partial | β |
Google Sheets synchronization is a service-side concern. Applications do not
import a provider client, pass Sheet routes to createTypedSheets(), or choose
an operation for each write β the root API accepts only dbName and
entities. The sync runtime uses one internal Google Sheets API provider with
a service account β no Apps Script deployment. Sync auto-start is selected by
HIKOUTEI_SYNC_SPREADSHEET_URL plus GOOGLE_APPLICATION_CREDENTIALS; there is
no public googleSheetsApi bootstrap option to configure.
Fastest path: install the gcloud CLI, then run npx hikoutei setup from your
project directory. On an interactive terminal it offers (press Enter) to
start gcloud auth login --enable-gdrive-access --force for you when the
active account is missing or lacks Drive access β you only complete the
browser approval yourself. (In --yes, CI, or non-TTY sessions, run that
login command yourself first.) Setup then creates the project, service
account, and key, creates a spreadsheet owned by your account, shares it
with the service account as an Editor, verifies service-account access, and
writes GOOGLE_APPLICATION_CREDENTIALS plus HIKOUTEI_SYNC_SPREADSHEET_URL
into your .env. The human access token is used in memory only and never
stored. Automatic setup runs on macOS and Linux; on Windows a non-dry-run
is refused before any mutation and manual setup is available. Interrupted runs resume from a local checkpoint
(.hikoutei-setup-state.json); a spreadsheet create whose outcome is
unknown is reconciled by its creation marker on the next run and setup
never creates a second spreadsheet (inspect Drive and rerun if setup
reports sheet_create_uncertain, and a create rejected up front with
HTTP 400/403 plus a confirmed-zero marker lookup rolls back to key_ready
so a corrected rerun starts a fresh marker). Sharing is write-ahead too:
spreadsheet_share_started is persisted before the idempotent SA writer
permission ensure and spreadsheet_shared after it, so a crash between
the remote permission mutation and the checkpoint write resumes the
ensure on the next run and never creates a second spreadsheet. The
service-account key is
created under a write-ahead contract too: the user-managed key list is
recorded as a baseline before the single gcloud key create, and
key_create_started/key_ready checkpoints let a crashed run recover a
staged or installed key instead of creating a second one. Only the
invocation that just persisted key_create_started may issue the one key
create; resumed runs are reconcile-only and, when no credential and no
post-baseline key are visible, poll the key list plus staged/final
evidence for up to two minutes (2, 4, 8, 16, 30, 30, 30 s) before failing
with key_create_uncertain β the create is never retried automatically.
An unmatched user-managed key with no local credential is never deleted
automatically β setup fails with key_create_uncertain and you inspect
the key list in the Google Cloud console before rerunning (a
verified-absent state requires removing the setup state file to reset the
key checkpoint); reused keys are enforced to owner-only mode 600. An exclusive lock directory
(.hikoutei-setup-state.json.lock) prevents concurrent runs and is never
removed automatically: a crash leaves an empty lock directory behind, and
removing it manually is required only when you are certain no setup is
running. Starting fresh requires removing or moving both the checkpoint and
the key file, or passing --project to recover an existing key β
checkpointed or identity-matched cloud resources are reused, and setup
never deletes cloud resources. The manual steps below remain available for
advanced setups.
Setup progress. hikoutei setup reports step-by-step progress to
stderr across the ten setup phases (cloud auth, Drive access, project,
APIs, service account, service-account key, spreadsheet, share,
service-account access, output): an overall bar advances only when a
phase actually completes β it is never an ETA and never guesses a
percentage β and a detail line shows the bounded propagation checks
(how many of the eight key/access checks have run) and the known 2, 4, 8,
16, 30, 30, 30 s waits, with a fixed working⦠label for unknown-duration
steps. On an interactive terminal the four-line block redraws in place;
in CI, non-TTY, or NO_COLOR sessions one static line is printed per
phase/retry event with no control sequences. Progress pauses and the
block is cleared during the interactive gcloud auth login handoff and
resumes with the retry. Progress never prints credentials, tokens, keys,
project ids, emails, paths, or raw command output, and it can never
change the setup result or exit code; --dry-run prints the command
plan only.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/spreadsheet-db)<a href="https://allmcps.com/mcp/spreadsheet-db"><img src="https://allmcps.com/api/badge/spreadsheet-db?style=directory" alt="Spreadsheet DB on AllMCPs" /></a>