Bayt al-Hiqma Personal Memory MCP

A Vercel-ready JSON-RPC MCP server that lets ChatGPT search, read, and safely update a user-owned Markdown memory vault.

Endpoints

Required configuration

OAUTH_OWNER_PASSWORDOwner password used on the OAuth authorization screen.
OAUTH_TOKEN_SECRETSecret used to sign OAuth authorization codes and bearer tokens.
OAUTH_BASE_URL / MCP_PUBLIC_ORIGINPublic deployment origin used for OAuth metadata and callbacks.
OAUTH_RESOURCEOptional protected resource identifier; defaults to the public /api/mcp URL.
OAUTH_ISSUEROptional OAuth issuer URL; defaults to the public app origin.
OAUTH_CLIENT_IDOptional client allow-list for OAuth authorization requests.
OAUTH_TOKEN_TTL_SECONDS / OAUTH_CODE_TTL_SECONDSOptional expiration windows for access tokens and authorization codes.
DIAGNOSTICS_TOKENOptional bearer token for /api/diagnostics only.
VAULT_BACKENDUse github for Vercel deployments or local for development.
GITHUB_TOKENServer-side token with access to the Markdown vault repository.
GITHUB_OWNER / GITHUB_REPO / GITHUB_BRANCHRepository namespace, storage identifier, and branch target.
VAULT_ROOTOptional root folder inside the repository.
DAILY_NOTES_DIR / CANONICAL_NOTES_DIR / DECISIONS_DIRGenerated note folders.
SEARCH_RESULT_LIMIT / GRAPH_RESULT_LIMIT / MAX_FILE_SIZE_BYTESBounds for context exposure and processing.

ChatGPT connection

  1. Deploy this app to Vercel with the GitHub vault and OAuth environment variables set server-side.
  2. Configure ChatGPT to call https://your-app.vercel.app/api/mcp with OAuth.
  3. Authorize the connection with the owner password from OAUTH_OWNER_PASSWORD.
  4. Optionally set DIAGNOSTICS_TOKEN if you want /api/diagnostics to require a bearer token.
  5. Ask ChatGPT to retrieve before relying on personal context and to write only concise, durable memories.

Safety model

Reads are bounded, writes are path-safe, note creation refuses overwrites, section updates and canonical updates use conflict detection, and generated content remains plain Markdown with common frontmatter conventions.