Skip to main content
Glama

Fermat MCP

This project provides a FastMCP server for mathematical computations, including numerical and symbolic calculations, as well as plotting.

Modules

1. mpl_mcp - Matplotlib Integration

Feature

Description

plot_barchart

Plots bar charts of given data values

plot_scatter

Creates scatter plots from data points

plot_chart

Plots line, scatter, or bar charts

plot_stem

Creates stem plots for discrete data

plot_stack

Generates stacked area/bar charts

eqn_chart

Plots mathematical equations

2. numpy_mcp - NumPy Integration

Category

Operations

Basic Math

add, sub, mul, div, power, abs, exp, log, sqrt

Trigonometric

sin, cos, tan

Statistics

mean, median, std, var, min, max, argmin, argmax, percentile

Linear Algebra

dot, matmul, inv, det, eig, solve, svd

Matrix Operations

create, zeros, ones, full, arange, linspace

Array Manipulation

reshape, flatten, concatenate, transpose, stack

3. sympy_mcp - SymPy Integration

Category

Operations

Algebra

simplify, expand, factor, collect

Calculus

diff, integrate, limit, series

Equations

solve, solveset, linsolve, nonlinsolve

Matrix Operations

create, det, inv, rref, eigenvals

Related MCP server: mcp-sympy

Setup

Requirements

Clone the repository

git clone https://github.com/abhiphile/fermat-mcp

Visual Studio Code, Windsurf

You can find the mcp.json file in the MCP: Open User Configuration or MCP: Open Workspace Configuration

vs-code-1

Add the following to your mcp.json:

{
  "mcpServers": {
    "fmcp": {
      "command": "bash",
      "args": ["MCP_SERVER_ABSOLUTE_PATH/setup.sh"],
      "description": "fmcp server is for mathematical computations, including numerical and symbolic calculations, as well as plotting."
    }
  }
}

Claude (Anthropic)

If you're using Claude or the Anthropic MCP client, add this working MCP configuration to your mcp.json (update the directory path to your local clone):

{
  "mcpServers": {
    "fmcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/home/ty/Repositories/fermat-mcp",
        "run",
        "server.py"
      ]
    }
  }
}

Gemini CLI

  • Open your Gemini settings JSON located in ~/.gemini/settings.json where ~ is your home directory.

  • Add the following to your settings.json:

{
  "mcpServers": {
    "fmcp": {
      "command": "bash",
      "args": ["MCP_SERVER_ABSOLUTE_PATH/setup.sh"],
      "description": "fmcp server is for mathematical computations, including numerical and symbolic calculations, as well as plotting."
    }
  }
}

Installing via Smithery

To install Fermat MCP for local usage automatically via Smithery:

npx -y @smithery/cli install @abhiphile/fermat-mcp --client gemini

Example Usage

  • Using Gemini CLI

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│  > Can you use fmcp server and using numpy method find the eigen values of this 8*8 matrix,                  |
│    2 1 3 1 1 8 4 2                                                                                           |
│    6 6 0 7 1 4 6 1                                                                                           │
│    9 2 1 8 7 9 9 0                                                                                           │
│    2 5 6 6 9 8 0 1                                                                                           │
│    1 3 6 2 3 8 8 1                                                                                           │
│    9 4 2 2 1 2 2 9                                                                                           │
│    8 6 4 4 2 0 2 8                                                                                           │
│    0 0 0 6 6 7 5 6                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
 │ ✔  numpy_mcp_numerical_operation (fmcp MCP Server) {"a":[[2,1,3,1,1,8,4,2],[6,6,0,7,1,4,6,1],[9,2,1,8,7,9,9,0],[2,5,6,6,9,8,0,1],[1,3,… │
 │                                                                                                                                         │
 │    {"eigenvalues":["32.077244457548815+0j","-11.531090644775198+0j","-6.6653982146786195+0j","0.6715984762411508+3.37024850             │
 │    10270413j","0.6715984762411508-3.3702485010270413j","4.541270555490195+2.776364664923869j","4.541270555490195-2.77636466             │
 │    4923869j","3.6935063384423428+0j"],"eigenvectors":[["-0.23263835483680192+0j","-0.2264723575289234+0j","-0.4308391916391             │
 │    0195+0j","-0.012346573390129022+0.17748655663058255j","-0.012346573390129022-0.17748655663058255j","-0.21221572277027187             │
 │    +0.3524396218277479j","-0.21221572277027187-0.3524396218277479j","0.3451499664861578+0j"],["-0.31955742545335186+0j","-0             │
 │    .2569860493445581+0j","0.05691886770041556+0j","-0.35591013681869693-0.2242364092694275j","-0.35591013681869693+0.224236             │
 │    4092694275j","0.1932161673963751-0.39527849111641133j","0.1932161673963751+0.39527849111641133j","-0.7979681696063214+0j             │
 │    "],["-0.46626263247473404+0j","-0.4684914620112376+0j","0.5469400556350749+0j","0.34325164099973565+0.06607019711949293j             │
 │    ","0.34325164099973565-0.06607019711949293j","0.21312270185159682+0.28822307710358636j","0.21312270185159682-0.288223077             │
 │    10358636j","0.42707422750984786+0j"],["-0.41589316441674523+0j","0.2291771012892302+0j","0.09410792992600435+0j","0.6375             │
 │    92441360358+0j","0.637592441360358+-0j","0.46446646137729414+0j","0.46446646137729414+-0j","0.08171661775583623+0j"],["-             │
 │    0.35812884189789035+0j","-0.26551071423139044+0j","-0.649979374400915+0j","-0.2999153430497845+0.20110182336747695j","-0             │
 │    .2999153430497845-0.20110182336747695j","0.04424367733961273-0.020400357434930304j","0.04424367733961273+0.0204003574349             │
 │    30304j","-0.037276545325188024+0j"],["-0.3042416233100104+0j","0.4027405071320744+0j","0.2343447346668298+0j","-0.119224             │
 │    87219398595+0.10317726668781271j","-0.11922487219398595-0.10317726668781271j","-0.3387759141362585+0.15790241128043445j"             │
 │    ,"-0.3387759141362585-0.15790241128043445j","0.11473144194899779+0j"],["-0.35389732755448017+0j","0.5359362131480812+0j"             │
 │    ,"0.13989902586074168+0j","-0.16008513226461316-0.26111873108374495j","-0.16008513226461316+0.26111873108374495j","0.055             │
 │    729749650881726-0.22748184206919145j","0.055729749650881726+0.22748184206919145j","-0.19838514696566653+0j"],["-0.327615             │
 │    5213691367+0j","-0.30122843153433887+0j","0.07858579556736099+0j","0.00042251379361638556-0.11670182367986544j","0.00042             │
 │    251379361638556+0.11670182367986544j","-0.18590228871569267-0.2479130526139182j","-0.18590228871569267+0.247913052613918             │
 │    2j","-0.03374593856285834+0j"]]}                                                                                                     │
 ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ Of course, I can do that. Here are the eigenvalues for the given matrix:

  32.077244457548815
  -11.531090644775198
  -6.6653982146786195
  0.6715984762411508 + 3.3702485010270413j
  0.6715984762411508 - 3.3702485010270413j
  4.541270555490195 + 2.776364664923869j
  4.541270555490195 - 2.776364664923869j
  3.6935063384423428
  • Using Visual Studio Code, Windsurf Here the task was to plot both x**2 and sin(x) in the same plot. GUI Demo 1-2 GUI Demo 2-2

Available Tools

12 tools
mpl_mcp_eqn_chartD

Plots mathematical equations

Inputs: equations (required), x_min, x_max, num_points, +11 more.

mpl_mcp_plot_barchartD

Plots barchart of given datavalues

Inputs: values (required), labels, title, xlabel, +5 more.

mpl_mcp_plot_chartC

Plots line/scatter/bar chart of given datavalues

Inputs: x_data (required), y_data (required), plot_type, labels, +9 more.

mpl_mcp_plot_scatterC

Plots scatter chart of given datavalues

Inputs: x_data (required), y_data (required), labels, title, +13 more.

mpl_mcp_plot_stackC

Plots stacked area/bar chart of given datavalues

Inputs: x_data (required), y_data (required), chart_type, labels, +9 more.

mpl_mcp_plot_stemD

Plots stem chart of given datavalues

Inputs: x_data (required), y_data (required), labels, title, +12 more.

numpy_mcp_matlib_operationC

Do matrix operations: rand-mat, zeros, ones, eye, identity, arange, linspace, reshape, flatten, concatenate, transpose, stack

Inputs: operation (required), data, shape, m, +7 more. Returns: result

numpy_mcp_numerical_operationD

Do numerical operation like add, sub, mul, div, power, abs, exp, log, sqrt, sin, cos, tan, mean, median, std, var, min, max, argmin, argmax, percentile, dot, matmul, inv, det, eig, solve, svd

Inputs: operation (required), a, b, shape, +8 more. Returns: result

sympy_mcp_algebra_operationC

Do algebraic operations like simplify, expand, factor, collect

Inputs: operation (required), expr (required), syms, rational, +14 more. Returns: result

sympy_mcp_calculus_operationC

Do calculus operations like diff, integrate, limit, series

Inputs: operation (required), expr (required), sym, n, +5 more. Returns: result

sympy_mcp_equation_operationC

Do symbolic equation operations like solve, solveset, linsolve, nonlinsolve

Inputs: operation (required), equations (required), symbols, domain, +6 more. Returns: result

sympy_mcp_matrix_operationC

Do symbolic matrix operations like create, det, inv, rref, eigenvals

Inputs: operation (required), data (required), rational, nrows, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.6/5.0

    Scored across 12 tools

    Disambiguation3/5

    The tools are grouped by library (mpl, numpy, sympy) with clear distinctions between groups, but within groups there is significant overlap. For example, mpl_mcp_plot_chart can plot line/scatter/bar charts, making mpl_mcp_plot_barchart and mpl_mcp_plot_scatter partially redundant. Similarly, numpy_mcp_numerical_operation includes matrix operations that overlap with numpy_mcp_matlib_operation, and sympy tools have some functional overlap (e.g., equation solving appears in multiple places). Descriptions help, but agents may struggle to choose between overlapping tools.

    Naming Consistency4/5

    Naming follows a consistent pattern of library_prefix_mcp_domain_operation (e.g., mpl_mcp_plot_chart, numpy_mcp_matlib_operation). All tools use snake_case consistently. Minor deviations exist, such as 'matlib' vs 'matrix' in numpy tools and slight variations in domain terms (e.g., 'algebra_operation' vs 'calculus_operation'), but the overall structure is predictable and readable.

    Tool Count4/5

    With 12 tools, the count is reasonable for a mathematical/plotting server covering multiple libraries (matplotlib, numpy, sympy). It's slightly on the higher side but justified by the broad scope. Each tool groups related functionalities, though some consolidation might reduce overlap. The count aligns well with the server's purpose of providing mathematical operations and visualizations.

    Completeness4/5

    The server covers key mathematical domains: plotting (multiple chart types), numerical operations (basic and advanced), symbolic algebra, calculus, and matrix operations. There are minor gaps, such as no explicit tool for statistical distributions beyond basic stats in numpy, and plotting tools might lack 3D or specialized visualizations. However, core workflows for mathematical analysis and visualization are well-supported, with no major dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that provides mathematical calculations and operations using NumPy, enabling users to perform numerical computations like matrix operations, statistical analysis, and polynomial fitting directly through Claude.
      3
      -
    • A
      license
      C
      quality
      D
      maintenance
      An MCP server that provides access to SymPy's symbolic mathematics library for advanced algebraic computations. It enables users to perform complex tasks such as symbolic simplification, calculus, equation solving, matrix operations, and number theory.
      100
      45 PyPI
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Python-based MCP server providing mathematical computation tools and plotting utilities for a wide range of math topics including calculus, matrix operations, statistics, and more.
      22
      13 PyPI
      5
      MIT