fujimoon
日本語

Works / AI

AI

Opening my own document portal to Claude

A personal document platform where HTML built with Claude Code is stored and published without leaving the conversation. Viewer, public, admin and MCP run as separate services, and publishing is its own tool.

Role
Design, implementation, operations
Period
Sept 2026 –
Stack
Next.js TypeScript Cloud Run IAP Firestore Cloud Storage Cloud Build MCP OAuth 2.1
Links
Docs ↗

Tools

Claude Code remote MCP

What AI did

Most of the implementation, research into the auth pitfalls, and the documents themselves.

What the human kept

Service separation and the CSP sandbox, which tools to leave out of MCP (delete, rollback), flipping visibility.

The problem

Claude Code produces a lot of HTML: design notes, decks, comparisons. There was nowhere to put them. GitHub Pages is public to everyone; Google Drive is awkward for an AI to use. I wanted “store where only I can read, publish only what I choose”.

Do not trust the HTML you store

viewer

Me only, behind IAP with a single allowed Google account

public

Anyone. Same image, serves published documents only

admin

Register, update, publish, delete

mcp

Register and update from Claude

JavaScript inside a stored page cannot be trusted. Served from the admin origin it could call admin actions, so the origins are separated and the CSP sandbox withholds same-origin. Two layers, and the sandbox setting carries a comment: never add allow-same-origin.

Exposed to MCP

List, get, register, add a version, update metadata, change visibility

Deliberately not exposed

Delete, roll back, rename, move. Irreversible actions are done by a person in the admin UI

Status (draft / published / archived) and visibility (private / public) are separate axes. New documents always start as draft and private, and only published documents can become public. Visibility is a dedicated tool so that a call meant to fix a title can never accidentally publish.

Related

Client work Internal anonymized

One MCP server to run the company

A custom MCP server bundling Slack, email, payments, the production database, logs, calendar, deployments and issue tracking into 90 tools. Investigation, incident response and release checks are done entirely through Claude Code.

TypeScript · MCP · Next.js · Cloud SQL · GCP Logging