Mcp Parigp

io.github.daedalus由 GitHub 账号 daedalus 发布v0.1.0更新于 Nov 10, 2026

MCP server exposing cypari2 (PARI/GP) number theory library

已验证STDIO仅桌面AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器,封装 cypari2(PARI/GP)数论库,让助手执行精确的数学计算。

可以做什么
  • 整数分解、素性判定,以及最大公约数、欧拉函数、除数和、雅可比符号、阶和素数序列
  • 多项式运算:求根、构造分圆多项式、求导与代换
  • 数域及其理想的初始化与运算,椭圆曲线初始化及 Frobenius 迹、挠子群和高度
  • 矩阵运算:单位矩阵、行列式、逆矩阵和秩
  • 计算初等三角函数、双曲函数、指数、对数及常数
适用场景
适合助手需要精确或符号化的数论与代数结果时使用,例如整数分解、素性检验、多项式与数域计算、椭圆曲线,而不是近似数值答案。
运行要求
作为本地进程在桌面运行,通过 pip 从 PyPI 安装 mcp-parigp,并用 mcp-parigp 命令启动;依赖 cypari2/PARI 库。未声明任何账号、API 密钥、环境变量或请求头。
安装前请注意
不涉及凭据或写入操作。大整数分解、数域初始化或椭圆曲线运算等重计算可能很慢且占用大量 CPU,超大输入可能使助手的工具调用长时间无响应。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Parigp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-parigp

MCP server exposing cypari2 (PARI/GP) number theory library

[PyPI] [Python] [Coverage] [Ruff]

mcp-name: io.github.daedalus/mcp-parigp

Install

bash
pip install mcp-parigp

Usage

As MCP Server

Run directly:

bash
mcp-parigp

Or use with an MCP client by configuring in your settings:

json
{  "mcpServers": {    "mcp-parigp": {      "command": "mcp-parigp"    }  }}

In Python

python
from mcp_parigp import eval_expression, factor, isprime
# Evaluate PARI/GP expressionsresult = eval_expression("factor(100)")print(result)  # [[2, 2], [5, 2]]
# Factor integersprint(factor(100))  # [[2, 2], [5, 2]]
# Test primalityprint(isprime(29))  # True

API

Number Theory

  • factor(n) - Factor an integer
  • isprime(n) - Test if n is prime
  • gcd(a, b) - Greatest common divisor
  • phi(n) - Euler's totient function
  • sigma(n, k) - Sum of k-th power of divisors
  • jacobi(a, n) - Jacobi symbol
  • znorder(x, n) - Multiplicative order modulo n
  • primes(n) - First n primes
  • nextprime(n) - Next prime after n

Polynomials

  • polroots(pol) - Find roots of polynomial
  • polcyclo(n) - n-th cyclotomic polynomial
  • deriv(pol) - Derivative of polynomial
  • subst(pol, v, expr) - Substitute in polynomial

Number Fields

  • nfinit(pol) - Initialize number field
  • bnfinit(pol) - Initialize with Buchmann's algorithm
  • idealadd(nf, a, b) - Add ideals
  • idealmul(nf, a, b) - Multiply ideals

Elliptic Curves

  • ellinit(eq) - Initialize elliptic curve
  • ellap(E, p) - Trace of Frobenius at p
  • elltors(E) - Torsion subgroup
  • ellheight(E, P) - Canonical height

Matrices

  • matid(n) - n×n identity matrix
  • matdet(m) - Matrix determinant
  • matinv(m) - Matrix inverse
  • matrank(m) - Matrix rank

Elementary Functions

  • sin, cos, tan, asin, acos, atan
  • sinh, cosh, tanh, asinh, acosh, atanh
  • exp, log, sqrt, abs
  • pi(), euler(), I()

Development

bash
git clone https://github.com/daedalus/mcp-parigp.gitcd mcp-parigppip install -e ".[test]"
# run testspytest
# formatruff format src/ tests/
# lintruff check src/ tests/
# type checkmypy src/

来源:README.md,提交 3a8a1b6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分