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.
<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.
- Getting started: requirements, setup and trying it with
curl - Programming model: Arguments, Injected Parameters, return types, multiple MCP Servers, deployment-time validation
- Configuration: all MicroProfile Config keys
- Security: Origin check and roles
- Authentication: protecting MCP Servers with OAuth, Basic authentication or your own Authenticator
- Limitations: what isn't supported yet
- Building and testing: unit tests, integration tests on four Runtimes, conformance suite