loading…
Search for a command to run...
loading…
Enables synchronization and management of FoundryVTT journal entries within a Notion Story Bible, including media export and conflict resolution tools. It provi
Enables synchronization and management of FoundryVTT journal entries within a Notion Story Bible, including media export and conflict resolution tools. It provides a Model Context Protocol interface for LLMs to preview, apply, and monitor data mirroring between tabletop RPG platforms and digital databases.
This project implements Stage 1 of your plan:
Music and Madness Story Bible with a top-level Journals wiki tree/Users/nicholasmcdowell/Documents/Codex Projects/Music and Madness/music-madness-sync-bridge/src/Users/nicholasmcdowell/Documents/Codex Projects/Music and Madness/music-madness-sync-bridge/foundry-module/music-madness-bridge/Users/nicholasmcdowell/Documents/Codex Projects/Music and Madness/music-madness-sync-bridge/datastate/bridge.sqlite), media copies (media/), logs (logs/audit.log).sync.foundry_to_notion.apply.## Foundry Mirror in a Notion page.Journals, with sub-pages matching Foundry folders.cd '/Users/nicholasmcdowell/Documents/Codex Projects/Music and Madness/music-madness-sync-bridge'
cp .env.example .env
.env values:NOTION_STORY_BIBLE_PAGE_ID)npm run typecheck
Preview changes (no writes):
npm run sync:preview
sync:preview auto-starts the local proxy when FOUNDRY_BASE_URL is local (127.0.0.1 / localhost / ::1) and FOUNDRY_AUTO_PROXY=1.
Preview/write targets are wiki pages under Journals, not Notion databases.
Apply mirror updates:
npm run sync:apply
sync:apply has the same auto-proxy behavior and stops the proxy afterward only if this command started it.
When creating a page, it mirrors Foundry folder structure under the Journals wiki tree.
Media download/linking is enabled by default; disable with --no-include-media.
List conflicts:
npm run sync:conflicts
Resolve one conflict:
npm run sync:resolve -- --conflict-id <id> --resolution manual_merge --notes "Reviewed and merged"
Health check:
tsx src/cli.ts health
Run stdio MCP server:
npm run mcp:start
Exposed tools:
foundry.health_checkfoundry.list_journalsfoundry.get_journalfoundry.export_journal_mediasync.foundry_to_notion.previewsync.foundry_to_notion.applysync.diffsync.conflicts.listsync.conflicts.resolveNOTION_ALLOWED_DATABASE_IDS.Music and Madness section is untouched by default because database scope is explicit./health, /journals, /journals/:id, etc.MEDIA_PUBLIC_BASE_URL to a reachable static host.If your Foundry module routes are not live yet, run the mock API that implements:
GET /healthGET /journalsGET /journals/:idGET /journals/:id/mediaGET /assets/:assetIdGET /changes?since=Command:
npm run foundry:mock-api
Fixture data file:
/Users/nicholasmcdowell/Documents/Codex Projects/Music and Madness/music-madness-sync-bridge/fixtures/foundry-fixture.jsonUse this when your Foundry world and music-madness-bridge module are running.
Your sync client expects HTTP routes (/journals, /health, etc.).
The Foundry module communicates via socket events in-world.
This proxy translates HTTP calls to socket event calls.
music-madness-bridge is enabled.Bridge Token to the same value as .env FOUNDRY_BRIDGE_TOKEN..env:FOUNDRY_SITE_URLFOUNDRY_WORLDFOUNDRY_SESSION_COOKIEFOUNDRY_BRIDGE_TOKENnpm run foundry:proxy
npm run sync:preview
npm run sync:apply
FOUNDRY_SESSION_COOKIE is the value of the session cookie from a browser already logged into your Foundry world.
Treat it like a secret token.
GET /assets/:assetId returns 501 in socket-proxy mode unless your module adds binary asset streaming.
Media still syncs from journal-linked sourceUrl values where accessible.
If Foundry runs on another machine on your network, set:
FOUNDRY_SITE_URL=http://192.168.1.105:30000/
Keep the sync client pointed at your local proxy:
FOUNDRY_BASE_URL=http://127.0.0.1:8788
So the flow is:
127.0.0.1:8788)192.168.1.105:30000)You still need:
FOUNDRY_WORLD for that remote Foundry worldFOUNDRY_SESSION_COOKIE from a browser logged into that remote FoundryFOUNDRY_BRIDGE_TOKEN in Foundry module world settingsRun this before sync to verify remote Foundry + proxy health.
This command does not auto-start proxy; start it explicitly first with npm run foundry:proxy.
npm run health:remote
What it checks:
FOUNDRY_SITE_URL HTTP reachability/health response and socket connection state/journals route responseExit code is non-zero if any check fails.
Verbose diagnostics with remediation hints:
npm run health:remote -- --verbose
Validate your .env before running proxy or sync:
npm run doctor
What it validates:
FOUNDRY_BASE_URL, FOUNDRY_SITE_URL)NOTION_DEFAULT_TARGET_DB_ID is in NOTION_ALLOWED_DATABASE_IDS)Exit code is non-zero when required checks fail.
For one-click Foundry install/update via URL, use the release workflow guide:
/Users/nicholasmcdowell/Documents/Codex Projects/Music and Madness/music-madness-sync-bridge/docs/foundry_remote_install.mdQuick command (example):
MODULE_VERSION=0.1.0 MODULE_URL=https://github.com/<you>/<repo> MODULE_MANIFEST_URL=https://raw.githubusercontent.com/<you>/<repo>/main/foundry-module/music-madness-bridge/module.json MODULE_DOWNLOAD_URL=https://github.com/<you>/<repo>/releases/download/v0.1.0/music-madness-bridge-v0.1.0.zip node scripts/release/prepare-foundry-module.mjs
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"music-and-madness-sync-bridge": {
"command": "npx",
"args": []
}
}
}