Basis

tech.basis1由 basis1.tech 發布官方發布者v0.2.2更新於 Nov 6, 2026

The Excel engine for AI agents: read, check and edit Excel models over MCP.

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

概覽

AI 產生的概覽

Basis 讓助理透過 Basis API 解析、稽核、重算與編輯 Excel 活頁簿,並能以工作階段逐步修改輸入、讀取計算結果。

可以做什麼
  • 將活頁簿解析為 NDJSON 記錄,提交非同步解析工作、串流讀取結果,並逐儲存格比較兩份活頁簿
  • 以指定的儲存格數值計算單一 Excel 公式
  • 重算 .xlsx 並把公式結果存進檔案,可選擇寫回本機檔案
  • 以工作階段開啟活頁簿:設定輸入、讀取輸出、定義名稱、新增或重新命名工作表、開關反覆運算
  • 檢視模型結構,讀取儲存格或範圍的公式與數值,追蹤前置與後續相依,稽核錯誤與循環參照
  • 為工作階段建立檢查點並回復,匯出或快照為 .xlsx,並儲存到 Basis Library
適用情境
適合需要處理真實 Excel 模型的場合:讀取或比對活頁簿、確認公式算出什麼、修復由 openpyxl 等函式庫寫出但沒有結果的公式檔案,或對財務與規劃模型做假設調整並讀取輸出。
執行需求
需要 BASIS_API_KEY 中的 Basis API 金鑰;使用託管端點時改用 Authorization 的 bearer 標頭。本機套件需要 Node.js 20.19 以上版本並透過 npx 執行,且需要網路連線。BASIS_BASE_URL 可指向自架伺服器,BASIS_MCP_MAX_FETCH_BYTES 限制下載活頁簿的大小。
安裝前請注意
所有工具都在 Basis API 上執行:傳入的活頁簿、公式與儲存格數值會上傳到 api.basis1.tech,以 path 傳入的檔案也會被讀取並上傳。工作階段在使用期間保留在伺服器上,並會檢查點備份到私有雲端儲存;存到 Library 的檔案會一直保留直到刪除。開啟 overwrite 時重算與匯出會覆寫本機檔案。不能離開本機的活頁簿請勿使用此伺服器。

安裝

在 SourceWeft 中

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

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

交給代理程式安裝

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

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

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

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "basis": {
      "type": "http",
      "url": "https://api.basis1.tech/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

@basis1/mcp

The Excel engine for AI agents. Let AI agents read, check and edit Excel models.

An MCP server for Basis. It lets Claude, Cursor and other MCP clients parse Excel workbooks, evaluate formulas, trace dependencies, and open a workbook as a session to change inputs and read results.

Every tool runs on the Basis API. You need a Basis API key and a network connection, and the workbooks you give a tool are uploaded to the Basis API at https://api.basis1.tech. See What gets uploaded.

Install

You need Node.js 20.19 or later and a Basis API key, which you create yourself in your account settings at basis1.tech/settings. Each snippet below starts the server with npx, which downloads the package the first time.

Claude Desktop

Open Settings → Developer → Edit Config and add this to claude_desktop_config.json, then restart Claude Desktop:

json
{  "mcpServers": {    "basis": {      "command": "npx",      "args": ["-y", "@basis1/mcp"],      "env": {        "BASIS_API_KEY": "your-api-key"      }    }  }}

Claude Code

sh
claude mcp add basis --env BASIS_API_KEY=your-api-key -- npx -y @basis1/mcp

Add --scope user to use it in every project, or --scope project to share it through the project's .mcp.json. In a shared file, write "BASIS_API_KEY": "${BASIS_API_KEY}" so each person's key comes from their own environment.

Cursor

Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project:

json
{  "mcpServers": {    "basis": {      "command": "npx",      "args": ["-y", "@basis1/mcp"],      "env": {        "BASIS_API_KEY": "your-api-key"      }    }  }}

Other MCP clients

Configure a stdio server with the command npx and the arguments -y @basis1/mcp, and set BASIS_API_KEY in its environment. On Windows, if your client can't start npx directly, use the command cmd with the arguments /c npx -y @basis1/mcp.

Without installing anything: the hosted endpoint

If your client supports remote MCP servers over HTTP with custom headers, you can connect to the hosted endpoint directly instead of running this package:

json
{  "mcpServers": {    "basis": {      "type": "http",      "url": "https://api.basis1.tech/mcp",      "headers": { "Authorization": "Bearer your-api-key" }    }  }}

In Claude Code: claude mcp add --transport http basis https://api.basis1.tech/mcp --header "Authorization: Bearer your-api-key".

It offers the same tools, except that it can't read files on your computer: pass a url or base64 instead of a path. This package adds path support by reading the file on your machine and uploading it for you.

Settings

VariableDefaultWhat it does
BASIS_API_KEYnone (required)Your Basis API key. Without it the server still starts, and every tool tells you the key is missing.
BASIS_BASE_URLhttps://api.basis1.techThe Basis API to use, for example a self-hosted server. It must use https:// unless it points at localhost, so your key is never sent unencrypted.
BASIS_MCP_MAX_FETCH_BYTES200000000The largest workbook a tool will download when you pass a url.

BASIS_TOKEN, the old name for the key, still works and logs a reminder to rename it.

If a setting is invalid, the server doesn't start: it writes what to fix to stderr, which your MCP client shows in its server logs (Claude Desktop: Settings → Developer, or ~/Library/Logs/Claude/mcp-server-basis.log on macOS). The server writes diagnostics only to stderr, because stdout carries the MCP protocol, and it never prints your key.

npx -y @basis1/mcp --help lists these settings, and --version prints the version.

Tools

Workbook inputs accept exactly one of path (a file on your computer), url or base64.

Parsing

  • parse_workbook: returns the workbook as NDJSON records (workbook_meta, sheet, cell, edge, image, image_summary, audit). Large files run as a background job and are polled to completion for you.
  • submit_job: starts a parse job and returns its handle (job_id, status_url, stream_url) without waiting.
  • get_job_status: the status of a job.
  • stream_job: the NDJSON output of a finished job, optionally from record since.
  • diff_workbooks: cell-level differences between two workbooks: added, removed and changed cells (value and/or formula), with format-only changes listed separately. Takes before_* and after_* inputs and include_format.

Formulas

  • evaluate_formula: evaluates one Excel formula against cell values you pass, for example {"formula": "NPV(0.08,A1:A5)", "data": {"A1": 100, ...}}. Supports 278 Excel functions, including financial, statistical, lookup and dynamic-array functions.

Recalculating a file

  • recalc_workbook: takes an .xlsx (path, url or base64) and returns it with computed values saved in every formula cell, plus the same error summary. Call it after you create or edit a workbook with openpyxl (or any library that saves formulas without results): without it, pandas, openpyxl data_only=True and other readers that are not Excel see empty cells. It replaces running LibreOffice's recalc.py. Pass output_path to write the result on your computer; the same path as the input with overwrite: true recalculates a file in place. The file is uploaded for the calculation and not kept.

Both file-returning tools carry over what Basis does not model (styles, charts, images, data validation, conditional formats, defined names, comments, VBA in .xlsm) byte for byte. What cannot be kept is listed under summary.warnings: per-word formatting inside a cell's text, what-if data tables, and the cached results of multi-cell array formulas. Formulas Basis cannot compute are listed under summary.uncomputed instead of being saved blank without notice.

Workbook sessions. A session holds one workbook open on the Basis API so you can change it step by step.

  • create_session: opens a workbook from path, url, base64 or your Library (library_file_id), or starts a blank one. Optional calc turns on iterative calculation. A local path travels inside one request, so files over about 24 MB can't open as a session yet; parse_workbook handles large files.
  • list_sessions, close_session.
  • set_inputs: sets values or formulas by defined name or cell reference, recalculates, and reports which named outputs changed.
  • get_outputs: reads computed values by name, cell reference or range (Sheet1!H2:H18), or every defined name.
  • define_variable: creates or retargets a defined name.
  • add_sheet: adds a sheet to a blank workbook.
  • rename_sheet: renames a sheet; formulas, defined names and validations that point at it follow the new name.
  • set_calc_settings: turns iterative calculation on or off for circular models.
  • inspect_model: sheets, defined names, calculation settings and statistics, optionally with the dependency graph.
  • get_cell_formula, get_formula_range: formulas and values for one cell or a range.
  • trace_dependencies: precedents and dependents of a cell, up to 5 levels deep.
  • audit_workbook: a structural audit (errors, broken references, cycles, named ranges).
  • commit_session, restore_session: named checkpoints and rollback.
  • export_workbook: recalculates the session and returns it as an .xlsx with every formula's computed value saved in the file, plus a summary of formula errors (#REF!, #DIV/0!, #NAME? with sheet and cell). Pass output_path to write the file on your computer instead of getting base64 back (overwrite: true to replace an existing file).
  • snapshot_session: the current workbook as .xlsx bytes (base64), no summary. Prefer export_workbook.
  • save_to_library: saves the workbook to your Basis Library as a new file or a new version.

Tool errors come back as a tool result with isError set and a JSON body {"code", "message", "status"}, for example missing_api_key, unauthorized, network_error, session_not_found or one of the API's error codes.

What gets uploaded

  • Parsing and diffing: the workbook is sent to the Basis API. Parse jobs and their results are kept in the server's memory only and expire after 15 minutes.
  • Formulas: the formula and the cell values you pass are sent to the Basis API.
  • Sessions: the workbook is uploaded when you create the session and stays on the Basis API while you work. A session closes after 30 minutes without use, or when you call close_session. So that sessions survive server restarts, their state is also checkpointed to private cloud storage, which deletes checkpoints within a day.
  • Library: save_to_library stores the workbook in your Library until you delete it.
  • Files on your computer: a tool reads a path you pass and uploads that file's contents. It reads nothing else.
  • URLs: this package downloads a url you pass to parse_workbook, submit_job or diff_workbooks on your machine and uploads the bytes. For sessions, the Basis API downloads the URL itself.

All traffic uses HTTPS, with your API key in the Authorization header. If your workbooks can't leave your machine, don't use this server with them.

Development

From a checkout of this repository:

sh
(cd ../sdk && npm ci && npm run build)  # @basis1/parse, linked as file:../sdknpm cinpm run build                            # typecheck, then bundle dist/index.jsnpm test                                 # unit, hosted forwarding and stdio handshake testsnpm run test:pack                        # pack, install in a temp dir, MCP handshake over stdio

To run your build against another Basis server, for example a self-hosted one:

sh
BASIS_API_KEY=devtoken BASIS_BASE_URL=http://localhost:8080 node dist/index.js

How the package is built

dist/index.js is a single esbuild bundle that includes @modelcontextprotocol/sdk and zod (both MIT). As runtime dependencies they would install 95 packages (23 MB) on every first npx run, including web-server frameworks a stdio server never uses. Bundled, npx installs two packages and runs the exact versions we tested. Their license texts ship in dist/THIRD_PARTY_LICENSES.txt, and the build fails if a bundled package isn't permissively licensed.

@basis1/parse is a real runtime dependency, not bundled. In the repository it's file:../sdk. The release process rewrites that to ^<sdk version> before publishing, and scripts/check-publishable.mjs refuses a package that still has a local path.

Releasing

Releases are published by the maintainers. When a change touches both packages, the SDK is released first, then the MCP server, which depends on the published SDK version. version is kept in sync between package.json and server.json.

MCP Registry

server.json describes this server for the MCP Registry as tech.basis1/mcp, and mcpName in package.json links the npm package to it. The tech.basis1/ namespace belongs to the basis1.tech domain rather than a personal GitHub account, so the registry verifies it through DNS. Nothing is submitted automatically.

The maintainers list each release in the registry after the npm publish, signing in with mcp-publisher login dns --domain basis1.tech. The tech.basis1/ namespace is verified through a DNS record on basis1.tech.

License

Apache-2.0. See LICENSE.

來源:mcp/README.md,提交 7e0f9c8

工具

26

parse_workbook

Parse workbook

Parse an .xlsx workbook and return the full semantic NDJSON output (workbook_meta, sheet, cell, edge, image, image_summary, audit records).

輸入參數urlbase64webhook_url

submit_job

Submit parse job

Submit an .xlsx workbook for async parsing and get back a job handle (job_id, status_url, stream_url) without waiting for it to finish.

輸入參數urlbase64webhook_url

get_job_status

Get job status

Check the status of a parse job submitted via submit_job.

輸入參數job_id必填

stream_job

Stream job output

Fetch the NDJSON output of a completed parse job. Pass `since` to resume from a record index.

輸入參數sincejob_id必填

diff_workbooks

Diff workbooks

Compare two .xlsx workbooks and return the cell-level differences as JSON. Cells are joined on (sheet title, cell ref) and classified into added, removed, and changed (value and/or formula), with format-only changes bucketed separately. Provide exactly one of before_url/before_base64 and one of after_url/after_base64.

輸入參數after_urlbefore_urlafter_base64before_base64include_format

evaluate_formula

Evaluate formula

Evaluate an Excel formula locally and return the computed result: a quick way to check what a formula returns on a few sample values before you put it in a workbook. Pass data as a map of cell references to values (e.g. {"A1": 100, "A2": 200, "B1": "hello"}) and a formula string (e.g. "SUM(A1:A2)"). The formula is placed in row 1 of the first column right of your data, so don't reference that cell. A formula that evaluates to an Excel error returns type "error" with the code (#VALUE!, #N/A…) as a normal result; a formula that can't be parsed or uses an unsupported function is a tool error. Supports 278 Excel functions: math, financial (NPV, IRR, XIRR, PMT…), statistical, lookup, date/time, text, logical, and dynamic arrays (FILTER, SORT, UNIQUE, SEQUENCE…). Array expressions evaluate element by element inside SUMPRODUCT, LOOKUP, AGGREGATE, SMALL/LARGE, MATCH and INDEX. To check formulas that already live in a workbook, use create_session instead.

輸入參數dataformula必填

create_session

Create session

Create a persistent computation session for a workbook. Pass library_file_id to load from the Library, base64 for raw xlsx bytes, url to fetch from a URL, or omit all for a blank model. Returns a session_id for subsequent calls. The workbook is recalculated on load, including formulas written by other tools that carry no cached values, so open a file you have edited to read back what its formulas compute (get_outputs, get_formula_range), or change inputs with set_inputs.

輸入參數urlcalcbase64document_idlibrary_file_id

close_session

Close session

Close a computation session and release its resources.

輸入參數session_id必填

list_sessions

List sessions

List all active computation sessions for the current user.

無需輸入參數。

add_sheet

Add sheet

Add a new sheet to a session's workbook. The new sheet becomes the active sheet. Only works on sessions created from blank documents (not imported xlsx files).

輸入參數name必填session_id必填

rename_sheet

Rename sheet

Rename a sheet in a session's workbook. Formulas, named ranges and validations that reference the sheet are rewritten to the new name, so results don't change. Excel's rules apply: 1-31 characters, none of : \ / ? * [ ], no leading or trailing apostrophe, unique ignoring case.

輸入參數name必填session_id必填sheet_index必填

set_inputs

Set inputs

Set one or more cells in a session and recalculate. Keys can be defined names (e.g. "Revenue") or cell references (e.g. "Sheet1!A1"). A string starting with "=" is stored as a formula, so you can also try a formula in place and read the result with get_outputs. Returns the applied changes and which named outputs changed (effects).

輸入參數inputs必填session_id必填

set_calc_settings

Set calc settings

Turn iterative calculation on or off for a session and recalculate. Needed for circular models (e.g. development pro formas where loan size depends on cost, which includes the loan's interest and fees): with it on, set_inputs re-converges the loop on every call. Saved with the session's next commit (restore_session to an earlier commit rolls it back) and written to the workbook, so an exported xlsx iterates in Excel too.

輸入參數iterative必填max_changesession_id必填max_iterations

get_outputs

Get outputs

Read computed values from a session, e.g. to check what the formulas in a workbook return. Pass defined names, cell refs ("B4", "Sheet1!B4") or ranges ("Sheet1!H2:H18", one entry per cell), or omit to read all defined names. A cell that evaluates to an Excel error is returned with type "error", not as a tool failure.

輸入參數namessession_id必填

define_variable

Define variable

Create or retarget a named variable in the session's workbook. The name can then be used in set_inputs and get_outputs instead of cell references.

輸入參數name必填refers_to必填session_id必填scope_sheet

inspect_model

Inspect model

Inspect a session's model structure: sheets, defined names, cell/formula counts, and optionally the full dependency edge graph.

輸入參數session_id必填include_edges

snapshot_session

Snapshot session

Export the session's current state as xlsx bytes (base64). Optionally creates a commit first. To get the file for a user or a non-Excel reader, with formula errors listed, prefer export_workbook.

輸入參數session_id必填commit_message

export_workbook

Export workbook

Get a session's workbook back as an .xlsx file with every formula's computed value saved in it. Recalculates first. Call this when you need the file itself: to give it to the user, or to read it with pandas, openpyxl (data_only=True) or any tool that is not Excel. Returns file_base64 and a summary of formula errors (#REF!, #DIV/0!, #NAME? with sheet and cell) and of anything that did not survive the save. Everything Basis does not model (styles, charts, images, data validation, defined names, comments, VBA) is carried over from the original file unchanged.

輸入參數session_id必填

recalc_workbook

Recalculate workbook

Recalculate an .xlsx file and return it with the computed values saved in every formula cell. Use this after you create or edit a workbook with openpyxl or any other library that writes formulas without results: those files have no cached values, so pandas, openpyxl (data_only=True) and other readers see empty cells until the file is recalculated. Replaces running LibreOffice recalc.py. Returns file_base64 plus a summary of formula errors (#REF!, #DIV/0!, #NAME?, #VALUE!... with sheet and cell) and of formulas Basis could not compute: fix those and call again. Styles, charts, images, data validation, defined names, comments and VBA are carried over unchanged. Pass exactly one of url or base64.

輸入參數urlbase64filename

get_formula_range

Get formula range

Batch-read formulas and computed values for a rectangular range of cells: the way to check what the formulas in a file compute. Returns {cell, formula, value, value_type} per cell; a formula that errors has value_type "error". Much more efficient than calling get_cell_formula repeatedly.

輸入參數range必填session_id必填

commit_session

Commit session

Create a named checkpoint of the session's current state. Returns the commit ID which can be passed to restore_session to roll back. Checkpoints live in the session only; to keep one in the Library's version history, call save_to_library after it (the version takes this message as its name).

輸入參數message必填session_id必填

restore_session

Restore session

Roll back a session to a previous commit. Reverts all cell changes made since that commit. Returns the number of cells that were changed by the rollback.

輸入參數commit_id必填session_id必填

get_cell_formula

Get cell formula

Return the formula text and computed value for a single cell. If the cell has no formula (constant or empty), formula will be null.

輸入參數cell必填session_id必填

trace_dependencies

Trace dependencies

Trace the dependency graph from a cell. direction="precedents" shows what feeds into this cell; direction="dependents" shows what this cell feeds. Returns a BFS traversal up to the given depth with formula text and computed value at each node.

輸入參數cell必填depthdirection必填session_id必填

audit_workbook

Audit workbook

Run a structural audit on the session's workbook. Returns formula errors, broken references, circular dependencies, hardcoded plugs, and verification mismatches.

輸入參數session_id必填

save_to_library

Save to Library

Save the session's workbook to the user's Library for durable storage. If the session was loaded from the Library or was previously saved, this creates a new version of that file. Otherwise it creates a new Library file. Returns the library_file_id. Each save is a named version in the Library's history: pass `message`, or it takes the latest commit_session message since the last save. commit_session checkpoints themselves stay in the session, so save after each step you want kept as a version.

輸入參數namemessagesession_id必填

版本歷史

3
  1. v0.2.2最新Nov 6, 2026
  2. v0.2.1Nov 5, 2026
  3. v0.1.0Nov 4, 2026

評分

已滿足適用檢查項的 100%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分