Back to search
JavaFX-Calculator
MCP serverGitHub
A calculator developed in Java and JavaFX. This simple application was created using the AI agent Opencode that uses a MCP server.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/joaomarcosg--javafx-calculator)HTML
<a href="/listings/joaomarcosg--javafx-calculator"><img src="/api/listings/joaomarcosg--javafx-calculator/badge.svg" alt="findsafeskills safety rating" /></a>Install
i
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 85 lines
- # JavaFX Calculator (built with Context7 MCP)
- This project is a small desktop calculator written in Java and JavaFX. It was
- created as a lab exercise to show how an AI coding agent can use the
- **Context7 MCP server** to look up up-to-date library documentation while
- building an application.
- The calculator itself is intentionally simple: it supports the four basic
- operations, decimals, percentages, sign changes, keyboard input, and a dark
- theme. The interesting part of the project is the workflow — every JavaFX API
- detail used here was checked against the official JavaFX documentation through
- Context7 instead of relying on memory.
- ## Technologies
- | Technology | Role |
- | --- | --- |
- | Java 21 (built and tested with JDK 25) | Language and runtime |
- | JavaFX 21.0.6 (LTS) | Desktop UI: `Application`, `Stage`, `Scene`, controls, layout |
- | Maven | Dependency management and build |
- | `javafx-maven-plugin` 0.0.8 | Runs the JavaFX application (`mvn javafx:run`) |
- | JavaFX CSS | Styling of the calculator buttons and display |
- | Context7 MCP server | Documentation source used by the agent |
- | OpenCode | Agent harness that connects to the MCP server |
- ## How the MCP server was used
- The Context7 server is configured in `opencode.json` as a remote MCP server
- named `context`:
- ```json
- {
- "mcp": {
- "servers": {
- "context": {
- "type": "remote",
- "url": "https://mcp.context7.com/mcp"
- }
- }
- }
- }
- ```
- During development the agent used two Context7 tools:
- 1. **`resolve-library-id`** — to find the right documentation source for
- JavaFX. It resolved to `/websites/openjfx_io_javadoc` (version 21).
- 2. **`query-docs`** — to ask focused questions about specific APIs, for
- example:
- - the structure of a JavaFX application (`Application`, `start(Stage)`,
- `Scene`, `Stage.show()`);
- - `GridPane` layout and `ColumnConstraints` for the keypad;
- - `Scene.setOnKeyPressed` and `KeyEvent` for keyboard support;
- - `Node.setStyle` and CSS styling;
- - Maven and `module-info.java` setup for JavaFX projects.
- The answers were then applied directly to the code in
- `calculator/src/main/java/com/example/calculator/CalculatorApp.java` and
- `calculator/src/main/resources/styles.css`. The MCP server is only used at
- development time; it is not a dependency of the calculator and is not needed
- to run it.
- ## Project layout
- ```
- context7-mcp-server/
- ├── opencode.json # Context7 MCP server configuration
- ├── README.md # This file
- └── calculator/
- ├── pom.xml # Maven build
- ├── README.md # Build/run details
- └── src/main/
- ├── java/com/example/calculator/CalculatorApp.java
- └── resources/styles.css
- ```
- ## Running the calculator
- ```bash
- cd calculator
- mvn javafx:run
- ```
- See [`calculator/README.md`](calculator/README.md) for build details, keyboard
- shortcuts, and the feature list.
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.