Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Ensure you have JDK 17+ installed and Maven available in your PATH.
  2. Clone the repository: git clone https://github.com/tinystruct/tinystruct cd tinystruct
  3. 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

  4. 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

Sponsor this space

Reach thousands of developers