@@ -117,83 +117,120 @@ <h1 class="hero-title">A lightweight Java framework for modern apps</h1>
117117 <!-- Content Grid -->
118118 < div class ="content-wrapper ">
119119
120- <!-- Performance Card -->
121- < div class ="card perf-card ">
122- < h3 > High Performance</ h3 >
123- < p style ="color: var(--text-secondary); margin-bottom: 2rem; ">
124- Engineered for speed with minimal overhead.
125- Handles high-throughput workloads with ease.
126- </ p >
127-
128- < div class ="perf-chart ">
129- <!-- Bars are purely decorative CSS -->
130- < div class ="bar "> </ div >
131- < div class ="bar "> </ div >
132- < div class ="bar "> </ div >
133- < div class ="bar "> </ div > <!-- Target -->
134- < div class ="bar "> </ div >
135- < div class ="bar "> </ div >
136-
137- < div class ="perf-stat ">
138- < div class ="perf-value "> 86,000+</ div >
139- < div class ="perf-label "> Requests / Second</ div >
120+ < div class ="left-column " style ="display: flex; flex-direction: column; gap: 2rem; ">
121+ <!-- Performance Card -->
122+ < div class ="card perf-card ">
123+ < h3 > High Performance</ h3 >
124+ < p style ="color: var(--text-secondary); margin-bottom: 2rem; ">
125+ Engineered for speed with minimal overhead.
126+ Handles high-throughput workloads with ease.
127+ </ p >
128+
129+ < div class ="perf-chart ">
130+ <!-- Bars are purely decorative CSS -->
131+ < div class ="bar "> </ div >
132+ < div class ="bar "> </ div >
133+ < div class ="bar "> </ div >
134+ < div class ="bar "> </ div > <!-- Target -->
135+ < div class ="bar "> </ div >
136+ < div class ="bar "> </ div >
137+
138+ < div class ="perf-stat ">
139+ < div class ="perf-value "> 86,000+</ div >
140+ < div class ="perf-label "> Requests / Second</ div >
141+ </ div >
140142 </ div >
141143 </ div >
142- </ div >
143-
144- <!-- Code Snippet Card -->
145- < div class ="card code-card ">
146- < h3 > Simple & Elegant</ h3 >
147- < p style ="color: var(--text-secondary); margin-bottom: 1rem; ">
148- No main() method required. Just pure logic.
149- </ p >
150144
151- < div class ="code-block ">
152- < div class ="code-header ">
153- < div class ="dots ">
154- < span class ="dot red "> </ span >
155- < span class ="dot yellow "> </ span >
156- < span class ="dot green "> </ span >
145+ <!-- Code Snippet Card: HelloApp -->
146+ < div class ="card code-card " id ="hello-app-card ">
147+ < h3 > Simple & Elegant</ h3 >
148+ < p style ="color: var(--text-secondary); margin-bottom: 1rem; ">
149+ No main() method required. Just pure logic.
150+ </ p >
151+
152+ < div class ="code-block ">
153+ < div class ="code-header ">
154+ < div class ="dots ">
155+ < span class ="dot red "> </ span >
156+ < span class ="dot yellow "> </ span >
157+ < span class ="dot green "> </ span >
158+ </ div >
159+ < span class ="language "> JAVA</ span >
157160 </ div >
158- < span class ="language "> JAVA</ span >
159- </ div >
160- < pre > < code class ="language-java "> package com.example;
161+ < pre > < code class ="language-java "> package com.example;
161162
162163import org.tinystruct.AbstractApplication;
163164import org.tinystruct.data.component.Builder;
164165import org.tinystruct.data.component.Builders;
165166import org.tinystruct.system.annotation.Action;
166167
167168public class HelloApp extends AbstractApplication {
168-
169169 @Action("hello")
170170 public String hello() {
171171 return "Hello, World!";
172172 }
173173
174174 @Action("user")
175175 public Builder getUser(String id) {
176- // userService.findById(id);
176+ // Query from database
177+ // ...
177178 return new Builder();
178179 }
179-
180- @Action("users")
181- public Builders getUsers() {
182- // userService.findAll();
183- return new Builders();
184- }
185-
180+
186181 @Override
187182 public void init() {
188183 this.setTemplateRequired(false);
189184 }
185+
186+ @Override
187+ public String version() { return "1.0"; }
188+ }</ code > </ pre >
189+ </ div >
190+ </ div >
191+ </ div >
192+
193+ <!-- Code Snippet Card: MCP Server -->
194+ < div class ="card code-card " id ="mcp-server-card ">
195+ < h3 id ="mcp-title "> AI Ready (MCP)</ h3 >
196+ < p id ="mcp-desc " style ="color: var(--text-secondary); margin-bottom: 1rem; ">
197+ Expose POJOs directly to AI models. No MCPTool subclass required.
198+ </ p >
199+
200+ < div class ="code-block ">
201+ < div class ="code-header ">
202+ < div class ="dots ">
203+ < span class ="dot red "> </ span >
204+ < span class ="dot yellow "> </ span >
205+ < span class ="dot green "> </ span >
206+ </ div >
207+ < span class ="language "> JAVA</ span >
208+ </ div >
209+ < pre > < code class ="language-java "> package com.example;
190210
211+ import org.tinystruct.mcp.MCPServer;
212+ import org.tinystruct.system.annotation.Action;
213+ import org.tinystruct.system.annotation.Argument;
214+
215+ // Run with: bin/dispatcher start --import org.tinystruct.system.HttpServer --import com.example.HelloMCPServer
216+ public class HelloMCPServer extends MCPServer {
191217 @Override
192- public String version() {
193- return "1.0";
218+ public void init() {
219+ super.init();
220+
221+ // Registering a plain object directly — no MCPTool subclass needed
222+ this.registerTool(new StringHelper());
223+ }
224+
225+ public static class StringHelper {
226+ @Action(value = "string/uppercase", description = "Convert to uppercase", arguments = {
227+ @Argument(key = "text", description = "The text to convert", type = "string")
228+ })
229+ public String toUpperCase(String text) {
230+ return text == null ? null : text.toUpperCase();
231+ }
194232 }
195- }
196- </ code > </ pre >
233+ }</ code > </ pre >
197234 </ div >
198235 </ div >
199236
@@ -222,7 +259,11 @@ <h4>Unified Architecture</h4>
222259 < ion-icon name ="server-outline " size ="large "> </ ion-icon >
223260 </ div >
224261 < h4 > Multiple Servers</ h4 >
225- < p > HttpServer is the built-in default, but also supports < a href ="https://github.com/tinystruct/tinystruct-tomcat-server " target ="_blank "> Tomcat</ a > , < a href ="https://github.com/tinystruct/tinystruct-netty-http-server " target ="_blank "> Netty</ a > HTTP server, and < a href ="https://github.com/tinystruct/tinystruct-undertow-server " target ="_blank "> Undertow</ a > .</ p >
262+ < p > HttpServer is the built-in default, but also supports < a
263+ href ="https://github.com/tinystruct/tinystruct-tomcat-server " target ="_blank "> Tomcat</ a > , < a
264+ href ="https://github.com/tinystruct/tinystruct-netty-http-server " target ="_blank "> Netty</ a > HTTP
265+ server, and < a href ="https://github.com/tinystruct/tinystruct-undertow-server "
266+ target ="_blank "> Undertow</ a > .</ p >
226267 </ div >
227268
228269 < div class ="feature-item ">
@@ -308,9 +349,9 @@ <h4>Zero Configuration</h4>
308349 document . body . classList . remove ( 'sidebar-open' ) ; // Reset mobile state just in case
309350 }
310351 }
311-
352+
312353 // Close sidebar when clicking overlay (Mobile only)
313- document . querySelector ( '.sidebar-overlay' ) . addEventListener ( 'click' , function ( ) {
354+ document . querySelector ( '.sidebar-overlay' ) . addEventListener ( 'click' , function ( ) {
314355 document . body . classList . remove ( 'sidebar-open' ) ;
315356 } ) ;
316357
@@ -402,12 +443,20 @@ <h4>Zero Configuration</h4>
402443 '专为速度而设计,开销极小。轻松处理高吞吐量工作负载。' ;
403444 document . querySelector ( '.perf-label' ) . textContent = currentLang === 'en' ? 'Requests / Second' : '请求 / 秒' ;
404445
405- // Update Code Card
406- document . querySelector ( '.code -card h3' ) . textContent = currentLang === 'en' ? 'Simple & Elegant' : '简单优雅' ;
407- document . querySelector ( '.code -card p' ) . textContent = currentLang === 'en' ?
446+ // Update Code Cards
447+ document . querySelector ( '#hello-app -card h3' ) . textContent = currentLang === 'en' ? 'Simple & Elegant' : '简单优雅' ;
448+ document . querySelector ( '#hello-app -card p' ) . textContent = currentLang === 'en' ?
408449 'No main() method required. Just pure logic.' :
409450 '无需 main() 方法。只需纯粹的逻辑。' ;
410451
452+ const mcpTitle = document . querySelector ( '#mcp-title' ) ;
453+ if ( mcpTitle ) {
454+ mcpTitle . textContent = currentLang === 'en' ? 'AI Ready (MCP)' : 'AI 就绪 (MCP)' ;
455+ document . querySelector ( '#mcp-desc' ) . textContent = currentLang === 'en' ?
456+ 'Expose POJOs directly to AI models. No MCPTool subclass required.' :
457+ '将普通对象直接暴露给AI模型,无需继承 MCPTool。' ;
458+ }
459+
411460 // Update Sidebar
412461 const sidebarLinks = document . querySelectorAll ( '.nav-link' ) ;
413462 const sidebarKeys = [ 'Home' , 'Getting Started' , 'Core Concepts' , 'API Reference' , 'GitHub' ] ;
@@ -499,11 +548,11 @@ <h4>Zero Configuration</h4>
499548 textDiv . classList . add ( 'fade-in' ) ;
500549 outputMain . appendChild ( textDiv ) ;
501550 i ++ ;
502-
551+
503552 // Auto scroll to bottom
504553 const terminal = document . getElementById ( 'terminal-main' ) ;
505554 terminal . scrollTop = terminal . scrollHeight ;
506-
555+
507556 setTimeout ( typeCommands , 100 ) ;
508557 } else {
509558 // Keep cursor blinking at the end
@@ -515,4 +564,4 @@ <h4>Zero Configuration</h4>
515564 </ script >
516565</ body >
517566
518- </ html >
567+ </ html >
0 commit comments