StoryCanon
A structured story bible for long-form fiction: scenes, characters, world, plot and foreshadowing.
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
claude mcp add --transport http storycanon 'https://storycanon.softglow.jp/mcp' --header 'Authorization: <Bearer token. Only needed for clients that cannot do OAuth — the server advertises OAuth 2.1 with dynamic client registration, so connector-style clients obtain their own token from the URL alone. Hand-issued tokens come from the Settings page.>'
{
"mcpServers": {
"storycanon": {
"type": "http",
"url": "https://storycanon.softglow.jp/mcp",
"headers": {
"Authorization": "<Bearer token. Only needed for clients that cannot do OAuth — the server advertises OAuth 2.1 with dynamic client registration, so connector-style clients obtain their own token from the URL alone. Hand-issued tokens come from the Settings page.>"
}
}
}
}
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
StoryCanon
StoryCanon は、ChatGPT で生成・相談した小説の設定、本文、キャラクター、世界観、伏線、TODO、現在の物語状態を作品ごとに保存するための MVP 実装です。
構成
apps/web: Next.js + TypeScript + Prisma + PostgreSQL の Web/API アプリpackages/db: Prisma クライアント。Node と Cloudflare Workers で別の生成物が要るため独立したパッケージにしてある(後述)docs: 内部仕様、外部仕様、移行の記録tests/integration: ローカル結合テスト
デプロイ先
本番は Cloudflare Workers + Supabase PostgreSQL(東京) で稼働している。
main への push で .github/workflows/deploy-workers.yml がマイグレーションとデプロイを行う。
2026-08-30 までは AWS(ALB + ECS Fargate + RDS)だった。移行の経緯と当時ハマった点は
docs/cloudflare-cutover.md に残してある。AWS 側の資源は撤去済みで、
CDK のブートストラップも消してあるため、AWS へ戻すには cdk bootstrap からやり直しになる。
ローカル開発
npm install
Copy-Item .env.example apps/web/.env
docker compose up -d postgres
npm run prisma:migrate -w apps/web
npm run dev -w apps/web
テスト
npm run test -w apps/web # ユニット
npm run test:integration # 結合(外部リソースは作らない)
Prisma クライアント
Prisma 7 は TypeScript しか出力しないため、クライアントは packages/db でコンパイルしてから使う。
Node と workerd では必要な生成物が違うので両方を作り、package.json の conditional export で
振り分けている。呼び出し側は @storycanon/db を import するだけでよい。
生成物は git 管理外で、npm run dev / build / test / lint が必要な方を自動で作る。
tsc を単体で走らせる場合だけ、先に npm run db:node -w apps/web が要る。
Cloudflare へのデプロイ
通常は main への push で CI が行う。手元から出す場合は apps/web で:
npm run deploy:worker
npx opennextjs-cloudflare build を直接叩かないこと。 deploy:worker は
scripts/build-worker.mjs 経由でローカルの .env 類を退避してからビルドする。
これを飛ばすと next build がローカルの値をバンドルに焼き込み、NEXTAUTH_SECRET が
開発用の値のまま本番に乗る。
الأسئلة الشائعة
ما هو StoryCanon؟
A structured story bible for long-form fiction: scenes, characters, world, plot and foreshadowing.
كيف أثبّت StoryCanon؟
يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http storycanon 'https://storycanon.softglow.jp/mcp' --header 'Authorization: <Bearer token. Only needed for clients that cannot do OAuth — the server advertises OAuth 2.1 with dynamic client registration, so connector-style clients obtain their own token from the URL alone. Hand-issued tokens come from the Settings page.>'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج StoryCanon إلى مفتاح API؟
نعم. يتطلب Authorization، وتضبطها في إعداداته.
هل StoryCanon مفتوح المصدر؟
شيفرته علنية على GitHub، لكن المستودع لا يعلن ترخيصًا قياسيًا.
من يصون StoryCanon؟
ينشره exp3. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.