About Mathematical Code Execution
Mathematical Code Execution is a Python-only sandbox for agent hosts that need calculations or simple PDF output. It runs code in an isolated process without network access, filesystem access, or package installation.
Key features
- 01Run allow-listed Python code
- 02Return stdout, stderr, and exit code
- 03Generate one-page PDFs with fpdf
- 04Isolated execution without network or filesystem access
- 05numpy available; no package installs
Use cases
- 01Calculate statistics from supplied data
- 02Multiply matrices with numpy
- 03Create a one-page PDF summary
MCP support
Exposes the `execute_code` tool to MCP clients through a remote Streamable HTTP server. OAuth 2.1 authentication uses PKCE and dynamic client registration.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://code-execution-mcp.saifs.ai/mcpclaude mcp add --transport http ai-saifs-code-execution https://code-execution-mcp.saifs.ai/mcp{"mcpServers":{"ai-saifs-code-execution":{"type":"http","url":"https://code-execution-mcp.saifs.ai/mcp"}}}Open in Cursor{"servers":{"ai-saifs-code-execution":{"type":"http","url":"https://code-execution-mcp.saifs.ai/mcp"}}}Open in VS Code{"mcpServers":{"ai-saifs-code-execution":{"type":"http","url":"https://code-execution-mcp.saifs.ai/mcp"}}}{"mcpServers":{"ai-saifs-code-execution":{"serverUrl":"https://code-execution-mcp.saifs.ai/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
Details
From the project READMEMathematical Code Execution
A Python-only sandbox for agent hosts. The model writes Python that prints a result (or a one-page PDF via preinstalled fpdf); this server runs it in an isolated process with no network, no user filesystem and no package installs. Other languages are refused. numpy is available; scipy and pandas are not.
| Registry name | ai.saifs/code-execution |
| Endpoint | https://code-execution-mcp.saifs.ai/mcp |
| Transport | Streamable HTTP (remote, nothing to install) |
| Auth | OAuth 2.1 — PKCE (S256) and dynamic client registration; your client opens a sign-in page on first use |
| Publisher | SAIFS AI |
Install
VS Code / GitHub Copilot
Add to .vscode/mcp.json (workspace) or your user mcp.json:
{
"servers": {
"saifs-code-execution": {
"type": "http",
"url": "https://code-execution-mcp.saifs.ai/mcp"
}
}
}
Then start the server from the MCP view and sign in when prompted.
Claude (claude.ai, Desktop)
Settings → Connectors → Add custom connector, and paste:
https://code-execution-mcp.saifs.ai/mcp
Claude Code
claude mcp add --transport http saifs-code-execution https://code-execution-mcp.saifs.ai/mcp
Any other MCP client
Point it at https://code-execution-mcp.saifs.ai/mcp using the Streamable HTTP transport. The server returns 401 with a
WWW-Authenticate: Bearer … resource_metadata=… challenge, so OAuth-aware clients sign in automatically.
Tools
| Tool | What it does |
|---|---|
execute_code | Runs allow-listed Python and returns stdout, stderr, exit code, and any PDF written with fpdf (output("name.pdf"), download link expires in 1 hour). Non-Python is rejected with a one-line warning. |
Example prompts
- “Run Python to compute the mean and standard deviation of this list and print the result.”
- “Write a short numpy snippet that multiplies these two matrices and prints the product.”
- “Generate a one-page PDF invoice summary with fpdf and give me the download link.”
Support
- Website: https://saifs.ai
- Issues: https://github.com/Saify-Technologies/saifs-ai-mcps-docs/issues
- Privacy: https://saifs.ai/privacy_policy
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.