Mathematical Code Execution

ai.saifs由 saifs.ai 發布官方發布者v1.0.1更新於 Oct 30, 2026

Run sandboxed Python for calculations and PDFs; no other languages, installs or network.

發布方自己的服務:Customer Intelligence & Segmentation

已驗證Streamable HTTP可網頁執行開發者工具資料與分析

概覽

AI 產生的概覽

遠端 MCP 伺服器,在沙箱中執行白名單內的 Python,讓助理完成計算或產生單頁 PDF。

可以做什麼
  • 執行 Python 程式碼片段並回傳標準輸出、標準錯誤與結束碼
  • 使用 numpy 進行平均值、標準差、矩陣相乘等計算
  • 以預先安裝的 fpdf 產生單頁 PDF,並回傳有時效的下载連結
  • 遇到非 Python 程式碼直接拒絕並給出一行提示
適用情境
適合需要真正執行算術、統計或 numpy 運算而非估算的情境,也適合讓助理產生發票摘要之類的小型 PDF。不適合其他程式語言、安裝套件、存取網路或讀取使用者檔案。
執行需求
遠端 Streamable HTTP 端點,本機無需安裝。需要 OAuth 2.1 登入(PKCE 與動態用戶端註冊),用戶端首次使用時會開啟登入頁面。在支援 MCP 的用戶端(如 VS Code、Claude、Claude Code)中設定該端點位址。
安裝前請注意
登入會為此伺服器建立與你帳號綁定的 OAuth 工作階段。程式碼在無網路、無使用者檔案系統、無法安裝套件的沙箱中執行,僅支援 Python 及 numpy、fpdf。PDF 下载連結一小時後失效,需及時取得。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mathematical Code Execution,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/ai.saifs%2Fcode-execution/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "mathematical-code-execution": {
      "type": "http",
      "url": "https://code-execution-mcp.saifs.ai/mcp"
    }
  }
}

README

Mathematical 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 nameai.saifs/code-execution
Endpointhttps://code-execution-mcp.saifs.ai/mcp
TransportStreamable HTTP (remote, nothing to install)
AuthOAuth 2.1 — PKCE (S256) and dynamic client registration; your client opens a sign-in page on first use
PublisherSAIFS AI

Install

VS Code / GitHub Copilot

Add to .vscode/mcp.json (workspace) or your user mcp.json:

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

bash
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

ToolWhat it does
execute_codeRuns 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

來源:servers/code-execution/README.md,提交 f5c0037

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

2
  1. v1.0.1最新Oct 29, 2026
  2. v1.0.0Oct 22, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Saifs 整合