sagemath-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SAGE_MCP_BIN | No | A full path to the sage executable. On Windows a path beginning with '/' is understood as being inside WSL. | |
| SAGE_MCP_USE_WSL | No | Force the choice of using WSL on Windows. Set to '1' or '0'. | |
| SAGE_MCP_WSL_DISTRO | No | Picks a specific WSL distro when Sage is found inside WSL on Windows. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| graph_infoA | Basic invariants of a graph: order, size, connectivity, girth, edges. Use this first when you need to know what a graph is before asking sharper questions about it. |
| is_matching_coveredA | Is the graph matching covered: connected, with every edge in some perfect matching? |
| is_bicriticalA | Is the graph bicritical: does G - u - v have a perfect matching for every pair of distinct vertices u, v? |
| is_brickA | Is the graph a brick: 3-connected and bicritical? Reports the two conditions separately, so a negative answer says which one failed. |
| is_efecA | Is the graph essentially 4-edge-connected (efec)? True when no three pairwise non-adjacent edges disconnect the graph. When False, the answer includes the disconnecting triple that witnesses it. |
| is_efec_cubic_brickA | Is the graph an essentially-4-edge-connected cubic brick? Checks cubic, then essentially 4-edge-connected, then brick, stopping at the first failure and naming it in "failed_check". |
| is_near_bipartiteA | Is the graph near-bipartite? True when some pair of non-adjacent edges can be removed to leave a bipartite matching covered graph; that pair comes back as the witness. |
| is_edge_binvariantA | Is the edge (u, v) of a brick b-invariant, or quasi-b-invariant? Only defined for bricks. Also returns the nontrivial barriers of G - e. |
| classify_edgesA | Split every edge of a brick into b-invariant and quasi-b-invariant. Each quasi-b-invariant edge is reported with the two nontrivial barriers of G - e. Only defined for bricks. |
| has_qbinv_edgesB | Does this brick have any quasi-b-invariant edges? Returns the count and the edges themselves. |
| has_cyclic_edge_cutA | Does the graph have a cyclic edge cut of size exactly k? That is, a vertex bipartition (S, T) with exactly k crossing edges where neither induced subgraph is a forest. Both shores come back as a witness. The search is exhaustive over 2^(n-1) bipartitions, so it is refused above max_order vertices; raise max_order to search anyway. |
| cyclic_edge_connectivityA | Smallest k in [kmin, kmax] for which the graph has a cyclic k-edge-cut. That value is the graph's cyclic edge connectivity when it falls inside the search range; a null answer means none was found and kmax should be raised. |
| analyzeA | Run every check at once and return one summary of the graph. Cheap checks first; checks that do not apply are skipped with a reason (b-invariance needs a brick, for instance). Prefer this for open-ended questions such as "what can you tell me about this graph?" or "is this a near-bipartite essentially-4-edge-connected cubic brick?". |
| list_named_graphsA | Every graph in the registry that can be referred to by name. Returns name, aliases, order, size, graph6 string and a short note for each. |
| identify_graphA | Is this graph one of the registry's named graphs, up to isomorphism? Useful for a bare graph6 string that may be a relabelling of a well-known graph. |
| run_sageA | Run arbitrary SageMath code and return its stdout, stderr and exit status. An escape hatch for questions the typed tools do not cover. Print what you want to see; nothing is returned implicitly. Runs in a fresh Sage process, so it cannot see or disturb state from the other tools. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 16 tools
The tools cover overlapping graph-theoretic concepts (e.g., is_efec, is_efec_cubic_brick, has_cyclic_edge_cut, cyclic_edge_connectivity all relate to edge connectivity), which may cause some misselection. However, each tool has a distinct focus and the descriptions are detailed enough to clarify most differences.
Most tools follow a clear snake_case pattern with prefixes like is_, has_, classify_, list_, identify_, run_. A few outliers like cyclic_edge_connectivity and graph_info are noun phrases rather than verb phrases, creating a slight inconsistency but not a major one.
16 tools is slightly above the ideal 3-15 range but still reasonable for a specialized graph analysis server. The tools cover a broad set of related properties without being excessively redundant.
The tool set covers many graph properties and includes run_sage for arbitrary computations, making it functionally complete. However, there are some specific checks (e.g., near-bipartite, brick, efec) that are covered, but not all possible graph invariants, so it is not exhaustive.