Skip to main content
Glama
genesis-plan

lingshu-solver

by genesis-plan

灵数求解器 · Lingshu Solver

≤6-dimensional deterministic real equation system solving engine · MCP tool for AI agents and everyday 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 initial values from the user; it uses interval arithmetic for conservative contraction + the Krawczyk operator for solution certification, and does its best to exhaust multiple solutions.


🚀 Quick start (30 seconds)

If you know nothing about tech — just use the web version

Just open this link and it works — no installation needed: 👉 https://genesis-plan.github.io/lingshu-solver/

Type 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're an AI user (Claude / Cursor / Cline, etc.)

Copy the following configuration into your MCP client config file and restart the client:

{
  "mcpServers": {
    "lingshu-solver": {
      "command": "npx",
      "args": ["-y", "lingshu-solver"]
    }
  }
}

No need to download code or fill in paths. npx will fetch and run it automatically. If Node.js isn't installed on your machine, go to https://nodejs.org and install the LTS version (just click Next all the way through).

If you're 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 index.html core script, 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 via npx lingshu-solver

  • test/ — regression suite + smoke tests + three resident exam sets


Capability boundaries (honest statement)

Dimension

Description

Verified solutions

Every solution found is certified by Krawczyk (tier=proven), error ≤ certification radius, mathematically faithful

Exhaustiveness

Best-effort exhaustion of multiple solutions; extremely ill-conditioned cases (highly singular Jacobian, very close solution clusters) may miss individual solutions within budget, in which case truncated=true is explicitly flagged — never claims to be exhaustive when it isn't

truncated semantics

Only means "the global branch could not fully decide all boxes within budget (exhaustiveness cannot be proven)", not necessarily a miss; 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 give domain to avoid pruning failure

Determinism

No random branches; same input always yields same output

Deployment

Fully 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.


Using as an MCP tool

1. Run the server

node mcp-server.js

2. Configure in an MCP client (Claude Desktop / Cursor / Cline / VS Code, etc.)

Recommended · one-line command (requires npm publication, not yet published; for now use the clone version below):

{
  "mcpServers": {
    "lingshu-solver": {
      "command": "npx",
      "args": ["-y", "lingshu-solver"]
    }
  }
}

Note: npx lingshu-solver will only work once this package is published to npm; we're 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 args with the absolute path to your local mcp-server.js (e.g. C:/Users/你的用户名/Desktop/灵数求解器/mcp-server.js). The npx version doesn't 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 the "finite solutions · partial" demo or fast-growing functions; otherwise the default ±1e6 may fail to prune and trigger truncated.

Output precision is fixed at 6 decimal places (product spec "6-decimal finite grid"); no precision switching is provided; solution points values are grid-snapped, with actual residuals typically ≤ 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 (unproven but possibly a solution) / structural (derived structurally).

Tool 2: give_feedback

AI agents proactively report when they hit a blocker/error/suspected issue; it only lands in the local feedback.log and is never sent out:

{ "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

x^2 = 4

2 solutions

Maximum 6 variables

6-variable tridiagonal linear

unique solution

Empty set, no solution

x+y=3 and x+y=5

empty set (sound proof of no solution)

Finite solutions · all

circle × hyperbola x²+y²=4, xy=1

all 4 solutions certified

Finite solutions · partial

sin(20x)=0.5, sin(20y)=0.5 (domain [-30,30])

multiple solutions + truncated banner

Infinite solutions · recommended

x+y=3

infinite set, recommended (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.

-
license - not tested
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Precision math engine for AI agents. 203 exact methods. Zero hallucination.

  • Deterministic signed verification of numeric & financial claims for AI agents & spreadsheets.

  • AI-callable calculators and engineering models with real formulas. No hallucinated math.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/genesis-plan/lingshu-solver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server