{
  "markdown": "# mcp-parigp\n\n> MCP server exposing cypari2 (PARI/GP) number theory library\n\n[![PyPI](https://img.shields.io/pypi/v/mcp-parigp.svg)](https://pypi.org/project/mcp-parigp/)\n[![Python](https://img.shields.io/pypi/pyversions/mcp-parigp.svg)](https://pypi.org/project/mcp-parigp/)\n[![Coverage](https://codecov.io/gh/daedalus/mcp-parigp/branch/main/graph/badge.svg)](https://codecov.io/gh/daedalus/mcp-parigp)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nmcp-name: io.github.daedalus/mcp-parigp\n\n## Install\n\n```bash\npip install mcp-parigp\n```\n\n## Usage\n\n### As MCP Server\n\nRun directly:\n```bash\nmcp-parigp\n```\n\nOr use with an MCP client by configuring in your settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-parigp\": {\n      \"command\": \"mcp-parigp\"\n    }\n  }\n}\n```\n\n### In Python\n\n```python\nfrom mcp_parigp import eval_expression, factor, isprime\n\n# Evaluate PARI/GP expressions\nresult = eval_expression(\"factor(100)\")\nprint(result)  # [[2, 2], [5, 2]]\n\n# Factor integers\nprint(factor(100))  # [[2, 2], [5, 2]]\n\n# Test primality\nprint(isprime(29))  # True\n```\n\n## API\n\n### Number Theory\n- `factor(n)` - Factor an integer\n- `isprime(n)` - Test if n is prime\n- `gcd(a, b)` - Greatest common divisor\n- `phi(n)` - Euler's totient function\n- `sigma(n, k)` - Sum of k-th power of divisors\n- `jacobi(a, n)` - Jacobi symbol\n- `znorder(x, n)` - Multiplicative order modulo n\n- `primes(n)` - First n primes\n- `nextprime(n)` - Next prime after n\n\n### Polynomials\n- `polroots(pol)` - Find roots of polynomial\n- `polcyclo(n)` - n-th cyclotomic polynomial\n- `deriv(pol)` - Derivative of polynomial\n- `subst(pol, v, expr)` - Substitute in polynomial\n\n### Number Fields\n- `nfinit(pol)` - Initialize number field\n- `bnfinit(pol)` - Initialize with Buchmann's algorithm\n- `idealadd(nf, a, b)` - Add ideals\n- `idealmul(nf, a, b)` - Multiply ideals\n\n### Elliptic Curves\n- `ellinit(eq)` - Initialize elliptic curve\n- `ellap(E, p)` - Trace of Frobenius at p\n- `elltors(E)` - Torsion subgroup\n- `ellheight(E, P)` - Canonical height\n\n### Matrices\n- `matid(n)` - n×n identity matrix\n- `matdet(m)` - Matrix determinant\n- `matinv(m)` - Matrix inverse\n- `matrank(m)` - Matrix rank\n\n### Elementary Functions\n- `sin`, `cos`, `tan`, `asin`, `acos`, `atan`\n- `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`\n- `exp`, `log`, `sqrt`, `abs`\n- `pi()`, `euler()`, `I()`\n\n## Development\n\n```bash\ngit clone https://github.com/daedalus/mcp-parigp.git\ncd mcp-parigp\npip install -e \".[test]\"\n\n# run tests\npytest\n\n# format\nruff format src/ tests/\n\n# lint\nruff check src/ tests/\n\n# type check\nmypy src/\n```\n",
  "bytes": 2671,
  "sha": "fd8bc63fd08941607618ad38d6708f3bf06929df6c9506d35e8a0313584a8888",
  "repo_slug": "daedalus/mcp-parigp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_daedalus_mcp_parigp_e9e3d7fc/readme"
}