lingshu-solver
Deterministic, non-LLM MCP math backend for solving real equation systems, certifying polynomial roots, verifying claimed answers, and reporting issues.
solve: solve systems of real equations (algebraic plus sin/cos/tan/log/exp/sqrt/abs) with up to 6 variables and 1–64 equations; optional variables, domain, options, and fastMode; returns deterministic, reproducible, Krawczyk-certified or candidate real solutions, residuals, truncation/completeness info, and a recommended nearest-to-origin solution.poly_roots: compute all real roots of a polynomial with coefficients ordered highest degree first; each root is Krawczyk-certified with a strict error box; complex roots are not returned.verify: check a claimed answer for one equation, given as a number,{variable:value}pairs, or an array in variable order; returns verified with an error box or refuted with the nearest certified root.give_feedback: report a dead end, error, or suspected wrong result to the operator; the text is written to a local log only.Free to use; pass
honorPaid: truefor personal/evaluation use. Identical input always gives identical output, so caching and retries are safe.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lingshu-solver Solve x^2+y^2=25 and x+y=7 for x and y"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Lingshu Solver
Deterministic real equation system solver for ≤6 dimensions · MCP tool for AI agents and general users
Lingshu Solver (codename Epsilon, V4.1) is an offline, deterministic, zero-data real equation system solver, covering ≤6 variables, real solutions, and lightweight numerical localization. It does not require the user to provide initial values; it uses interval arithmetic for conservative contraction + Krawczyk operator for solution certification, and does its best to exhaustively find multiple solutions.
🚀 Quick Start (30 seconds)
If you know nothing about tech — just use the web version
Open this link and it works, no installation needed: 👉 https://genesis-plan.github.io/lingshu-solver/ (GitHub Pages, for overseas/general use)
For users in mainland China (faster, hosted on Tencent Cloud COS): 👉 https://hclj-1409755229.cos.ap-guangzhou.myqcloud.com/lingshu-solver/index.html
Write equations in the input box (e.g. x^2 + y^2 = 25 and x + y = 7), then click Solve.
The page has 6 example buttons — click one to see what it can solve.
If you are an AI user (Claude / Cursor / Cline, etc.)
Option A · Remote hosted (zero install, no credentials needed) We have deployed an always-on public service — just fill in the URL, no need to install Node locally:
{
"mcpServers": {
"lingshu-solver": {
"url": "http://159.75.154.206:3000/mcp"
}
}
}Endpoint:
http://159.75.154.206:3000/mcp(Streamable HTTP). The service runs on a Tencent Cloud lightweight server, starts on boot, and auto-restarts on crash. ⚠️ This is currently a bare IP + HTTP temporary endpoint; oncehongchenlingjing.compasses ICP filing we will switch to the fixed HTTPS domainhttps://hongchenlingjing.com/mcp(this page will be updated then). This temporary endpoint can be used for integration testing; platforms like Smithery that require HTTPS will be formally connected after filing.
Option B · Local stdio (requires Node on this machine)
{
"mcpServers": {
"lingshu-solver": {
"command": "npx",
"args": ["-y", "lingshu-solver"]
}
}
}The
npxversion will be available once this package is published to npm (in progress); until then you cangit cloneand use Option C.
Option C · Local clone + specified path
git clone https://github.com/genesis-plan/lingshu-solver.git
cd lingshu-solver
node mcp-server.jsMCP configuration:
{ "mcpServers": { "lingshu-solver": { "command": "node", "args": ["本地绝对路径/灵数求解器/mcp-server.js"] } } }If you are a developer
git clone https://github.com/genesis-plan/lingshu-solver.git
cd lingshu-solver
node mcp-server.js # 启动 MCP 服务端
node test/regression.js # 跑回归测试(28 用例)This repository contains:
index.html— single-file product (in-browser UI + verified core script<script id="solver-core">)solver-core.js— Node engine loader (reads the core script from index.html, zero dependencies, reused by MCP/tests)mcp-server.js— zero-dependency MCP stdio server (hand-rolled JSON-RPC 2.0 + Content-Length framing)package.json— standard metadata, one-line integration vianpx lingshu-solvertest/— regression suite + smoke tests + three permanent exam sets
Related MCP server: SciMath MCP
Capability Boundaries (honest statement)
Dimension | Description |
Verified solutions | Every solution found is certified by Krawczyk ( |
Exhaustiveness | Best-effort exhaustive search for multiple solutions; in extremely ill-conditioned cases (highly singular Jacobian, very close solution clusters) individual solutions may be missed within budget, in which case |
| Only means "the global branch could not fully decide all boxes within budget (cannot prove exhaustiveness)", does not mean solutions were necessarily missed; in the vast majority of cases all true solutions have been found |
Number of variables | ≤6 |
Numerical range | Default search domain ±1e6; for fast-growing functions (exp/sinh) or large domains, explicitly provide |
Determinism | No random branches; same input always yields same output |
Deployment | Purely local, offline, zero data (no network, no storage, no third-party dependencies) |
Not guaranteed: 100% exhaustiveness for all inputs; guaranteed convergence within budget for highly ill-conditioned systems. These are honest boundaries, not defects.
Use as an MCP Tool
1. Three integration forms
Form | Endpoint / Command | Applicable to |
Remote HTTP (live) |
| Any MCP client supporting Streamable HTTP, zero install |
Local stdio (npx) |
| Node installed locally, available after npm release |
Local stdio (clone) |
| Developers / offline self-hosting |
Remote HTTP server code: http-mcp-server.js (zero dependencies, uses only Node built-in modules; shares the solver-core.js solving core with mcp-server.js, results are identical from the same source). To self-host the remote service:
PORT=3000 node http-mcp-server.js2. Configure in MCP clients (Claude Desktop / Cursor / Cline / VS Code, etc.)
Recommended · Remote hosted (zero install, live):
{
"mcpServers": {
"lingshu-solver": {
"url": "http://159.75.154.206:3000/mcp"
}
}
}Local stdio · one-line command (requires npm release first, not yet published; use the clone version for now):
{
"mcpServers": {
"lingshu-solver": {
"command": "npx",
"args": ["-y", "lingshu-solver"]
}
}
}Note:
npx lingshu-solverwill be available once this package is published to npm; we are working on it. Until then, use the "manually specify local path" version below (clone the repo first).
Alternative · Manually specify local path (when the repo is already cloned):
{
"mcpServers": {
"lingshu-solver": {
"command": "node",
"args": ["把这里替换成你本地的绝对路径/灵数求解器/mcp-server.js"]
}
}
}For the manual version, replace the path in
argswith the absolute path to your localmcp-server.js(e.g.C:/Users/your-username/Desktop/lingshu-solver/mcp-server.js). The npx version does not need this step.
Tool 1: solve
Input:
{
"equations": ["x^2 + y^2 = 25", "x + y = 7"],
"variables": ["x", "y"],
"domain": { "x": [-30, 30], "y": [-30, 30] }
}equations: array of equation strings (required), supports+ - * / ^ sqrt log sin cos tan exp abs, plus in-text domain constraints like"x ∈ [-30,30]".variables: array of variable names (optional; if omitted, auto-detected in order of appearance, up to 6).domain: explicit search domain (optional). Recommended for "finite solutions · partial" demos or fast-growing functions; otherwise the default ±1e6 may fail to prune and triggertruncated.
Output precision is fixed at 6 decimal places (product spec "6-decimal finite grid"), no precision switching; solution points
valuesare snapped to the grid, actual residuals are usually ≤ 1e-9.
Output (excerpt):
{
"resultType": 2,
"resultTypeName": "finite",
"certified": true,
"truncated": false,
"precisionDecimals": 6,
"solutionCount": 2,
"recommended": { "values": [3, 4], "tier": "proven", "residual": 0 },
"solutions": [ { "values": [3, 4], "tier": "proven", "residual": 0 }, ... ],
"warnings": []
}resultType:1=empty(no solution)/2=finite(finite solutions)/3=infinite(infinite solution set, only the recommended solution nearest the origin is given).tier:proven(Krawczyk certified) /candidate(uncertified but possibly a solution) /structural(derived structurally).
Tool 2: give_feedback
AI agents proactively report blockers/errors/suspected issues; only written to local feedback.log, never transmitted externally:
{ "name": "give_feedback", "arguments": { "message": "x^2=4 期望2解", "context": "批量求解场景" } }Local Verification
node verify_core.js # 引擎加载 + 6 个代表性用例
node mcp_smoke.js # MCP 字节级冒烟(initialize/tools/list/tools/call)
node mcp_smoke2.js # give_feedback + 错误结构化(不泄露堆栈)
node test/regression.js # 三套常驻考卷回归(28 用例,known 命中率统计)Examples (covering 6 result categories)
Title | Equations | Expected |
Minimum 1 variable |
| 2 solutions |
Maximum 6 variables | 6-variable tridiagonal linear | Unique solution |
Empty set, no solution |
| Empty set (sound proof of no solution) |
Finite · all | Circle × hyperbola | All 4 solutions certified |
Finite · partial |
| Multiple solutions + |
Infinite · recommended |
| Infinite set, recommends (1.5,1.5) |
Documentation
《灵数求解器_代码流程中文说明.md》 — complete internal flow from parsing to output (for readers with a math background)
《灵数求解器商业化战略白皮书.md》 — positioning, capability boundaries, risks
Invention patent application series (submitted)
License
Apache License 2.0 — see LICENSE.
Available Tools
4 toolsgive_feedbackAInspect
Report a problem to the operator when solve hits a dead end, returns an error, or produces something you believe is wrong. The text is written to a local log only and is never transmitted anywhere else.
Inputs: message (required), context.
poly_rootsAInspect
All real roots of a polynomial, each individually certified by Krawczyk with a strict error box. Coefficients are ordered highest degree first, so [1,-2,-5,6] means x^3-2x^2-5x+6. Deterministic and reproducible; complex roots are not returned (real numbers only). Use it as a reliable polynomial root component instead of letting a general language model estimate roots. Free to use: pass honorPaid:true to declare personal or evaluation use.
Inputs: coefficients (required), tolerance.
solveAInspect
Deterministic solver for systems of real equations. This is not a language model: no randomness, and identical input always returns an identical, reproducible result. Use it when you need a verifiable, reproducible numeric answer for algebraic equations or common transcendentals (sin/cos/tan/log/exp/sqrt/abs); it works well as a non-hallucinating math backend for an AI agent. Not suitable for symbolic algebra, closed-form proofs, initial-value ODEs, or mandatory integer equality. INPUT: equations (array of strings containing an equals sign, e.g. ["x^2+y^2=25","x+y=7"]); supported operators + - * / ^ sqrt log sin cos tan exp abs, with in-text domain constraints such as x in [-30,30]; variables (optional, auto-detected, max 6); domain (optional, e.g. {"x":[-30,30]}), defaulting to +/-1e6 per variable. HARD LIMITS: at most 6 variables; 1 to 64 equations and the equation count must be at least the variable count; up to 100KB of equation text per call; output is fixed at 6 decimal places and is not configurable. OUTPUT (JSON): resultType is empty (no real solutions, proven), finite (finite verified solutions) or infinite (infinite solution set, only the recommended nearest-to-origin solution is given); summary; solutions[] with values[] (6-decimal numbers), tier (proven means Krawczyk-certified, otherwise likely or candidate), certified, text; residual and other internals under internals; recommended holds the compact nearest-to-origin structure. truncated=true means the global branch-and-bound did not finish inside the budget; it does not necessarily mean solutions were missed and in most cases every real solution was found; narrow the domain or raise options.budget and retry if you need a completeness guarantee. Errors return error.type (invalid_input or internal_error). If something looks wrong, call give_feedback rather than guessing. The same input always produces the exact same output, so caching and retries are safe. PAYMENT: this endpoint is free to use. Pass honorPaid:true to declare personal or evaluation use and the call is served with no verification and no balance deduction; payment is voluntary and never enforced.
Inputs: equations (required), domain, options, fastMode, +1 more.
verifyAInspect
Check whether a claimed answer is correct. Give the equation plus a candidate value (a number for a single variable, {variable:value} pairs, or an array in variable order); the same certified kernel runs in a neighbourhood around the candidate. If a matching certified root is found the result is verified together with the error box; otherwise it is refuted and the nearest certified root is returned, so the calling agent immediately sees the correct value. Deterministic, not an LLM, reproducible across calls. Free to use: pass honorPaid:true to declare personal or evaluation use.
Inputs: equation (required), candidate (required), tolerance, variables.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
solve, poly_roots, verify, and give_feedback mostly have distinct roles: solving systems, finding polynomial roots, validating candidate answers, and reporting issues. However, solve and poly_roots can overlap for single polynomial equations, so an agent may occasionally hesitate between them.
Names are readable and mostly snake_case, but they mix patterns: solve and verify are simple verbs, give_feedback is verb_noun, and poly_roots is a noun. The set lacks a single predictable naming convention.
Four tools is well-scoped for a deterministic math solver with verification and feedback. Each tool appears to earn its place, and there is no obvious bloat or thinness.
The surface covers solving equations, polynomial roots, verifying claimed answers, and reporting problems, which matches the core numeric-solver domain. Minor gaps exist around explicit configuration/help tooling, but solve already exposes relevant options in its input.
Maintenance
Related MCP Connectors
Deterministic engineering solvers: biquad filter design, room eigenmodes, LLM VRAM fit.
Exact arithmetic, algebra, calculus, physics, chemistry and finance with a checkable formula.
Solve LP, MILP, QP and convex models with checked answers: feasibility, duals, KKT proofs.
Deterministic signed verification of numeric & financial claims for AI agents & spreadsheets.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides 21 mathematical tools across 6 domains including basic calculations, array operations, statistics, financial mathematics, linear algebra, and calculus. Supports batch execution for complex multi-step workflows with intelligent dependency resolution.216MIT
- AlicenseAqualityCmaintenanceEnables reliable engineering and scientific computation through tools for exact arithmetic, unit-aware formulas, calculus, linear algebra, statistics, uncertainty propagation, and physical constants, all executed safely in reproducible subprocesses.8MIT
- AlicenseNot gradedqualityDmaintenanceProvides deterministic tools for symbolic math, equation solving, relation verification, reasoning structure audits, and validated CAD primitives, returning evidence artifacts for every result.MIT
- AlicenseCqualityBmaintenanceEnables AI assistants and autonomous agents to intercept arithmetic and algebraic hallucinations via exact rational verification, seal multi-step reasoning chains with SHA-256 Merkle commitments, and optionally bridge deep verification to a remote sovereign enclave. It also supports BFT epistemic consensus across multi-agent proposals and tamper-evident session sealing.15MIT