next2d-development-mcp

v1.7.5
next2d-development-mcp Checked 2 days ago Published 1 month ago

MCP server for Next2D application development assistance

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_view

Create a new View and ViewModel pair following MVVM pattern. Generates {Name}View.ts and {Name}ViewModel.ts in src/view/{name}/. View extends the framework View<ViewModel> generic class (display only, delegates to a Page component). ViewModel holds UseCases and fetches data in initialize(). Note: create the Page component first — the generated View imports it.

ParameterTypeDescription
name *stringView name (e.g. 'home', 'quest/list'). Slash-separated names create nested paths and PascalCase class names.

create_usecase

Create a new UseCase class in the Application layer. Each UseCase represents a single user action with an execute() method. Located in src/model/application/{screen}/usecase/.

ParameterTypeDescription
name *stringUseCase name (e.g. 'StartDrag', 'NavigateToView', 'FetchUserData')
screen *stringScreen/view name this UseCase belongs to (e.g. 'home', 'top')

create_repository

Create a new Repository class in the Infrastructure layer. Repositories abstract data source access (API, DB). Located in src/model/infrastructure/repository/. Must include try-catch and use config for endpoints.

ParameterTypeDescription
name *stringRepository name (e.g. 'HomeText', 'UserData', 'QuestList')
methodstringMethod name for the repository (default: 'get')

create_ui_component

Create a new UI component following Atomic Design pattern. Levels: atom (smallest), molecule (composite), organism (complex), page (full screen). Located in src/ui/component/{level}/. Also supports creating Animation Tool content wrappers in src/ui/content/.

ParameterTypeDescription
level *stringAtomic Design level: atom, molecule, organism, page, or 'content' for Animation Tool wrapper
name *stringComponent name (e.g. 'Button', 'HomeBtn', 'QuestCard')
parentClassstringParent DisplayObject class (default: 'Sprite'). Options: Sprite, MovieClip, Shape, TextField
screenstringScreen name for page-level components (e.g. 'top', 'home', 'quest'). Determines the subdirectory under page/ and the View import path. Defaults to the first segment of name.

add_route

Generate a route entry for routing.json. Supports request types: json, content, custom, cluster. The route key becomes the URL path and determines the View class name (CamelCase).

ParameterTypeDescription
path *stringRoute path (e.g. 'home', 'quest/list'). Becomes URL path and View class name in CamelCase.
isPrivatebooleanIf true, direct URL access redirects to TopView
requestsarrayArray of request configurations

create_interface

Create a TypeScript interface file with I prefix convention. Interfaces go in src/interface/ and define contracts between layers. Used for dependency inversion (View depends on interface, not concrete class).

ParameterTypeDescription
name *stringInterface name (e.g. 'Draggable', 'HomeTextResponse'). Will be prefixed with 'I' automatically if not already.
propertiesarrayInterface properties

validate_architecture

Validate that a Next2D project follows the expected architecture. Checks directory structure, config files, and naming conventions. Reports missing directories, files, and architecture violations.

ParameterTypeDescription
projectPathstringPath to the project root directory (default: current directory)

create_animation

Create a new Animation class for UI transitions. Uses Tween/Easing/Job from @next2d/ui. Naming: {Component}{Action}Animation.ts in src/ui/animation/{screen}/. Separates animation logic from components for reusability.

ParameterTypeDescription
action *stringAnimation action (e.g. 'Show', 'Exit', 'Hover')
component *stringComponent name (e.g. 'TopBtn', 'HomeCard')
screen *stringScreen this animation belongs to (e.g. 'top', 'home')

create_domain_service

Create a Domain layer class (service or callback). Services implement core business rules with no external dependencies. Callbacks are executed after gotoView completes (configured in config.json gotoView.callback). Located in src/model/domain/.

ParameterTypeDescription
name *stringFeature name (e.g. 'Background', 'Score', 'Timer')
type *stringDomain type: 'service' for business logic, 'callback' for gotoView.callback handler
actionstringAction name for service type (e.g. 'Draw', 'ChangeScale'). Not needed for callback.

create_loading

Create a Loading screen class for screen transition loading indicator. The class has start() and end() methods called by the framework during gotoView transitions. Configured in config.json loading.callback. Located in src/model/domain/callback/.

ParameterTypeDescription
namestringLoading class name (default: 'Loading')

analyze_project

Analyze the current Next2D project state. Reads routing.json, scans View/ViewModel/UseCase/Repository files, and reports what is implemented vs. missing. Use this before planning new features to understand the current state.

ParameterTypeDescription
projectPathstringPath to the project root directory (default: current directory)

plan_feature

Generate a systematic, ordered implementation plan for a new Next2D screen or feature. Checks what already exists in the project and produces step-by-step instructions with specific MCP tool calls to execute. Run analyze_project first to understand current state.

ParameterTypeDescription
screenPath *stringScreen path matching routing.json key (e.g. 'quest/list', 'home', 'settings')
hasApibooleanDoes this screen fetch data from an external API?
hasContentbooleanDoes this screen use Animation Tool (.n2d) content?
projectPathstringPath to project root directory (default: current directory)

inspect_screen

Inspect all implementation files for a specific Next2D screen. Lists View, ViewModel, Page, UseCases, Repositories, Animations, and Content related to the given screen path. Shows file existence, line counts, and routing.json configuration. Use this before modifying an existing screen to understand what is already implemented.

ParameterTypeDescription
screenPath *stringScreen path matching routing.json key (e.g. 'quest/list', 'home', 'settings')
projectPathstringPath to the project root directory (default: current directory)

validate_game_integration

Validate Next2D game integration: game board fits within stage dimensions and global stage ENTER_FRAME lifecycle.

ParameterTypeDescription
projectPathstring