# [简体中文](README.md) | [English](README_EN.md)
# "Genshin Impact - Miliastra Wonderland" Node Graph Simulator MCP Server
This repository hosts an MCP server that helps AI agents create and manage
WebMiliastra node graphs and projects. It exposes graph/project tools and
bundles reference docs for the editor data model.
> [!WARNING]
> Over 90% of the content in this project is generated by AI.
## Features
- Graph tools: list, read, write, and validate `GraphDocument` Json files
- Project tools: read/write folders containing `manifest.json` and graph files
- Node index: a small sample node definition file, and a path for full data overrides
- Documentation resources exposed via MCP resources (`nodegraph://docs/...`)
## Repository Structure
- `graphs/` - Graph Json files (default target for graph tools)
- `projects/` - Project folders (each folder contains `manifest.json` and graph files)
- `docs/` - Reference documentation exposed as MCP resources
- `data/` - Node definition data (will be updated based on [data.ts](https://github.com/Wu-Yijun/Genshin-Impact-Miliastra-Wonderland-Code-Node-Editor-Pack/blob/main/utils/node_data/data.ts))
## Setup
```bash
git clone https://github.com/Columbina-Dev/WebMiliastraNodesEditor-MCPServer.git
cd WebMiliastraNodesEditor-MCPServer/
npm install
npm run build
node build/index.js
```
## Environment Variables
- `NODEGRAPH_WORKSPACE`: Document and data base workspace (default: current working directory)
- `NODEGRAPH_GRAPHS_DIR`: Graph storage folder (default: `<workspace>/graphs`)
- `NODEGRAPH_PROJECTS_DIR`: Project storage folder (default: `<workspace>/projects`)
- `NODEGRAPH_NODE_DEFS_PATH`: Path to Json node definition data
P.S.: `data/nodeDefinitions.sample.json` is a temporary test dataset. The data should be replaced with complete node definition data in the future to ensure accuracy
## MCP Configuration Example
<details>
<summary>OpenAI Codex</summary>
Use [config/.codex/config.toml](./config/.codex/config.toml)
</details>
## Notes
- Need to import more reference documentation from official editor tutorial HTML, see `docs/tutorial-plan.md`
- Currently this is a temporary test MCP server, almost unable to generate normal/usable node graphs and project files, need to improve documentation and node definition data in the future for format verification
- Same as the [main project](https://github.com/Columbina-Dev/WebMiliastraNodesEditor), this project is licensed under the GPLv3 license.