SageMath MCP Server
by XBP-Europe
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SAGEMATH_MCP_STARTUP | No | Sage code executed during session bootstrap. | from sage.all import * |
| SAGEMATH_MCP_IDLE_TTL | No | Seconds of inactivity before a session is culled. | 900 |
| SAGEMATH_MCP_MAX_STDOUT | No | Maximum characters of stdout returned per call. | 100000 |
| SAGEMATH_MCP_PURE_PYTHON | No | When set to 1, load math stdlib instead of Sage modules. | unset |
| SAGEMATH_MCP_SAGE_BINARY | No | Path to the sage executable. | sage |
| SAGEMATH_MCP_EVAL_TIMEOUT | No | Per-evaluation timeout in seconds. | 30 |
| SAGEMATH_MCP_SHUTDOWN_GRACE | No | Grace period before a stuck worker is terminated. | 2 |
| SAGEMATH_MCP_SECURITY_ENABLED | No | Enable/disable AST-based code validation. | true |
| SAGEMATH_MCP_FORCE_PYTHON_WORKER | No | Use the pure-Python worker (helpful for tests/CI). | false |
| SAGEMATH_MCP_SECURITY_MAX_SOURCE | No | Maximum source length in characters. | 8000 |
| SAGEMATH_MCP_SECURITY_ALLOW_IMPORTS | No | Permit import statements when set to true. | false |
| SAGEMATH_MCP_SECURITY_FORBID_GLOBAL | No | Block global statements when true. | true |
| SAGEMATH_MCP_SECURITY_MAX_AST_DEPTH | No | Maximum AST depth allowed. | 75 |
| SAGEMATH_MCP_SECURITY_MAX_AST_NODES | No | Maximum AST node count allowed. | 2500 |
| SAGEMATH_MCP_SECURITY_LOG_VIOLATIONS | No | Emit warnings when code is blocked. | true |
| SAGEMATH_MCP_SECURITY_ALLOWED_IMPORTS | No | Comma-separated allowlist of importable modules. | math,cmath,statistics,base64,io,sage,sage.all |
| SAGEMATH_MCP_SECURITY_FORBID_NONLOCAL | No | Block nonlocal statements when true. | true |
| SAGEMATH_MCP_SECURITY_ALLOWED_IMPORT_PREFIXES | No | Comma-separated prefixes treated as safe namespaces. | sage. |
Capabilities
Server capabilities have not been inspected yet.
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
No 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 | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/XBP-Europe/sagemath-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server