Skip to main content
Glama
genesis-plan

lingshu-solver

by genesis-plan

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; once hongchenlingjing.com passes ICP filing we will switch to the fixed HTTPS domain https://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 npx version will be available once this package is published to npm (in progress); until then you can git clone and 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.js

MCP 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 via npx lingshu-solver

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


Related MCP server: Math MCP Server

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 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 truncated=true is explicitly flagged — never falsely claims exhaustiveness

truncated semantics

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 domain to avoid pruning failure

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)

http://159.75.154.206:3000/mcp

Any MCP client supporting Streamable HTTP, zero install

Local stdio (npx)

npx -y lingshu-solver

Node installed locally, available after npm release

Local stdio (clone)

node mcp-server.js

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

2. 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-solver will 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 args with the absolute path to your local mcp-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 trigger truncated.

Output precision is fixed at 6 decimal places (product spec "6-decimal finite grid"), no precision switching; solution points values are 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

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 · all

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

All 4 solutions certified

Finite · partial

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

Multiple solutions + truncated banner

Infinite · recommended

x+y=3

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

2 tools
give_feedbackA

AI 智能体在调用 solve 遇到卡点、错误、或认为结果有问题时,主动回报。回报内容仅落本地 feedback.log,不会外传。帮助作者持续改进。

ParametersJSON Schema
NameRequiredDescriptionDefault
contextNo可选上下文:触发场景、输入特征等。
messageYes反馈内容:遇到了什么、期望什么、实际得到什么。

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the key behavior that content is only written locally to feedback.log and not transmitted externally, which is crucial for privacy expectations. It does not address return values or side effects beyond the log write, but the most important trait is covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loads the trigger condition, then adds the local-only privacy note. Every sentence contributes usage context or a behavioral guarantee; the final sentence about helping the author improve is minor but not distracting.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple feedback tool with two straightforward parameters and no output schema, the description covers trigger, destination, privacy, and purpose. It lacks explicit instructions on what to include in the message, but the schema already covers that, so it is complete enough for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with both context and message having descriptions. The description adds little beyond the schema—it does not clarify formats or additional meaning, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool reports issues encountered when invoking solve, with specific trigger conditions and target (local feedback.log). This distinguishes it from the sibling solve tool, which is the main execution tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly specifies when to use: upon blockers, errors, or suspect results while calling solve. It implies this is a reactive reporting mechanism rather than for routine use, though it does not explicitly name alternatives or exclusions beyond solve.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

solveA

求解实数方程组的确定性数值引擎(非大模型,无随机、同输入输出可复现)。适用:需可验证、可复现的实数解(代数或 sin/cos/tan/log/exp/sqrt/abs 等常见超越函数),尤其给 AI Agent 当"不会胡说"的数学后端。不适用:纯符号推导/闭式证明、微分方程初值问题、整数/必不等于等强制约束(暂不支持)。输入:equations 为含 "=" 的方程字符串数组,如 ["x^2+y^2=25","x+y=7"];variables 可选(不填自动识别,最多6个);domain 可选(如 {"x":[-30,30]}),否则默认每变量 ±1e6。硬限制:变量 ≤6;方程 1–64 条且数量须 ≥ 变量数;单次方程文本 ≤100KB;输出固定 6 位小数(不可切换)。输出(JSON):resultType=empty(严格证无实数解)/finite(有限已验证解)/infinite(无限解集,仅给距原点最近推荐解);summary=中文一句话总览;solutions[] 每解含 values、tier(proven=Krawczyk已认证/likely/candidate)、certified、text(人类可读如"x=4.000000, y=3.000000"),残差等内部数值收在 internals 子块(机器可跳过);certified=是否全proven;recommended=距原点最近解的精简结构。truncated=true:预算内未完成全局分支判定、未证明已穷尽——不等于一定漏解,多数情况全部真解已找到;极端病态下可能遗漏个别解,可缩 domain 或提高 budget 重试。错误返回 error.type(invalid_input=输入不合法/超限,internal_error=内部异常)。遇卡点或认为结果有误,请调用 give_feedback(内容仅落本地日志,不外传)。相同输入永远返回完全相同结果,可安全缓存与重复调用。

ParametersJSON Schema
NameRequiredDescriptionDefault
domainNo显式搜索域(可选)。形如 {"x":[-30,30],"y":[-30,30]}。对"有限解·部分"演示或快增长函数(exp/sinh)建议显式给定,否则默认 ±1e6 可能剪枝失效并触发 truncated。
optionsNo高级选项(可选),如 {budget:500000, maxDepth:28}
fastModeNo快速模式(默认 false)
equationsYes方程字符串数组,如 ["x^2 + y^2 = 25", "x + y = 7"]。支持 + - * / ^ sqrt log sin cos tan exp abs,以及 in-text 域约束 "x ∈ [-30,30]"。
variablesNo变量名数组(可选)。不填则由方程文本自动识别,顺序按出现。最多 6 个。

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and delivers: determinism/reproducibility, fixed 6-decimal output (not switchable), hard limits (≤6 variables, 1–64 equations, ≥ variable count, ≤100KB), default domain ±1e6, honest truncated=true semantics (not proven exhaustive, may miss solutions in pathological cases), certification tiers (proven/likely/candidate), and error.type values. This is exemplary disclosure with no contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every clause earns its place—there is no filler—and the text is front-loaded with the core purpose and determinism guarantee before moving to inputs and outputs. The only weakness is that it is one dense unbroken paragraph; section breaks or bullets would materially improve scannability for an agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description correctly carries the full return contract: resultType enum with meanings, solutions[] structure (values/tier/certified/text/internals), certified, recommended, truncated semantics, and error types. Minor gaps remain: fastMode's trade-offs and the semantics of budget/maxDepth in options are only hinted at via the schema example.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds value beyond the schema by stating hard limits (variable/equation counts, equation-text size), the default domain of ±1e6, the constraint that equation count must be ≥ variable count, and the link between domain choice and truncation. The schema already documents formats and examples, and the description complements rather than repeats it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource — '求解实数方程组的确定性数值引擎' (deterministic numerical engine for solving real equation systems) — and explicitly contrasts itself with LLMs ('非大模型,无随机'), positioning it as a hallucination-free math backend for AI agents. It also names give_feedback as the sibling for feedback, so an agent can tell them apart without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit '适用' (suitable for) and '不适用' (not suitable for) lists: verifiable real solutions with common transcendental functions vs. symbolic derivation, ODE initial value problems, and integer/hard constraints. It further routes feedback to give_feedback, advises narrowing domain or raising budget on truncation, and endorses safe caching.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.2
    • First observedgive_feedback
    • First observedsolve

TDQS

A4.3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have completely distinct purposes: one solves equations, the other collects user feedback. There is no overlap or ambiguity between them.

Naming Consistency4/5

Both names are lowercase and verb-based, but 'solve' is a single verb while 'give_feedback' follows a verb_noun pattern. The naming is clear and predictable, with only a minor structural inconsistency.

Tool Count3/5

With only two tools, the server feels minimal but not unreasonable for a highly specialized solver. The single core tool plus a feedback auxiliary is borderline thin, though it fits the narrow domain.

Completeness5/5

The solve tool covers the full equation-solving workflow with detailed input handling, output certification, and error reporting. No obvious gaps exist for the stated purpose of providing reproducible real solutions.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Provides 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.
    21
    6
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    Provides secure mathematical computation capabilities including expression evaluation, symbolic math (derivatives, simplification), matrix operations, statistics, and unit conversion, with multi-tier acceleration through WebAssembly and WebWorkers for high-performance calculations.
    7
    71 npm
    ISC
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides exact arithmetic and verification tools using SymPy and fractions to solve math competition problems precisely. It enables users to perform rigorous calculations and export notebook-ready Python code for further analysis.
    -
  • A
    license
    A
    quality
    B
    maintenance
    Enables 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.
    8
    MIT