math-anchor
Provides a safe scientific runtime for agents with typed math operations including calculus, algebra, statistics, unit conversion, and more via MCP tools.
README
Math Anchor
Math Anchor is one product with two quiet entry points:
- a native macOS calculator for people, with familiar basic/scientific input, lightweight offline physical-unit conversion, ECB reference currency conversion with visible source and freshness, a read-only calculator display, optional exact-value copy, and local history;
- a safe scientific runtime for Agents, with one-call typed execution through
math.runand optional discovery or batch tools.
Both surfaces use the same Python calculation core. The Agent catalog currently provides 31 typed operations spanning exact arithmetic, algebraic transforms, semantic and solution verification, single- and multivariable calculus, numerical roots, all-roots search, and certified interval-arithmetic global optimization, adaptive numerical integration with explicit accuracy metadata, exact and stability-aware approximate linear algebra, number theory, combinatorics, financial math, probability, descriptive and inferential statistics, unit conversion, and unit-bearing expressions. The project reuses SymPy, NumPy, mpmath, and Pint for mathematics; its own work is the safe parser, capability catalog, structured result contract, isolation boundary, human app, and Agent-facing interface.
Currency conversion is an online, human-app feature calculated from the European Central Bank's daily euro reference rates. The interface shows the source, publication time, and current or expired state; cached rates remain explicitly marked when a refresh cannot complete. These rates are informational and are not transaction quotes. Currency conversion remains an app-internal request and does not add another public MCP tool or Agent operation.
Requirements
- macOS 14 or newer;
- Xcode Command Line Tools with Swift 6;
- Python 3.11 or newer.
The repository publishes source. Downloadable macOS applications are supported only when attached to a versioned GitHub Release with a matching source tag, Developer ID signature, and Apple notarization record.
Run the macOS app
./script/bootstrap.sh
./script/build_and_run.sh
The Codex app also exposes the same command as the repository's Run action.
Use the local runtime
.venv/bin/math-anchor search calculus
.venv/bin/math-anchor describe calculus.integrate
.venv/bin/math-anchor run expression.evaluate '{"expression":"sqrt(2)","precision":50}'
Start the MCP server with:
.venv/bin/math-anchor-mcp
The installable Codex Plugin source is in plugins/math-anchor/.
script/package_runtime.sh builds the standalone mathematical runtime used by both the installed plugin and the macOS app bundle. The packaged app and plugin do not depend on this repository or its .venv after installation.
Generated runtimes are deliberately excluded from Git. Before installing the
local Plugin, run ./script/bootstrap.sh, ./script/package_runtime.sh, and
./script/check_all.sh, then select plugins/math-anchor/ in Codex's local Plugin
installation flow and start a fresh task. The four MCP tools and the calculation
Skill must become visible together.
Bootstrap accepts any available Python 3.11 or newer interpreter. Set MATH_ANCHOR_PYTHON only when selecting a specific interpreter. The Swift scripts select an installed SDK compatible with the active compiler; MATH_ANCHOR_SDKROOT is available as an explicit override.
Verify
./script/check_all.sh
This runs Python regression tests, Swift state checks/build, the four-tool MCP discovery and execution flow, and plugin validation. Human visual acceptance remains separate from those development checks.
For a GitHub-generated ZIP or tarball without .git metadata, run
./script/check_source_layout.sh --archive-clean once immediately after
extraction and before the first check_all.sh; subsequent development checks
are intentionally repeatable after the runtime has been generated.
Publishing
Publish source from a clean checkout or an unmodified GitHub-generated source
archive; do not force-add
plugins/math-anchor/runtime/, .build/, or dist/. Runtime dependencies are
exactly pinned and SHA-256 verified in requirements-runtime.lock, including
dependencies activated through package extras. Bootstrap installs the complete
development lock with pip's --require-hashes. Each generated runtime includes artifact-derived
THIRD_PARTY_NOTICES.txt, an SPDX SBOM covering bundled Python distributions,
the PyInstaller bootloader, and every standalone native library, plus an
architecture/file manifest. An unmapped native library or unpinned bundled
distribution fails packaging.
Current local .app bundles are development artifacts, not downloadable
releases. Developer ID signing and Apple notarization are mandatory gates in
script/release_macos.sh. See docs/releasing.md for the
source, Plugin, CI, per-architecture, and signed binary workflow.
Contributing and security
See CONTRIBUTING.md for setup, change boundaries, and pull request expectations, and CODE_OF_CONDUCT.md for community standards. Report vulnerabilities through GitHub private vulnerability reporting as described in SECURITY.md, never in a public issue.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。