A lightweight Java framework for modern apps
Build efficient, scalable applications with a unified CLI and Web architecture. Zero boilerplate, maximum performance.
High Performance
Engineered for speed with minimal overhead. Handles high-throughput workloads with ease.
Simple & Elegant
No main() method required. Just pure logic.
package com.example;
import org.tinystruct.AbstractApplication;
import org.tinystruct.data.component.Builder;
import org.tinystruct.data.component.Builders;
import org.tinystruct.system.annotation.Action;
public class HelloApp extends AbstractApplication {
@Action("hello")
public String hello() {
return "Hello, World!";
}
@Action("user")
public Builder getUser(String id) {
// Query from database
// ...
return new Builder();
}
@Override
public void init() {
this.setTemplateRequired(false);
}
@Override
public String version() { return "1.0"; }
}
AI Ready (MCP)
Expose POJOs directly to AI models. No MCPTool subclass required.
package com.example;
import org.tinystruct.mcp.MCPServer;
import org.tinystruct.system.annotation.Action;
import org.tinystruct.system.annotation.Argument;
// Run with: bin/dispatcher start --import org.tinystruct.system.HttpServer \
// --import com.example.HelloMCPServer
public class HelloMCPServer extends MCPServer {
@Override
public void init() {
super.init();
// Registering a plain object directly — no MCPTool subclass needed
this.registerTool(new StringHelper());
}
public class StringHelper {
@Action(value = "string/uppercase", description = "Convert to uppercase",
arguments = {
@Argument(key = "text", description = "The text to convert", type = "string")
})
public String toUpperCase(String text) {
return text == null ? null : text.toUpperCase();
}
@Action(value = "string/reverse", description = "Reverse a string",
arguments = {
@Argument(key = "text", description = "The text to reverse", type = "string")
})
public String reverse() {
Object text = getContext().getAttribute("text");
return text != null ? new StringBuilder(text.toString()).reverse().toString() : "";
}
}
}
Unified Architecture
Write your logic once and expose it as both a Command Line Interface and a Web API instantly.
Multiple Servers
HttpServer is the built-in default, but also supports Tomcat, Netty HTTP server, and Undertow.
AI Ready (MCP)
Native integration with Model Context Protocol for building next-gen AI applications.
Real-time SSE
Push updates to clients instantly with built-in Server-Sent Events support.
Lightweight
Tiny footprint with minimal external dependencies. Perfect for microservices.
Zero Configuration
Convention over configuration principles. Start coding immediately without XML hell.