tinystruct
A lightweight, modular Java application framework for web and CLI development, designed for AI integration and plugin-based architecture. Enabling developers to create robust solutions with ease for building efficient and scalable applications.
claude mcp add --transport stdio tinystruct-tinystruct java -jar path/to/tinystruct-jar-with-dependencies.jar \ --env JAVA_OPTS="Optional JVM options, e.g., -Xms256m -Xmx1024m"
How to use
tinystruct is a lightweight Java-based framework that enables you to build CLI and web endpoints from the same codebase, with annotation-driven routing and minimal ceremony. This MCP server configuration points to a Java artifact that runs the tinystruct dispatcher, allowing you to invoke actions via CLI commands or HTTP requests once the server is started. Typical usage involves starting the dispatcher, then using the provided actions (annotated methods) to perform tasks, serve HTTP requests, or expose POJO APIs. The README demonstrates a CLI workflow with commands like dispatcher and actions such as praise, say, hello, and more, which can be invoked directly or via HTTP endpoints when the server is wired to a web server.
Once running, you can access the HTTP layer by starting the embedded or integrated server and hitting endpoints like /?q=say/Praise%20the%20Lord! or /?q=praise, depending on how you wire your routes. The framework emphasizes a unified approach to CLI and web, so your business logic can be exercised from scripts, tests, or browser-based requests without switching deployment modes.
How to install
Prerequisites:
- Java Development Kit (JDK) 17 or higher
- Maven (for building the project and managing dependencies)
Install and build locally:
- Ensure you have JDK 17+ installed and Maven available in your PATH.
- Clone the repository: git clone https://github.com/tinystruct/tinystruct cd tinystruct
- Build with Maven to produce the runnable jar (jar-with-dependencies if using the classifier):
mvn -q clean package
The resulting jar will typically be placed under target/, e.g. target/tinystruct-<version>-jar-with-dependencies.jar
- Prepare to run the MCP server using the provided mcp_config entry, pointing to the built jar: java -jar target/tinystruct-<version>-jar-with-dependencies.jar
Optional:
- If you prefer Docker, you can containerize the built jar by creating a Dockerfile that runs: java -jar /app/tinystruct-<version>-jar-with-dependencies.jar
- For quick exploration, you can also run a Maven exec plugin command to start the dispatcher directly from source (not shown in the README, but common in Java projects).
Additional notes
Notes and tips:
- The tinystruct framework emphasizes no boilerplate main method and a unified CLI/Web experience. You can expose actions with @Action annotations and access them via CLI commands or HTTP queries depending on your server configuration.
- If you encounter classpath or dependency issues, ensure you’re using Java 17+ and that the jar-with-dependencies classifier is included, so all transitive dependencies are bundled.
- When running in production, consider configuring JVM options (memory limits, GC tuning) via JAVA_OPTS or your deployment environment.
- For HTTP access, you’ll typically need to start the embedded HTTP server as part of the dispatcher lifecycle; consult the README’s examples for how to expose endpoints and test with curl or a browser.
- If you need to pass parameters to actions, the examples show using dispatcher say --words Hello or similar syntax; use the same conventions when invoking your actions in scripts.
Related MCP Servers
mcp-for-beginners
This open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
sonarqube
SonarQube MCP Server
wanaku
Wanaku MCP Router
api2mcp4j
This is a revolutionary AI MCP plugin with excellent pluggable and encapsulated features. With just a few lines of configuration, it can easily integrate into your Spring boot web program and give it MCP capabilities,inheriting the powerful engineering capabilities of the Spring series framework
WigAI
Bitwig Controller Extension that provides an MCP Server for AI Agent control
vertx
A Vert.x MCP Server built on top of MCP Java SDK