A lightweight Java framework for modern apps
Build efficient, scalable applications with a unified CLI and Web architecture. Zero boilerplate, maximum performance.
curl -fsSL https://tinystruct.org/create | sh
irm https://tinystruct.org/create.ps1 | iex
Needs Java 17+ and Maven. Pick a template: basic web mcp
workflow agent. On Windows, Git for Windows or WSL is required.
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.
Explore the docs
Getting Started
Install, create your first app and run it as a CLI and a web server.
Core Concepts
Applications, actions, the context and the request lifecycle.
Web Applications
Routing, templates, SSE and file uploads.
Database
Annotation-based ORM, POJO generation and PostgreSQL.
MCP Integration
Expose your tools to AI models over the Model Context Protocol.
What's New in 1.7.35
Latest release notes and upgrade guidance.