Skip to main content

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

Project description

mcp-parigp

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

PyPI Python Coverage Ruff

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

Install

pip install mcp-parigp

Usage

As MCP Server

Run directly:

mcp-parigp

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

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

In Python

from mcp_parigp import eval_expression, factor, isprime

# Evaluate PARI/GP expressions
result = eval_expression("factor(100)")
print(result)  # [[2, 2], [5, 2]]

# Factor integers
print(factor(100))  # [[2, 2], [5, 2]]

# Test primality
print(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

git clone https://github.com/daedalus/mcp-parigp.git
cd mcp-parigp
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_parigp-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_parigp-0.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_parigp-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_parigp-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_parigp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d77786696ec5d7d3ba22c472e858d58b84ec63b7b170f62815c116934ebbd9ad
MD5 2ac3f2448f6e8acec4a69858daf30bed
BLAKE2b-256 8672d3fed9d285830cbcd7f91fa9557963fbc0dbec85c9c94414303f913eb241

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_parigp-0.1.0.tar.gz:

Publisher: pypi-publish.yml on daedalus/mcp-parigp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_parigp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_parigp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_parigp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04171dbb7dc16a580bde5486c653104ee9f63c7952017c65176a0df4c5105ee7
MD5 456055670601240acd71e67488688e4f
BLAKE2b-256 7945aff3b8f325a2298db2ba35df327f7926dd7af376b123b2c2457b5f84145a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_parigp-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on daedalus/mcp-parigp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page