G
YouTube TikTok Games
Skip to content
jungmPublic

About

An MCP server implementation for Jakarta EE

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

106 Commits

Folders and files

Repository files navigation

Crema

Where your enterprise beans meet AI.

An MCP server implementation for Jakarta EE.


Crema turns methods of your CDI beans into Model Context Protocol Tools, Resources and Prompts that AI clients can discover and call. It is a plain library in your WAR, implements the org.mcpjava:mcp-server-api annotations and MCP 2026-07-28 (Streamable HTTP), and runs on any Jakarta EE 10 Web Profile Runtime. It is tested on TomEE, WildFly, Open Liberty and Payara/GlassFish.

Example

<dependency>
    <groupId>io.github.jungm.crema</groupId>
    <artifactId>crema</artifactId>
    <version>0.1.0</version>
</dependency>

Declare an MCP Server:

@ApplicationPath("mcp")
@McpServerInfo(title = "Order Service")
public class OrderMcp extends McpApplication {
}

Then annotate methods of any CDI bean:

@ApplicationScoped
public class OrderFeatures {

    @Inject
    OrderService orders;

    @Tool(description = "Places an order for a customer")
    public Order placeOrder(@ToolArg(description = "Customer number") String customer, List<Item> items) {
        return orders.place(customer, items);
    }

    @ResourceTemplate(uriTemplate = "orders://{id}", name = "order", description = "One order")
    public Order order(String id) {
        return orders.find(id);
    }

    @Prompt(description = "Summarizes a customer's order history")
    public String orderSummary(String customer) {
        return "Summarize the order history of customer " + customer + ".";
    }
}

Deploy the WAR and point an MCP Client at http://<host>:<port>/<context-root>/mcp. To restrict who may call it, see Authentication.

Documentation

License

Apache License 2.0

About

An MCP server implementation for Jakarta EE

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages