What does this skill do?

Development with tinystruct Skill guides the creation of lightweight Java applications that automatically expose methods as HTTP endpoints and CLI commands using the @Action annotation. It includes patterns for native JSON serialization without external dependencies, persistence using AbstractData, and tooling for the Model Context Protocol (MCP).

Application Modules
Create new modules by extending `AbstractApplication` and configuring the lifecycle in `init()`.
CLI and HTTP Dual Actions
Define web routes and terminal commands using @Action without manually registering them in ActionRegistry.
Native JSON without dependencies
Serialize JSON objects and arrays using Builder and Builders, avoiding Gson or Jackson.
MCP Tools for AI
Develop native tools for the Model Context Protocol by extending MCPTool with input validation.

Usage examples

🔌 Basic API
Create a tinystruct application that disables template views and returns native JSON at the api/data route.
🔀 Dual Action
Define an @Action action that functions as both a CLI command and an HTTP endpoint without duplicating logic.
🤖 MCP Tool
Create an MCP tool using tinystruct that validates inputs and prevents prompt injection.
💾 XML Persistence
Implement a POJO based on AbstractData with XML mapping to persist user data.

Features

CLI and Native HTTP A single @Action annotation exposes methods as both web routes and terminal commands simultaneously.
JSON Serialization Without Dependencies Builder and Builders handle JSON objects and arrays without Gson, Jackson, or any external libraries.
Full MCP Integration Create tools for AI models by extending MCPTool with @Argument and registering them with MCPServer.
Persistence with AbstractData Map POJOs to XML and manage data persistence without complex configuration.
Execution via the dispatcher Launch applications using `bin/dispatcher` instead of implementing a traditional `main` method.

Frequently asked questions

No. tinystruct includes a Builder for JSON objects and Builders for arrays, enabling native serialization without external dependencies.
It is launched using the `bin/dispatcher` command instead of a traditional `main` method. For example: `bin/dispatcher api/data`.
Yes. By extending MCPTool, defining arguments with @Argument, and registering the tool with a server that extends MCPServer.
Yes. The @Action annotation automatically exposes the method as an HTTP endpoint (/?q=action) and as a CLI command (bin/dispatcher action).
Development with tinystruct — A lightweight Java framework with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.