# Mcp Parigp

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

- **Type:** MCP server
- **Install:** `agentstack add mcp-daedalus-mcp-parigp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [daedalus](https://agentstack.voostack.com/s/daedalus)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [daedalus](https://github.com/daedalus)
- **Source:** https://github.com/daedalus/mcp-parigp

## Install

```sh
agentstack add mcp-daedalus-mcp-parigp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# mcp-parigp

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

[](https://pypi.org/project/mcp-parigp/)
[](https://pypi.org/project/mcp-parigp/)
[](https://codecov.io/gh/daedalus/mcp-parigp)
[](https://github.com/astral-sh/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 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

```bash
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/
```

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [daedalus](https://github.com/daedalus)
- **Source:** [daedalus/mcp-parigp](https://github.com/daedalus/mcp-parigp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-daedalus-mcp-parigp
- Seller: https://agentstack.voostack.com/s/daedalus
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
