Module boundaries
The backend logic lives in src/Modules, one folder per domain. The HTTP layer is in src/Http, the MCP application is in src/Mcp, and Artisan commands are in src/Console. A module never reaches into the internals of another module.
The modules
| Module | Owns |
|---|---|
| Ast | Reading host source with PhpParser. ClassQuery and MethodQuery answer questions about a class or a method. |
| Config | Reading config/nimbus.php. It resolves the active application and its environments. |
| Doctor | The setup checks behind nimbus:doctor and the doctor endpoint. |
| Export | Shareable links. |
| Extractor | Request and response schema strategies. |
| Intellisense | Generating TypeScript interfaces from backend shapes. |
| Magic | Laravel specific features such as actors, transactions, sandbox, insights and the toolbox. |
| Mcp | Actions and services behind the MCP tools, such as sending a request and storing it. |
| Relay | Sending the request, authorization handlers and response parsing. |
| Routes | Route extraction, the OpenAPI processor and the snapshot. |
| Schemas | Rules to schema, and the schema value objects. |
| Workspace | Saved request files and folders inside the host repository. |
MCP application
The MCP server is its own application in src/Mcp, next to src/Http and src/Console. It holds no business logic, and modules never import from it.
| Path | Holds |
|---|---|
src/Mcp/Servers | The server, which registers the tools, the resource and the prompts. |
src/Mcp/Domain/Tools | The tools of one domain. Resources and prompts have sibling folders. |
src/Mcp/Http | The HTTP transport. |
src/Mcp/NimbusTool.php | The base tool with the shared error handling. |
A tool calls an Action and builds the response from its result. SendRequestAction returns the response array itself, and RunSavedRequestAction returns it as it is. The nimbus:mcp command in src/Console/Mcp starts the same server over stdio.
How modules talk
- Call another module through its Actions, its DTOs or its
Contracts. Enums, value objects, exceptions, collections, queries and shared services may cross too. - Never import a listener from another module.
- Add a contract only when a second module needs it. Examples are
SchemaPropertyContractandSpecialAuthenticationInjectorContract. - The AST module announces a read class file with the
ClassFileResolvedevent. The routes snapshot listens to it, so the AST module does not know about the snapshot. - Config is the shared source of settings. Read it through
ActiveApplicationResolverand never callenv()outsideconfig/nimbus.php. - Magic features run in the host app request. The relay only sets headers, and the listeners in Magic read them.
Where a new file goes
- Logic goes in
src/Modules/Domain. Create a subfolder only when the first class needs it. - A controller, form request or resource goes in
src/Http/Api/Domain. A page controller goes insrc/Http/Web/Controllers. - Routes are in
routes/api.phpandroutes/web.php. - Services are registered in
NimbusServiceProvider.
The module structure skill has the placement rules. The create action skill covers Actions and DTOs. The project guidelines win when a skill says something else.