@qihuang02/world-book-mcp 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -170
- package/README_ZH.md +128 -170
- package/dist/core/character-card-builder.d.ts +0 -1
- package/dist/core/character-card-builder.js +19 -9
- package/dist/core/character-card-builder.js.map +1 -1
- package/dist/core/character-card-importer.d.ts +0 -6
- package/dist/core/character-card-importer.js +1 -5
- package/dist/core/character-card-importer.js.map +1 -1
- package/dist/core/character-card-project-builder.d.ts +1 -8
- package/dist/core/character-card-project-builder.js +7 -35
- package/dist/core/character-card-project-builder.js.map +1 -1
- package/dist/core/character-card-validator.d.ts +8 -9
- package/dist/core/character-card-validator.js +25 -28
- package/dist/core/character-card-validator.js.map +1 -1
- package/dist/core/content-lint.js +26 -1
- package/dist/core/content-lint.js.map +1 -1
- package/dist/core/decision-prompts.d.ts +13 -20
- package/dist/core/decision-prompts.js +5 -5
- package/dist/core/decision-prompts.js.map +1 -1
- package/dist/core/delivery-checklist.d.ts +4 -2
- package/dist/core/delivery-checklist.js +27 -55
- package/dist/core/delivery-checklist.js.map +1 -1
- package/dist/core/draft-field-editor.d.ts +3 -0
- package/dist/core/draft-field-editor.js +125 -0
- package/dist/core/draft-field-editor.js.map +1 -0
- package/dist/core/ejs-analyzer.d.ts +28 -0
- package/dist/core/ejs-analyzer.js +64 -0
- package/dist/core/ejs-analyzer.js.map +1 -0
- package/dist/core/ejs-validator.d.ts +11 -11
- package/dist/core/ejs-validator.js +78 -32
- package/dist/core/ejs-validator.js.map +1 -1
- package/dist/core/extraction-outline.d.ts +36 -1
- package/dist/core/extraction-outline.js.map +1 -1
- package/dist/core/final-review.d.ts +2 -12
- package/dist/core/final-review.js +2 -77
- package/dist/core/final-review.js.map +1 -1
- package/dist/core/first-message-validator.d.ts +16 -0
- package/dist/core/first-message-validator.js +69 -0
- package/dist/core/first-message-validator.js.map +1 -0
- package/dist/core/html-beautify-validator.d.ts +9 -12
- package/dist/core/html-beautify-validator.js +25 -35
- package/dist/core/html-beautify-validator.js.map +1 -1
- package/dist/core/mvu-assets.d.ts +6 -5
- package/dist/core/mvu-assets.js +14 -10
- package/dist/core/mvu-assets.js.map +1 -1
- package/dist/core/mvu-path-analyzer.d.ts +24 -0
- package/dist/core/mvu-path-analyzer.js +288 -0
- package/dist/core/mvu-path-analyzer.js.map +1 -0
- package/dist/core/mvu-template.js +1 -2
- package/dist/core/mvu-template.js.map +1 -1
- package/dist/core/mvu-validator.d.ts +12 -11
- package/dist/core/mvu-validator.js +92 -67
- package/dist/core/mvu-validator.js.map +1 -1
- package/dist/core/mvu-variable-editor.d.ts +35 -0
- package/dist/core/mvu-variable-editor.js +528 -0
- package/dist/core/mvu-variable-editor.js.map +1 -0
- package/dist/core/position-map.d.ts +0 -2
- package/dist/core/position-map.js +2 -2
- package/dist/core/position-map.js.map +1 -1
- package/dist/core/project-assets.d.ts +16 -0
- package/dist/core/project-assets.js +52 -0
- package/dist/core/project-assets.js.map +1 -0
- package/dist/core/project-draft-aggregate.d.ts +24 -0
- package/dist/core/project-draft-aggregate.js +121 -0
- package/dist/core/project-draft-aggregate.js.map +1 -0
- package/dist/core/project-initializer.d.ts +17 -0
- package/dist/core/project-initializer.js +89 -0
- package/dist/core/project-initializer.js.map +1 -0
- package/dist/core/project-validator.d.ts +6 -0
- package/dist/core/project-validator.js +95 -0
- package/dist/core/project-validator.js.map +1 -0
- package/dist/core/third-party-asset-importer.d.ts +20 -0
- package/dist/core/third-party-asset-importer.js +193 -0
- package/dist/core/third-party-asset-importer.js.map +1 -0
- package/dist/core/validation-types.d.ts +61 -0
- package/dist/core/validation-types.js +70 -0
- package/dist/core/validation-types.js.map +1 -0
- package/dist/core/worldbook-builder.js +4 -3
- package/dist/core/worldbook-builder.js.map +1 -1
- package/dist/core/worldbook-draft-editor.d.ts +1 -23
- package/dist/core/worldbook-draft-editor.js +6 -201
- package/dist/core/worldbook-draft-editor.js.map +1 -1
- package/dist/core/worldbook-entry-defaults.d.ts +2 -0
- package/dist/core/worldbook-entry-defaults.js +28 -0
- package/dist/core/worldbook-entry-defaults.js.map +1 -0
- package/dist/core/worldbook-importer.d.ts +1 -5
- package/dist/core/worldbook-importer.js +4 -8
- package/dist/core/worldbook-importer.js.map +1 -1
- package/dist/core/worldbook-validator.js +32 -1
- package/dist/core/worldbook-validator.js.map +1 -1
- package/dist/core/worldbuilding.d.ts +0 -11
- package/dist/core/worldbuilding.js +0 -18
- package/dist/core/worldbuilding.js.map +1 -1
- package/dist/schemas/character-card.d.ts +0 -795
- package/dist/schemas/character-card.js +1 -72
- package/dist/schemas/character-card.js.map +1 -1
- package/dist/schemas/decision.d.ts +0 -16
- package/dist/schemas/decision.js +0 -10
- package/dist/schemas/decision.js.map +1 -1
- package/dist/schemas/draft-slice.d.ts +458 -0
- package/dist/schemas/draft-slice.js +153 -0
- package/dist/schemas/draft-slice.js.map +1 -0
- package/dist/schemas/ejs.d.ts +7 -158
- package/dist/schemas/ejs.js +4 -35
- package/dist/schemas/ejs.js.map +1 -1
- package/dist/schemas/html-beautify.d.ts +0 -133
- package/dist/schemas/html-beautify.js +0 -26
- package/dist/schemas/html-beautify.js.map +1 -1
- package/dist/schemas/mvu.d.ts +88 -58
- package/dist/schemas/mvu.js +52 -29
- package/dist/schemas/mvu.js.map +1 -1
- package/dist/schemas/project.d.ts +82 -435
- package/dist/schemas/project.js +28 -4
- package/dist/schemas/project.js.map +1 -1
- package/dist/schemas/worldbook-draft.d.ts +37 -264
- package/dist/schemas/worldbook-draft.js +29 -86
- package/dist/schemas/worldbook-draft.js.map +1 -1
- package/dist/server.js +0 -2
- package/dist/server.js.map +1 -1
- package/dist/storage/draft-store.d.ts +23 -0
- package/dist/storage/draft-store.js +120 -0
- package/dist/storage/draft-store.js.map +1 -0
- package/dist/storage/path-policy.d.ts +0 -13
- package/dist/storage/path-policy.js +41 -76
- package/dist/storage/path-policy.js.map +1 -1
- package/dist/storage/plan-store.d.ts +11 -0
- package/dist/storage/plan-store.js +106 -0
- package/dist/storage/plan-store.js.map +1 -0
- package/dist/storage/project-store.d.ts +10 -0
- package/dist/storage/project-store.js +19 -4
- package/dist/storage/project-store.js.map +1 -1
- package/dist/storage/tool-log.d.ts +4 -0
- package/dist/storage/tool-log.js +108 -0
- package/dist/storage/tool-log.js.map +1 -0
- package/dist/storage/workspace-store.d.ts +3 -6
- package/dist/storage/workspace-store.js +24 -68
- package/dist/storage/workspace-store.js.map +1 -1
- package/dist/tools/decision-tools.js +4 -16
- package/dist/tools/decision-tools.js.map +1 -1
- package/dist/tools/{worldbook-tools.d.ts → draft-tools.d.ts} +1 -1
- package/dist/tools/draft-tools.js +110 -0
- package/dist/tools/draft-tools.js.map +1 -0
- package/dist/tools/{mvu-html-ejs-tools.d.ts → export-tools.d.ts} +1 -1
- package/dist/tools/export-tools.js +78 -0
- package/dist/tools/export-tools.js.map +1 -0
- package/dist/tools/extraction-tools.js.map +1 -1
- package/dist/tools/helpers.d.ts +0 -3
- package/dist/tools/helpers.js +0 -3
- package/dist/tools/helpers.js.map +1 -1
- package/dist/tools/lint-review-tools.js +13 -4
- package/dist/tools/lint-review-tools.js.map +1 -1
- package/dist/tools/mvu-variable-tools.d.ts +2 -0
- package/dist/tools/mvu-variable-tools.js +112 -0
- package/dist/tools/mvu-variable-tools.js.map +1 -0
- package/dist/{resources/usage-resources.d.ts → tools/plan-tools.d.ts} +1 -1
- package/dist/tools/plan-tools.js +69 -0
- package/dist/tools/plan-tools.js.map +1 -0
- package/dist/tools/project-tools.js +45 -10
- package/dist/tools/project-tools.js.map +1 -1
- package/dist/tools/register.js +8 -6
- package/dist/tools/register.js.map +1 -1
- package/dist/utils/json.d.ts +1 -4
- package/dist/utils/json.js +21 -7
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/strings.d.ts +1 -0
- package/dist/utils/strings.js +4 -0
- package/dist/utils/strings.js.map +1 -0
- package/dist/utils/yaml-xml.d.ts +32 -0
- package/dist/utils/yaml-xml.js +108 -0
- package/dist/utils/yaml-xml.js.map +1 -0
- package/package.json +1 -1
- package/dist/core/character-card-patch.d.ts +0 -16
- package/dist/core/character-card-patch.js +0 -59
- package/dist/core/character-card-patch.js.map +0 -1
- package/dist/core/character-templates.d.ts +0 -29
- package/dist/core/character-templates.js +0 -60
- package/dist/core/character-templates.js.map +0 -1
- package/dist/core/ejs-phase-plan.d.ts +0 -27
- package/dist/core/ejs-phase-plan.js +0 -77
- package/dist/core/ejs-phase-plan.js.map +0 -1
- package/dist/core/ejs-template.d.ts +0 -10
- package/dist/core/ejs-template.js +0 -70
- package/dist/core/ejs-template.js.map +0 -1
- package/dist/core/greeting-validator.d.ts +0 -17
- package/dist/core/greeting-validator.js +0 -79
- package/dist/core/greeting-validator.js.map +0 -1
- package/dist/core/html-regex-pair.d.ts +0 -18
- package/dist/core/html-regex-pair.js +0 -77
- package/dist/core/html-regex-pair.js.map +0 -1
- package/dist/core/item-entry-validator.d.ts +0 -10
- package/dist/core/item-entry-validator.js +0 -27
- package/dist/core/item-entry-validator.js.map +0 -1
- package/dist/core/regex-validator.d.ts +0 -13
- package/dist/core/regex-validator.js +0 -41
- package/dist/core/regex-validator.js.map +0 -1
- package/dist/core/worldbook-entry-factory.d.ts +0 -28
- package/dist/core/worldbook-entry-factory.js +0 -82
- package/dist/core/worldbook-entry-factory.js.map +0 -1
- package/dist/core/worldbook-patch.d.ts +0 -23
- package/dist/core/worldbook-patch.js +0 -111
- package/dist/core/worldbook-patch.js.map +0 -1
- package/dist/core/worldbook-planning.d.ts +0 -50
- package/dist/core/worldbook-planning.js +0 -74
- package/dist/core/worldbook-planning.js.map +0 -1
- package/dist/resources/usage-resources.js +0 -15
- package/dist/resources/usage-resources.js.map +0 -1
- package/dist/schemas/worldbook-patch.d.ts +0 -878
- package/dist/schemas/worldbook-patch.js +0 -92
- package/dist/schemas/worldbook-patch.js.map +0 -1
- package/dist/tools/character-card-tools.d.ts +0 -2
- package/dist/tools/character-card-tools.js +0 -240
- package/dist/tools/character-card-tools.js.map +0 -1
- package/dist/tools/mvu-html-ejs-tools.js +0 -233
- package/dist/tools/mvu-html-ejs-tools.js.map +0 -1
- package/dist/tools/worldbook-tools.js +0 -346
- package/dist/tools/worldbook-tools.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,192 +1,152 @@
|
|
|
1
1
|
# world-book-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server for creating, modifying, validating, and exporting SillyTavern World Book JSON and `chara_card_v3` character card JSON.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Architecture
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The project consists of two layers:
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
```text
|
|
10
|
+
┌─────────────────────────────────────────────────────────┐
|
|
11
|
+
│ Skill Layer (skill/world-book-mcp-skill/) │
|
|
12
|
+
│ Creative methodology: guides AI on worldbuilding, │
|
|
13
|
+
│ character design, style extraction, derivative │
|
|
14
|
+
│ extraction from novels/web resources, first messages │
|
|
15
|
+
│ Output: high-quality structured content │
|
|
16
|
+
└────────────────────────────┬────────────────────────────┘
|
|
17
|
+
│ AI calls MCP tools to write drafts
|
|
18
|
+
┌────────────────────────────▼────────────────────────────┐
|
|
19
|
+
│ MCP Layer (src/) │
|
|
20
|
+
│ Engineering orchestrator: manages draft slices, │
|
|
21
|
+
│ validates consistency, builds MVU/EJS/HTML assets, │
|
|
22
|
+
│ exports SillyTavern JSON │
|
|
23
|
+
│ Output: ready-to-import SillyTavern JSON files │
|
|
24
|
+
└─────────────────────────────────────────────────────────┘
|
|
18
25
|
```
|
|
19
26
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"@qihuang02/world-book-mcp"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
27
|
+
## Main Workflow
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
User request
|
|
31
|
+
→ init_project
|
|
32
|
+
→ update_plan (record requirements, decisions, export target)
|
|
33
|
+
→ create_draft_slice / update_draft_field(s) (write content)
|
|
34
|
+
→ validate_draft (check consistency)
|
|
35
|
+
→ build_assets (optional, preview MVU/EJS/HTML assets)
|
|
36
|
+
→ review_project / check_delivery (pre-export review)
|
|
37
|
+
→ generate_json (export)
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
## Skill Layer — Creative Methodology
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
[mcp_servers.world-book-mcp]
|
|
41
|
-
type = "stdio"
|
|
42
|
-
command = "npx"
|
|
43
|
-
args = ["-y", "@qihuang02/world-book-mcp"]
|
|
44
|
-
# startup_timeout_sec = 60000.0
|
|
45
|
-
```
|
|
42
|
+
`skill/world-book-mcp-skill/` contains reference documents that guide AI content creation:
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
| Document | Content |
|
|
45
|
+
|----------|---------|
|
|
46
|
+
| `worldbuilding-methodology.md` | World design: A/B/C type classification, dimension selection, zero-degree writing |
|
|
47
|
+
| `character-creation.md` | Character design: XML+YAML structure, personality palette, tri-faceted method |
|
|
48
|
+
| `derivative-extraction.md` | Derivative extraction: systematic extraction from novels/web resources |
|
|
49
|
+
| `style-extraction-guide.md` | Style extraction: analyze source material and produce style/forbidden-word entries |
|
|
50
|
+
| `rephrase-guide.md` | Rephrase: author's deep annotations to prevent AI misinterpretation |
|
|
51
|
+
| `content-rules.md` | Content rules: forbidden words, specificity, fourth wall |
|
|
52
|
+
| `first-message.md` | First message rules: hooks, plot momentum, interaction points |
|
|
53
|
+
| `composition.md` | Entry composition: blue/green light, position, order |
|
|
54
|
+
| `requirements.md` | Requirements alignment: user decision flow |
|
|
55
|
+
| `tool-reference.md` | MCP tool parameter quick reference |
|
|
48
56
|
|
|
49
|
-
|
|
57
|
+
## MCP Layer — Engineering Orchestration
|
|
50
58
|
|
|
51
|
-
|
|
52
|
-
- Creating information extraction outlines.
|
|
53
|
-
- Submitting structured extraction results prepared by the host AI.
|
|
54
|
-
- Creating explicit World Book entry plans from caller-provided card type, characters, world sections, items, scenes, and events.
|
|
55
|
-
- Scanning forbidden terms and common writing issues.
|
|
56
|
-
- Creating `.worldbook/draft/*.json` slice templates first, then updating them field by field, confirming completeness, and merging them into exported JSON.
|
|
57
|
-
- Exporting standalone SillyTavern World Book JSON.
|
|
58
|
-
- Importing existing World Book JSON by slicing it into `.worldbook/draft/*.json`, then applying safe patches / merged exports.
|
|
59
|
-
- Generating basic character card JSON that can embed the project World Book draft; when exporting a character card, the basic settings and personality settings of the same character are merged into the same embedded World Book entry.
|
|
60
|
-
- MVU/ZOD configuration templates, validation, and asset building, with automatic merging into character card JSON.
|
|
61
|
-
- HTML beautification configuration templates, validation, and asset building, with automatic merging into character card JSON.
|
|
62
|
-
- EJS dynamic content configuration templates, validation, and entry building, with automatic merging into the embedded World Book of a character card.
|
|
63
|
-
- Querying exported World Book JSON and character card JSON.
|
|
64
|
-
- Importing existing character card JSON, slicing the embedded World Book into draft entries, and applying patches to profile fields or embedded World Book entries.
|
|
59
|
+
### Workspace Structure
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
- Built-in web search.
|
|
61
|
+
`init_project` creates:
|
|
68
62
|
|
|
69
|
-
|
|
63
|
+
```text
|
|
64
|
+
.worldbook/
|
|
65
|
+
project.json
|
|
66
|
+
plan.md
|
|
67
|
+
logs/
|
|
68
|
+
draft/
|
|
69
|
+
worldbook/
|
|
70
|
+
character-card/
|
|
71
|
+
mvu/
|
|
72
|
+
html/
|
|
73
|
+
ejs/
|
|
74
|
+
style/
|
|
75
|
+
chapter/
|
|
76
|
+
```
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
It scans existing SillyTavern JSON files in the current directory and slices World Book entries, character card profile, greetings, MVU, HTML, EJS, and regex assets into draft files.
|
|
79
|
+
|
|
80
|
+
### Core Tools
|
|
81
|
+
|
|
82
|
+
| Tool | Purpose |
|
|
83
|
+
|------|---------|
|
|
84
|
+
| `init_project` | Initialize `.worldbook/`, scan and slice existing Tavern JSON |
|
|
85
|
+
| `update_plan` | Write requirements, decisions, export target to `.worldbook/plan.md` |
|
|
86
|
+
| `create_draft_slice` | Create a draft slice |
|
|
87
|
+
| `update_draft_field` / `update_draft_fields` | Update draft fields |
|
|
88
|
+
| `validate_draft` | Validate World Book, character card, MVU, EJS, HTML drafts |
|
|
89
|
+
| `build_assets` | Preview assets that will be merged into a character card |
|
|
90
|
+
| `review_project` / `check_delivery` | Pre-export review and blocking checks |
|
|
91
|
+
| `generate_json` | Export World Book JSON, character card JSON, or both |
|
|
92
|
+
| `query_json` | Query exported JSON |
|
|
93
|
+
|
|
94
|
+
### MVU Variable Tools
|
|
95
|
+
|
|
96
|
+
| Tool | Purpose |
|
|
97
|
+
|------|---------|
|
|
98
|
+
| `list_mvu_variables` | List variables in the schema |
|
|
99
|
+
| `upsert_mvu_variable` | Add or modify a variable |
|
|
100
|
+
| `remove_mvu_variable` | Remove a variable |
|
|
101
|
+
| `rewrite_mvu_variables` | Batch rewrite variables |
|
|
102
|
+
|
|
103
|
+
### Review & Lint Tools
|
|
104
|
+
|
|
105
|
+
| Tool | Purpose |
|
|
106
|
+
|------|---------|
|
|
107
|
+
| `lint_worldbook_content` | Run forbidden-word/specificity lint on text |
|
|
108
|
+
| `lint_project_content` | Run lint on the entire project |
|
|
109
|
+
| `create_writing_optimization_report` | Generate a writing optimization report |
|
|
110
|
+
|
|
111
|
+
### Draft Types
|
|
112
|
+
|
|
113
|
+
- `worldbook_entry` — World Book entry
|
|
114
|
+
- `character_profile` — Character card profile
|
|
115
|
+
- `character_greetings` — First messages / alternate greetings
|
|
116
|
+
- `mvu_schema` — MVU ZOD schema
|
|
117
|
+
- `mvu_update_rules` — MVU initvar + update_rules
|
|
118
|
+
- `html_statusbar` — HTML status bar
|
|
119
|
+
- `html_regex` — HTML regex scripts
|
|
120
|
+
- `ejs_entry` — EJS dynamic entries
|
|
121
|
+
- `style_profile` — Style configuration
|
|
122
|
+
- `chapter_outline` — Chapter outline
|
|
123
|
+
|
|
124
|
+
## Modifying Existing JSON
|
|
72
125
|
|
|
73
126
|
```text
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
│ └─ 角色B_性格.json
|
|
81
|
-
└─ <exported world book or character card>.json
|
|
127
|
+
init_project(scan_existing=true, import_strategy="auto")
|
|
128
|
+
→ list_draft_slices / get_draft_slice
|
|
129
|
+
→ update_plan
|
|
130
|
+
→ update_draft_field(s)
|
|
131
|
+
→ validate_draft
|
|
132
|
+
→ generate_json
|
|
82
133
|
```
|
|
83
134
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"secondaryKeys": [],
|
|
92
|
-
"content": "...",
|
|
93
|
-
"constant": true,
|
|
94
|
-
"position": "before_char",
|
|
95
|
-
"order": 1,
|
|
96
|
-
"enabled": true,
|
|
97
|
-
"preventRecursion": true,
|
|
98
|
-
"excludeRecursion": true
|
|
99
|
-
}
|
|
135
|
+
## Logs
|
|
136
|
+
|
|
137
|
+
MCP silently records tool-call summaries in:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
.worldbook/logs/latest.jsonl
|
|
141
|
+
.worldbook/logs/<session>.jsonl
|
|
100
142
|
```
|
|
101
143
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Patch `match.uid` first matches the `sourceUid` preserved from an imported World Book, so it targets the original SillyTavern entry uid. For newly created drafts without `sourceUid`, prefer `index` or a unique `comment` to avoid confusing uid with the regenerated contiguous export index.
|
|
113
|
-
|
|
114
|
-
## Tools Overview
|
|
115
|
-
|
|
116
|
-
Task routing, workflow choice, and clarification strategy are handled by the bundled `skill/world-book-mcp-skill/` documentation rather than MCP tools.
|
|
117
|
-
|
|
118
|
-
| Category | Tool | Description |
|
|
119
|
-
| --- | --- | --- |
|
|
120
|
-
| Workflow, Projects, and Specs | `init_project` | Initializes `.worldbook/project.json` and `.worldbook/draft/`; safely creates a root template JSON when no Tavern-format JSON exists; existing projects can be reused or overwritten with `if_exists`. |
|
|
121
|
-
| Workflow, Projects, and Specs | `list_projects` | Returns the current `.worldbook/project.json` workspace project, or an empty list if no workspace exists. |
|
|
122
|
-
| Workflow, Projects, and Specs | `get_project` | Views project details or a summary. |
|
|
123
|
-
| Workflow, Projects, and Specs | `lint_worldbook_content` | Scans forbidden terms and common writing issues. |
|
|
124
|
-
| Extraction | `create_extraction_outline` | Creates an extraction template for characters, worldbuilding, items, and events. |
|
|
125
|
-
| Extraction | `submit_extraction_result` | Submits structured facts extracted by the main AI. |
|
|
126
|
-
| World Book Building | `create_worldbook_entry_plan` | Creates an explicit entry plan from caller-provided card type, characters, world sections, items, scenes, and events. |
|
|
127
|
-
| World Book Building | `validate_worldbook_entry_plan` | Validates an explicit entry plan's position, order, and keyword-trigger rules. |
|
|
128
|
-
| World Book Building | `create_worldbook_draft_entry` | Creates one `.worldbook/draft/*.json` slice template. |
|
|
129
|
-
| World Book Building | `create_worldbook_draft_entries` | Creates multiple slice templates. |
|
|
130
|
-
| World Book Building | `update_worldbook_draft_field` | Locates a draft by comment and updates one field. |
|
|
131
|
-
| World Book Building | `update_worldbook_draft_fields` | Updates a small set of draft fields at once. |
|
|
132
|
-
| World Book Building | `confirm_worldbook_draft_complete` | Confirms all drafts are complete and ready to merge/export. |
|
|
133
|
-
| World Book Building | `list_worldbook_draft_entries` | Lists `.worldbook/draft/*.json` split draft entries. |
|
|
134
|
-
| World Book Building | `get_worldbook_draft_entry` | Reads one split draft entry by comment. |
|
|
135
|
-
| World Book Building | `delete_worldbook_draft_entry` | Deletes one split draft entry by comment. |
|
|
136
|
-
| World Book Building | `validate_worldbook_draft` | Validates draft configuration and content issues. |
|
|
137
|
-
| World Book Building | `generate_worldbook_json` | Exports SillyTavern World Book JSON. |
|
|
138
|
-
| Character Card | `import_character_card_json` | Imports an existing `chara_card_v3` JSON in the current directory and extracts profile plus embedded World Book draft. |
|
|
139
|
-
| Character Card | `upsert_character_profile` | Creates or updates character card profile configuration through simplified fields; MCP automatically fills default `chara_card_v3` fields. |
|
|
140
|
-
| Character Card | `validate_character_card_config` | Validates character card configuration and the embedded World Book. |
|
|
141
|
-
| Character Card | `confirm_character_card_draft_complete` | Confirms character-card profile, embedded World Book drafts, and assets are ready to merge/export. |
|
|
142
|
-
| Character Card | `generate_character_card_json` | Exports `chara_card_v3` character card JSON; `character_basic` and `character_personality` for the same character are merged into the same embedded World Book entry. |
|
|
143
|
-
| Character Card | `create_character_card_patch` | Creates a patch plan for profile, worldbook config, or embedded World Book entries. |
|
|
144
|
-
| Character Card | `preview_character_card_patch` | Previews character card patch diffs and validation. |
|
|
145
|
-
| Character Card | `apply_character_card_patch` | Applies a character card patch, safely exports JSON, and updates the project. |
|
|
146
|
-
| Character Card | `query_character_card` | Queries the character card summary, greetings, or embedded World Book entries. |
|
|
147
|
-
| MVU / ZOD | `create_mvu_schema_template` | Creates an MVU/ZOD variable system configuration template. |
|
|
148
|
-
| MVU / ZOD | `upsert_mvu_schema` | Partially updates MVU schema and variable path. |
|
|
149
|
-
| MVU / ZOD | `upsert_mvu_update_rules` | Partially updates MVU initvar and update rules. |
|
|
150
|
-
| MVU / ZOD | `submit_mvu_config` | Advanced entry: saves the full MVU configuration. |
|
|
151
|
-
| MVU / ZOD | `validate_mvu_config` | Validates ZOD schema, initvar, update_rules, and greeting placeholders. |
|
|
152
|
-
| MVU / ZOD | `build_mvu_assets` | Previews World Book entries, regex scripts, and Tavern Helper scripts that will be merged into the character card. |
|
|
153
|
-
| HTML Beautification | `create_html_beautify_template` | Creates a status-bar or global HTML beautification configuration template. |
|
|
154
|
-
| HTML Beautification | `upsert_html_statusbar` | Partially updates statusbar HTML, theme, and switches. |
|
|
155
|
-
| HTML Beautification | `submit_html_beautify_config` | Advanced entry: saves the full HTML beautification configuration. |
|
|
156
|
-
| HTML Beautification | `validate_html_beautify_config` | Validates HTML, CSS scope, regex configuration, and greeting placeholders. |
|
|
157
|
-
| HTML Beautification | `build_html_beautify_assets` | Previews regex scripts that will be merged into the character card. |
|
|
158
|
-
| EJS Dynamic Content | `create_ejs_template` | Creates a staged character profile, palette, or custom EJS template. |
|
|
159
|
-
| EJS Dynamic Content | `upsert_ejs_entry` | Partially adds or updates one EJS entry by name. |
|
|
160
|
-
| EJS Dynamic Content | `submit_ejs_config` | Advanced entry: saves the full EJS configuration. |
|
|
161
|
-
| EJS Dynamic Content | `validate_ejs_config` | Validates MVU dependencies, variable paths, EJS tags, getwi references, and entry status. |
|
|
162
|
-
| EJS Dynamic Content | `build_ejs_entries` | Previews EJS entries that will be merged into the embedded World Book of a character card. |
|
|
163
|
-
| Query and Patch | `query_worldbook` | Queries existing World Book JSON, supporting `brief`, `uid`, `search`, and `stats`. |
|
|
164
|
-
| Query and Patch | `import_worldbook_json` | Imports an existing World Book JSON in the current working directory as an MCP project draft. |
|
|
165
|
-
| Query and Patch | `create_worldbook_patch` | Creates a modification plan without directly writing files. |
|
|
166
|
-
| Query and Patch | `preview_worldbook_patch` | Previews the patch diff and validation results. |
|
|
167
|
-
| Query and Patch | `apply_worldbook_patch` | Applies a patch, validates it automatically, and can back up and export a new JSON. |
|
|
168
|
-
|
|
169
|
-
## Skill
|
|
170
|
-
|
|
171
|
-
This repository includes a standard Claude Code Skill named `world-book-mcp-skill` at [`skill/world-book-mcp-skill/`](skill/world-book-mcp-skill/). It is a directory package containing `SKILL.md` and `references/`, used to guide AI in correctly orchestrating all tools of this MCP server when users request World Book or character card related tasks. The skill name is intentionally distinct from the MCP server name `world-book-mcp` to avoid confusion in agent tooling.
|
|
172
|
-
|
|
173
|
-
## Future Capability Extensions
|
|
174
|
-
|
|
175
|
-
The following capabilities are not implemented yet and are only references for the future roadmap:
|
|
176
|
-
|
|
177
|
-
- Cross-project template reuse: derive a World Book or character card template from one project and apply it to a new project.
|
|
178
|
-
- World Book entry cross-reference graph: analyze keys and secondaryKeys to output entry trigger dependency graphs.
|
|
179
|
-
- Multilingual lint dictionaries: pluggable forbidden-term lists with support for English, Japanese, and more.
|
|
180
|
-
- Character relationship graph export: generate relationship graph JSON from `character_basic` relationship fields.
|
|
181
|
-
- Embedded World Book conflict detection: detect duplicate keys or orders when merging character cards and project World Books.
|
|
182
|
-
- Decision template library: common ambiguity templates such as card type, world type, and style can be referenced by tools.
|
|
183
|
-
- Worldbook diff tool: compare two SillyTavern JSON files.
|
|
184
|
-
- ChatLog extraction: extract character behavior evidence from a dialogue history.
|
|
185
|
-
- Automatic entry reordering: automatically resolve conflicts based on position and order rules.
|
|
186
|
-
- Status-bar HTML AST validation: perform stricter safety checks with a lightweight HTML parser.
|
|
187
|
-
- Multi-character-card collaboration: maintain multiple character card configs in one project and switch exports as needed.
|
|
188
|
-
- Worldbook asset signing: attach version and signature data during JSON export for traceability.
|
|
189
|
-
|
|
190
|
-
## License
|
|
191
|
-
|
|
192
|
-
MIT
|
|
144
|
+
Long text fields are summarized with preview, length, and hash.
|
|
145
|
+
|
|
146
|
+
## Development
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npm install
|
|
150
|
+
npm run typecheck
|
|
151
|
+
npm test
|
|
152
|
+
```
|
package/README_ZH.md
CHANGED
|
@@ -1,192 +1,150 @@
|
|
|
1
1
|
# world-book-mcp
|
|
2
2
|
|
|
3
|
-
`world-book-mcp`
|
|
3
|
+
`world-book-mcp` 是一个 MCP server,用于创建、修改、校验和导出 SillyTavern 世界书 JSON 与 `chara_card_v3` 角色卡 JSON。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 架构
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
项目由两层组成:
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
```text
|
|
10
|
+
┌─────────────────────────────────────────────────────┐
|
|
11
|
+
│ Skill 层(skill/world-book-mcp-skill/) │
|
|
12
|
+
│ 创作方法论:指导 AI 如何设计世界观、写角色、 │
|
|
13
|
+
│ 提取文风、从小说/网络资源中抽取信息、写开场白 │
|
|
14
|
+
│ 产出:高质量的结构化语料 │
|
|
15
|
+
└──────────────────────────┬──────────────────────────┘
|
|
16
|
+
│ AI 调用 MCP 工具写入 draft
|
|
17
|
+
┌──────────────────────────▼──────────────────────────┐
|
|
18
|
+
│ MCP 层(src/) │
|
|
19
|
+
│ 工程编排器:管理 draft 切片、校验一致性、 │
|
|
20
|
+
│ 构建 MVU/EJS/HTML 资产、导出酒馆 JSON │
|
|
21
|
+
│ 产出:可直接导入 SillyTavern 的 JSON 文件 │
|
|
22
|
+
└─────────────────────────────────────────────────────┘
|
|
18
23
|
```
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"@qihuang02/world-book-mcp"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
25
|
+
## 主线工作流
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
用户需求
|
|
29
|
+
→ init_project
|
|
30
|
+
→ update_plan(记录需求、决策、导出目标)
|
|
31
|
+
→ create_draft_slice / update_draft_field(s)(写入语料)
|
|
32
|
+
→ validate_draft(校验一致性)
|
|
33
|
+
→ build_assets(可选,预览 MVU/EJS/HTML 资产)
|
|
34
|
+
→ review_project / check_delivery(交付前审查)
|
|
35
|
+
→ generate_json(导出)
|
|
35
36
|
```
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
## Skill 层 — 创作方法论
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
[mcp_servers.world-book-mcp]
|
|
41
|
-
type = "stdio"
|
|
42
|
-
command = "npx"
|
|
43
|
-
args = ["-y", "@qihuang02/world-book-mcp"]
|
|
44
|
-
# startup_timeout_sec = 60000.0
|
|
45
|
-
```
|
|
40
|
+
`skill/world-book-mcp-skill/` 包含指导 AI 创作的 reference 文档:
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
| 文档 | 内容 |
|
|
43
|
+
|------|------|
|
|
44
|
+
| `worldbuilding-methodology.md` | 世界观设计:A/B/C 类型判定、维度取舍、总纲零度写作 |
|
|
45
|
+
| `character-creation.md` | 角色设定:XML+YAML 结构、性格调色盘、三面性、开场白 |
|
|
46
|
+
| `derivative-extraction.md` | 二创提取:从小说/网络资源系统性提取角色、世界观、事件 |
|
|
47
|
+
| `style-extraction-guide.md` | 文风提取:分析源材料风格并转化为风格条目和禁词条目 |
|
|
48
|
+
| `rephrase-guide.md` | 二次解释:作者对角色深层逻辑的注释,防止 AI 误解 |
|
|
49
|
+
| `content-rules.md` | 内容规则:禁词、具体性、第四面墙 |
|
|
50
|
+
| `first-message.md` | 开场白规则:吸引力、剧情动力、互动点 |
|
|
51
|
+
| `composition.md` | 条目编排:蓝绿灯、position、order |
|
|
52
|
+
| `requirements.md` | 需求对齐:用户决策流程 |
|
|
53
|
+
| `tool-reference.md` | MCP 工具参数速查 |
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
## MCP 层 — 工程编排
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
- 创建信息提取 outline。
|
|
53
|
-
- 提交由宿主 AI 整理好的结构化提取结果。
|
|
54
|
-
- 根据调用方显式提供的卡型、角色、世界分区、物品、场景和事件创建世界书条目规划。
|
|
55
|
-
- 扫描禁词与常见写作问题。
|
|
56
|
-
- 先创建 `.worldbook/draft/*.json` 切片模板,再逐字段更新、确认完整并合并导出,避免 AI 一次提交完整条目对象。
|
|
57
|
-
- 导出独立 SillyTavern 世界书 JSON。
|
|
58
|
-
- 导入已有世界书 JSON,先切片为 `.worldbook/draft/*.json`,再进行安全 patch / 合并导出。
|
|
59
|
-
- 基础角色卡 JSON 生成,可嵌入项目世界书 draft;导出角色卡时同一角色的基础设定和性格设定会聚合为同一个内嵌世界书条目。
|
|
60
|
-
- MVU/ZOD 配置模板、校验、资产构建,并可自动合并进角色卡 JSON。
|
|
61
|
-
- HTML 美化配置模板、校验、资产构建,并可自动合并进角色卡 JSON。
|
|
62
|
-
- EJS 动态内容配置模板、校验、entries 构建,并可自动合并进角色卡内嵌世界书。
|
|
63
|
-
- 查询导出的世界书 JSON 和角色卡 JSON。
|
|
64
|
-
- 导入已有角色卡 JSON,将内嵌世界书切片为 draft,并通过 patch 修改角色卡字段或内嵌世界书条目。
|
|
57
|
+
### 工作区结构
|
|
65
58
|
|
|
66
|
-
|
|
67
|
-
- 内置网页搜索。
|
|
59
|
+
`init_project` 创建:
|
|
68
60
|
|
|
69
|
-
|
|
61
|
+
```text
|
|
62
|
+
.worldbook/
|
|
63
|
+
project.json
|
|
64
|
+
plan.md
|
|
65
|
+
logs/
|
|
66
|
+
draft/
|
|
67
|
+
worldbook/
|
|
68
|
+
character-card/
|
|
69
|
+
mvu/
|
|
70
|
+
html/
|
|
71
|
+
ejs/
|
|
72
|
+
style/
|
|
73
|
+
chapter/
|
|
74
|
+
```
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
自动扫描当前目录下的 SillyTavern JSON 文件,将世界书条目、角色卡 profile、greetings、MVU、HTML、EJS 等资产切片到 draft 目录。
|
|
77
|
+
|
|
78
|
+
### 核心工具
|
|
79
|
+
|
|
80
|
+
| 工具 | 用途 |
|
|
81
|
+
|------|------|
|
|
82
|
+
| `init_project` | 初始化 `.worldbook/`,扫描并切片已有酒馆 JSON |
|
|
83
|
+
| `update_plan` | 写入需求、决策、导出目标到 `.worldbook/plan.md` |
|
|
84
|
+
| `create_draft_slice` | 创建 draft 切片 |
|
|
85
|
+
| `update_draft_field` / `update_draft_fields` | 更新 draft 字段 |
|
|
86
|
+
| `validate_draft` | 校验世界书、角色卡、MVU、EJS、HTML 等 |
|
|
87
|
+
| `build_assets` | 预览将合并到角色卡的资产 |
|
|
88
|
+
| `review_project` / `check_delivery` | 交付前审查与阻塞检查 |
|
|
89
|
+
| `generate_json` | 导出世界书 JSON、角色卡 JSON 或两者 |
|
|
90
|
+
| `query_json` | 查询已导出的 JSON |
|
|
91
|
+
|
|
92
|
+
### MVU 变量工具
|
|
93
|
+
|
|
94
|
+
| 工具 | 用途 |
|
|
95
|
+
|------|------|
|
|
96
|
+
| `list_mvu_variables` | 列出 schema 中的变量 |
|
|
97
|
+
| `upsert_mvu_variable` | 新增/修改变量 |
|
|
98
|
+
| `remove_mvu_variable` | 删除变量 |
|
|
99
|
+
| `rewrite_mvu_variables` | 批量重写变量 |
|
|
100
|
+
|
|
101
|
+
### 审查与 lint 工具
|
|
102
|
+
|
|
103
|
+
| 工具 | 用途 |
|
|
104
|
+
|------|------|
|
|
105
|
+
| `lint_worldbook_content` | 对文本执行禁词/具体性 lint |
|
|
106
|
+
| `lint_project_content` | 对整个项目执行 lint |
|
|
107
|
+
| `create_writing_optimization_report` | 写作优化报告 |
|
|
108
|
+
|
|
109
|
+
### Draft 类型
|
|
110
|
+
|
|
111
|
+
- `worldbook_entry` — 世界书条目
|
|
112
|
+
- `character_profile` — 角色卡 profile
|
|
113
|
+
- `character_greetings` — 开场白
|
|
114
|
+
- `mvu_schema` — MVU ZOD schema
|
|
115
|
+
- `mvu_update_rules` — MVU initvar + update_rules
|
|
116
|
+
- `html_statusbar` — HTML 状态栏
|
|
117
|
+
- `html_regex` — HTML 正则脚本
|
|
118
|
+
- `ejs_entry` — EJS 动态条目
|
|
119
|
+
- `style_profile` — 文风配置
|
|
120
|
+
- `chapter_outline` — 章节大纲
|
|
121
|
+
|
|
122
|
+
## 修改已有 JSON
|
|
72
123
|
|
|
73
124
|
```text
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
│ └─ 角色B_性格.json
|
|
81
|
-
└─ <导出的世界书或角色卡>.json
|
|
125
|
+
init_project(scan_existing=true, import_strategy="auto")
|
|
126
|
+
→ list_draft_slices / get_draft_slice
|
|
127
|
+
→ update_plan
|
|
128
|
+
→ update_draft_field(s)
|
|
129
|
+
→ validate_draft
|
|
130
|
+
→ generate_json
|
|
82
131
|
```
|
|
83
132
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"secondaryKeys": [],
|
|
92
|
-
"content": "...",
|
|
93
|
-
"constant": true,
|
|
94
|
-
"position": "before_char",
|
|
95
|
-
"order": 1,
|
|
96
|
-
"enabled": true,
|
|
97
|
-
"preventRecursion": true,
|
|
98
|
-
"excludeRecursion": true
|
|
99
|
-
}
|
|
133
|
+
## 日志
|
|
134
|
+
|
|
135
|
+
MCP 静默记录工具调用摘要:
|
|
136
|
+
|
|
137
|
+
```text
|
|
138
|
+
.worldbook/logs/latest.jsonl
|
|
139
|
+
.worldbook/logs/<session>.jsonl
|
|
100
140
|
```
|
|
101
141
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
patch 的 `match.uid` 优先匹配从已导入世界书保留的 `sourceUid`,用于定位原始 SillyTavern 条目 uid。对没有 `sourceUid` 的新建草稿,建议使用 `index` 或唯一 `comment` 定位,避免把 uid 误当作导出后的连续下标。
|
|
113
|
-
|
|
114
|
-
## Tools 一览
|
|
115
|
-
|
|
116
|
-
任务分类、工作流选择和澄清策略由随包 `skill/world-book-mcp-skill/` 文档指导,不再作为 MCP tools 暴露。
|
|
117
|
-
|
|
118
|
-
| 分类 | Tool | 说明 |
|
|
119
|
-
| --- | --- | --- |
|
|
120
|
-
| 工作流、项目与规范 | `init_project` | 初始化 `.worldbook/project.json` 与 `.worldbook/draft/`;若根目录没有酒馆格式 JSON,会安全创建模板 JSON;已有项目可用 `if_exists` 控制复用或覆盖。 |
|
|
121
|
-
| 工作流、项目与规范 | `list_projects` | 返回当前 `.worldbook/project.json` 工作区项目;未初始化时返回空列表。 |
|
|
122
|
-
| 工作流、项目与规范 | `get_project` | 查看项目详情或摘要。 |
|
|
123
|
-
| 工作流、项目与规范 | `lint_worldbook_content` | 扫描禁词和常见写作问题。 |
|
|
124
|
-
| 提取 | `create_extraction_outline` | 创建角色、世界观、物品、事件的提取模板。 |
|
|
125
|
-
| 提取 | `submit_extraction_result` | 提交主 AI 提取好的结构化事实。 |
|
|
126
|
-
| 世界书构建 | `create_worldbook_entry_plan` | 根据调用方显式提供的卡型、角色、世界分区、物品、场景和事件创建条目规划。 |
|
|
127
|
-
| 世界书构建 | `validate_worldbook_entry_plan` | 校验显式条目规划的 position、order 和关键词触发规则。 |
|
|
128
|
-
| 世界书构建 | `create_worldbook_draft_entry` | 创建单个 `.worldbook/draft/*.json` 切片模板。 |
|
|
129
|
-
| 世界书构建 | `create_worldbook_draft_entries` | 批量创建切片模板。 |
|
|
130
|
-
| 世界书构建 | `update_worldbook_draft_field` | 按 comment 定位并逐字段更新 draft。 |
|
|
131
|
-
| 世界书构建 | `update_worldbook_draft_fields` | 一次更新少量 draft 字段。 |
|
|
132
|
-
| 世界书构建 | `confirm_worldbook_draft_complete` | 确认所有 draft 完整且可合并导出。 |
|
|
133
|
-
| 世界书构建 | `list_worldbook_draft_entries` | 列出 `.worldbook/draft/*.json` 分片草稿。 |
|
|
134
|
-
| 世界书构建 | `get_worldbook_draft_entry` | 按 comment 读取单个分片草稿。 |
|
|
135
|
-
| 世界书构建 | `delete_worldbook_draft_entry` | 按 comment 删除单个分片草稿。 |
|
|
136
|
-
| 世界书构建 | `validate_worldbook_draft` | 校验草稿配置和内容问题。 |
|
|
137
|
-
| 世界书构建 | `generate_worldbook_json` | 导出 SillyTavern 世界书 JSON。 |
|
|
138
|
-
| 角色卡 | `import_character_card_json` | 导入当前目录内已有 `chara_card_v3` 角色卡 JSON,提取 profile 与内嵌世界书 draft。 |
|
|
139
|
-
| 角色卡 | `upsert_character_profile` | 用简化字段创建/更新角色卡人设配置,MCP 自动补齐 `chara_card_v3` 默认字段。 |
|
|
140
|
-
| 角色卡 | `validate_character_card_config` | 校验角色卡配置和嵌入世界书。 |
|
|
141
|
-
| 角色卡 | `confirm_character_card_draft_complete` | 确认角色卡 profile、内嵌世界书 draft 与资产可合并导出。 |
|
|
142
|
-
| 角色卡 | `generate_character_card_json` | 导出 `chara_card_v3` 角色卡 JSON;同一角色的 `character_basic` 与 `character_personality` 会合并为同一个内嵌世界书条目。 |
|
|
143
|
-
| 角色卡 | `create_character_card_patch` | 为已有角色卡 project 创建 profile / worldbook config / 内嵌世界书修改计划。 |
|
|
144
|
-
| 角色卡 | `preview_character_card_patch` | 预览角色卡 patch diff 与校验结果。 |
|
|
145
|
-
| 角色卡 | `apply_character_card_patch` | 应用角色卡 patch,安全导出 JSON 并更新 project。 |
|
|
146
|
-
| 角色卡 | `query_character_card` | 查询角色卡概要、开场白或内嵌世界书条目。 |
|
|
147
|
-
| MVU / ZOD | `create_mvu_schema_template` | 创建 MVU/ZOD 变量系统配置模板。 |
|
|
148
|
-
| MVU / ZOD | `upsert_mvu_schema` | 局部更新 MVU schema 与变量路径。 |
|
|
149
|
-
| MVU / ZOD | `upsert_mvu_update_rules` | 局部更新 MVU initvar 与 update_rules。 |
|
|
150
|
-
| MVU / ZOD | `submit_mvu_config` | 高级入口:保存完整 MVU 配置。 |
|
|
151
|
-
| MVU / ZOD | `validate_mvu_config` | 校验 ZOD schema、initvar、update_rules 与开场白占位符。 |
|
|
152
|
-
| MVU / ZOD | `build_mvu_assets` | 预览将合并进角色卡的世界书条目、正则脚本和 Tavern Helper 脚本。 |
|
|
153
|
-
| HTML 美化 | `create_html_beautify_template` | 创建状态栏或全局 HTML 美化配置模板。 |
|
|
154
|
-
| HTML 美化 | `upsert_html_statusbar` | 局部更新状态栏 HTML、主题和开关。 |
|
|
155
|
-
| HTML 美化 | `submit_html_beautify_config` | 高级入口:保存完整 HTML 美化配置。 |
|
|
156
|
-
| HTML 美化 | `validate_html_beautify_config` | 校验 HTML、CSS 作用域、regex 配置和开场白占位符。 |
|
|
157
|
-
| HTML 美化 | `build_html_beautify_assets` | 预览将合并进角色卡的 regex scripts。 |
|
|
158
|
-
| EJS 动态内容 | `create_ejs_template` | 创建阶段人设、调色盘或自定义 EJS 模板。 |
|
|
159
|
-
| EJS 动态内容 | `upsert_ejs_entry` | 按 name 局部新增/更新单个 EJS entry。 |
|
|
160
|
-
| EJS 动态内容 | `submit_ejs_config` | 高级入口:保存完整 EJS 配置。 |
|
|
161
|
-
| EJS 动态内容 | `validate_ejs_config` | 校验 MVU 依赖、变量路径、EJS 标签、getwi 引用和条目状态。 |
|
|
162
|
-
| EJS 动态内容 | `build_ejs_entries` | 预览将合并进角色卡内嵌世界书的 EJS entries。 |
|
|
163
|
-
| 查询与 Patch | `query_worldbook` | 查询已有世界书 JSON,支持 `brief`、`uid`、`search`、`stats`。 |
|
|
164
|
-
| 查询与 Patch | `import_worldbook_json` | 把当前工作目录内已有世界书 JSON 导入为 MCP project draft。 |
|
|
165
|
-
| 查询与 Patch | `create_worldbook_patch` | 创建修改计划,不直接写文件。 |
|
|
166
|
-
| 查询与 Patch | `preview_worldbook_patch` | 预览 patch diff 和校验结果。 |
|
|
167
|
-
| 查询与 Patch | `apply_worldbook_patch` | 应用 patch,自动校验,可备份并导出新 JSON。 |
|
|
168
|
-
|
|
169
|
-
## Skill
|
|
170
|
-
|
|
171
|
-
仓库自带一个名为 `world-book-mcp-skill` 的标准 Claude Code Skill,位于 [`skill/world-book-mcp-skill/`](skill/world-book-mcp-skill/)。它是一个 `SKILL.md` + `references/` 的目录包,用于指导 AI 在用户提出世界书 / 角色卡相关需求时,正确编排本 MCP 服务器的全部工具。skill 名称刻意区别于 MCP server 名称 `world-book-mcp`,避免在 Agent 工具中混淆。
|
|
172
|
-
|
|
173
|
-
## 未来能力扩展
|
|
174
|
-
|
|
175
|
-
以下能力暂未实现,仅作为后续路线参考:
|
|
176
|
-
|
|
177
|
-
- 跨项目模板复用:从一个项目派生世界书 / 角色卡模板,应用到新项目。
|
|
178
|
-
- 世界书条目互引图:分析 keys 与 secondaryKeys,输出条目触发依赖图。
|
|
179
|
-
- 多语言 lint 词库:可插拔禁词表,支持英文 / 日文等。
|
|
180
|
-
- 角色关系图导出:从 character_basic 关系字段生成关系图 JSON。
|
|
181
|
-
- 内嵌世界书冲突检测:在角色卡 + 项目世界书合并时检测重复 keys / order。
|
|
182
|
-
- Decision 模板库:常见歧义模板(卡型 / 世界观 / 风格)可被工具引用。
|
|
183
|
-
- Worldbook diff 工具:对比两个 SillyTavern JSON。
|
|
184
|
-
- ChatLog 抽取:从一段对话历史抽取角色行为依据。
|
|
185
|
-
- 自动条目重排:按 position+order 规则自动调整冲突。
|
|
186
|
-
- 状态栏 HTML AST 校验:基于轻量 HTML 解析做更严格的安全检查。
|
|
187
|
-
- 多 character_card 协作:在同一 project 维护多张角色卡 config 并按需切换导出。
|
|
188
|
-
- Worldbook 资产签名:导出 JSON 时附带版本与签名,便于追踪。
|
|
189
|
-
|
|
190
|
-
## 许可
|
|
191
|
-
|
|
192
|
-
MIT
|
|
142
|
+
长文本字段以 preview + length + hash 形式记录。
|
|
143
|
+
|
|
144
|
+
## 开发
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npm install
|
|
148
|
+
npm run typecheck
|
|
149
|
+
npm test
|
|
150
|
+
```
|