Postgres-backed TokenStore for mcp-authkit, providing durable storage for Personal Access Tokens, refresh tokens, and upstream credential caches. Current stable version is 0.2.1, released as part of the mcp-authkit ecosystem. It wraps node-postgres (pg) and supports PostgreSQL 13+. Key differentiator: pools are consumer-owned, and store.close() does not close the pool to avoid ownership conflicts. Ships TypeScript types and uses ESM-only imports. Release cadence is tied to mcp-authkit releases.
npm install mcp-authkit-store-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a Postgres-backed token store, run schema migrations, and store/retrieve tokens.
Always close the Pool yourself: await pool.end(). Never rely on store.close() to release connections.
Change imports to 'mcp-authkit/stores/postgres' and uninstall the standalone package.
Run init() once during deployment via migration scripts, or use an advisory lock to serialize calls.
Optionally schedule a background task to DELETE expired rows. Otherwise stale tokens accumulate.
Switch your project to ESM ("type": "module" in package.json) or use dynamic import (const m = await import('mcp-authkit/stores/postgres')).Ensure store.init() is awaited before any get/set call. Check that the schema option matches database schema.
Run npm install pg@^8.13.0 and make sure you import { Pool } from 'pg' (not 'pg-pool').