QuifixOfficial/MCP_Server
If you are the rightful owner of MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This is a Model Context Protocol (MCP) server that provides calculator and Java interpreter tools for OpenWebUI integration.
OpenWebUI MCP Math Server
This is a Model Context Protocol (MCP) server that provides calculator and Java interpreter tools for OpenWebUI integration.
Tools Available
- calculator: Evaluate, simplify, differentiate, integrate, or solve mathematical expressions
- java_interpreter: Run Java code in a sandboxed environment
OpenWebUI Integration
This server is designed to work with OpenWebUI using the MCP-to-OpenAPI proxy (mcpo). Follow these steps:
Option 1: Local Development
-
Build the server:
npm run build -
Install mcpo (MCP-to-OpenAPI proxy):
pip install mcpo # or with uv: # uvx mcpo -
Run the server through mcpo:
# Using pip installation: mcpo --port 8000 -- node dist/index.js # Or using uv: uvx mcpo --port 8000 -- node dist/index.js -
Access the OpenAPI documentation:
- Visit
http://localhost:8000/docsto see the auto-generated API documentation - Use
http://localhost:8000as the base URL in OpenWebUI
- Visit
Option 2: Docker (Local)
-
Build and run with Docker:
docker-compose up --build -
Run mcpo to proxy the containerized MCP server:
# Install mcpo if not already installed pip install mcpo # Run mcpo with the containerized server mcpo --port 8000 -- docker exec -i mcp-math-java node dist/index.js -
Configure OpenWebUI:
- Use
http://localhost:8000as the base URL - The tools will be automatically discovered and documented
- Use
Option 3: Windows Batch Script
For Windows users, you can use the provided batch script:
# Run the server through mcpo
mcpo --port 8000 -- run-mcp-server.bat
OpenWebUI Configuration
- In OpenWebUI, go to Settings → Tools
- Add a new tool source with:
- Base URL:
http://localhost:8000(or your mcpo server URL) - The tools (calculator and java_interpreter) will be automatically discovered
- Base URL:
Tool Usage Examples
Calculator Tool
{
"expression": "2 + 2 * 3",
"mode": "evaluate"
}
Java Interpreter Tool
{
"code": "public class Hello { public static void main(String[] args) { System.out.println(\"Hello World!\"); } }",
"className": "Hello"
}
- Build
npm run build
- Start built server
npm start
Docker
Build image:
docker build -t openwebui-mcp-math-server:latest .
Run container:
docker run --rm -it --name mcp-math-java openwebui-mcp-math-server:latest
In OpenWebUI MCP settings, configure stdio with:
- Command: node
- Args: /app/dist/index.js
Docker Compose
docker compose up --build -d
OpenWebUI integration
Configure an MCP server in OpenWebUI (Settings -> MCP) with stdio:
- Command:
node - Args:
dist/index.js(after build) ornode_modules/tsx/dist/cli.js src/index.tsfor dev - Env: optional (none required)
The server exposes a tool named calculator.
Tool: calculator
Input schema:
- expression: string (required)
- mode: "evaluate" | "simplify" | "derive" | "integrate" | "solve" (default: evaluate)
- variable: string (default: x)
- point: number (optional, evaluate derivative at point)
- lower, upper: numbers (optional, for definite integral)
Local smoke test
npm run test
Notes
- Requires Node.js >= 18.17
- If OpenWebUI expects TCP transport instead of stdio in your setup, we can add an HTTP/TCP transport adapter.
Tools
calculator
Input schema:
- expression: string (required)
- mode: "evaluate" | "simplify" | "derive" | "integrate" | "solve" (default: evaluate)
- variable: string (default: x)
- point: number (optional, evaluate derivative at point)
- lower, upper: numbers (optional, for definite integral)
java_interpreter
Purpose: For high‑school computer science coursework. Compiles and runs small Java programs to demonstrate concepts and answer questions. Source runs in an ephemeral temp workspace.
Input schema:
- code: string (required) — Java source containing a public class (e.g.,
public class Main) - className: string (optional) — public class name; inferred if omitted
- stdin: string (optional) — text piped to program stdin
- args: string[] (optional) — command-line arguments passed to
main - timeoutMs: number (optional) — default 8000ms, max 30000ms
Requirements: JDK must be installed and available on PATH (javac, java).