MCPpedia last refreshed this data
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"dice": {
"args": [
"-jar",
"/absolute/path/to/dice-mcp-server/target/dice-mcp-server.jar"
],
"command": "java"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A minimal Model Context Protocol server written in Java, built as a first MCP project. It exposes two tools over the stdio transport:
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in other
Pi Coding Agent extension (CLI-first) — routes bash/read/grep/find/ls through lean-ctx CLI for strong token savings. Optional MCP bridge can register advanced tools.
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 60-95% fewer tokens, same answers. Library, proxy, MCP server.
One local source for the MCP servers, tools, and memory your AI coding agents share, synced into each tool's native config with a review gate and a receipt for every change. No daemon, no lock-in.
97% token reduction for AI coding sessions — zero deps, 21 languages, MCP server
MCP Security Weekly
Get CVE alerts and security updates for Dice Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A minimal Model Context Protocol server written in Java, built as a first MCP project. It exposes two tools over the stdio transport:
| Tool | Arguments | Description |
|---|---|---|
roll_dice | sides (integer, optional, default 6, min 2) | Rolls an N-sided die |
add | a (number), b (number) | Adds two numbers |
Built with the official MCP Java SDK 2.0.0.
mvn clean package
This produces a self-contained runnable jar at target/dice-mcp-server.jar.
All dependencies come from Maven Central, so a stock Maven install builds it as-is.
The server speaks JSON-RPC over stdin/stdout, so you normally don't run it by hand — an MCP client (like Cursor) launches it. To run it directly:
java -jar target/dice-mcp-server.jar
It will print dice-mcp-server started (stdio). Waiting for client... to stderr and then wait for a client. Press Ctrl+C to stop.
Note: stdout is reserved for the JSON-RPC protocol, so all logging goes to stderr.
Add the server to your Cursor MCP config (~/.cursor/mcp.json for global, or .cursor/mcp.json in a project):
{
"mcpServers": {
"dice": {
"command": "java",
"args": ["-jar", "/absolute/path/to/dice-mcp-server/target/dice-mcp-server.jar"]
}
}
}
Then reload Cursor. You should see the dice server with its roll_dice and add tools. Try asking: "Roll a 20-sided die".
You can drive the protocol by hand to verify it works:
{ printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
'{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"roll_dice","arguments":{"sides":20}}}'; \
sleep 2; } | java -jar target/dice-mcp-server.jar
You should see JSON-RPC responses including a dice roll result.
pom.xml Maven build (MCP BOM + shade plugin)
src/main/java/com/example/dice/DiceMcpServer.java The server + tools
add tool returning structuredContent instead of plain text.