Mcp Parigp

io.github.daedalusPublished by GitHub account daedalusv0.1.0Updated Nov 10, 2026

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

VerifiedSTDIODesktop onlyAI & ML

Overview

AI-generated overview

Local MCP server that exposes the cypari2 (PARI/GP) number theory library, letting an assistant run exact mathematical computations.

What you can do
  • Factor integers, test primality, and compute GCDs, totients, divisor sums, Jacobi symbols, orders and prime sequences
  • Work with polynomials: find roots, build cyclotomic polynomials, differentiate and substitute
  • Set up number fields and their ideals, and initialize elliptic curves with Frobenius traces, torsion and heights
  • Compute with matrices: identity, determinant, inverse and rank
  • Evaluate elementary trigonometric, hyperbolic, exponential, logarithmic and constant functions
When to use it
Useful when an assistant needs exact or symbolic number theory and algebra results — factoring, primality checks, polynomial and number field work, elliptic curves — rather than approximate numeric answers.
Requirements
Runs as a local process on the desktop, installed from PyPI with pip (mcp-parigp) and started with the mcp-parigp command; it depends on the cypari2/PARI library. No accounts, API keys, environment variables or headers are declared.
Before you install
No credentials or write actions are involved. Heavy computations such as factoring large integers, number field initialization or elliptic curve operations can be slow and CPU-intensive, so very large inputs may stall the assistant's tool call.

Installation

In SourceWeft

  1. Open Mcp Parigp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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/

Source: README.md at commit 3a8a1b6

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts