Agentstack Mcp

io.github.inity13由 GitHub 帳號 inity13 發布v1.0.1更新於 Oct 27, 2026

Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.

已驗證Streamable HTTP可網頁執行效率與工作流金融資料與分析

概覽

AI 產生的概覽

確定性的推理工具組,讓助理執行假設情境模擬、依加權準則排序選項,並精確計算財務與業務指標。

可以做什麼
  • 依範本或自訂模型執行情境模擬,並進行敏感度、損益兩平與並列比較分析
  • 依加權準則排序具名選項,輸出評分矩陣、兩兩比較與權重穩健性檢驗
  • 精確計算業務與財務數學:SaaS 指標、貨幣換算、工作日、複利成長、淨現值、內部報酬率、貸款攤還與折舊
  • 串接三個領域:為預測現金流估值、依模擬結果排序選項、對決策做壓力測試
  • 查詢能力、範本、指標與評分方法清單,並檢查服務健康狀態
適用情境
適合需要可重現、可稽核數字而非粗略估算的情境:成長與定價的假設推演、多準則方案選擇、SaaS 或財務指標計算,以及方案估值與壓力測試。
執行需求
可使用託管端點(免安裝),或以 Node.js 透過 npx 在本機以 stdio 執行 npm 套件。託管免費層不需金鑰,但每個 IP 每天限 20 次呼叫;付費方案會核發 API 金鑰,透過 X-API-Key 標頭傳送。本機 stdio 服務可用 AGENTSTACK_PROFILE 環境變數限定工具子集。
安裝前請注意
託管免費層依 IP 限流,更高用量需訂閱付費方案(Starter 或 Pro)並使用 X-API-Key。情境輸入與決策資料會傳送到託管服務;若這些資料需留在本機,請改用本機 stdio 服務。工具皆為唯讀計算,不會修改外部資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agentstack Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

交給代理程式安裝

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

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

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

其他 MCP 客戶端

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

{
  "mcpServers": {
    "agentstack": {
      "type": "http",
      "url": "https://agentstack-mcp.pages.dev/mcp"
    }
  }
}

README

AgentStack MCP

One deterministic reasoning stack for AI agents — behind a single Model Context Protocol (MCP) endpoint and one API key:

simulate (ScenarioSim) → decide (DecisionMatrix) → compute (PrecisionCalc)

plus cross-domain composite tools that chain the three. Every number runs through decimal.js at 40-digit precision (never floats), so identical inputs always produce byte-identical output. The server is stateless — no database, no sessions.

AgentStack bundles three standalone MCP servers so an agent installs one server, uses one key, and can run reasoning that spans all three domains. It imports the same engines directly (no HTTP proxying) — zero added latency, no cascading failure.

🌐 Live hosted server (free, no install)

https://agentstack-mcp.pages.dev/mcp
json
{ "mcpServers": { "agentstack": {    "type": "http", "url": "https://agentstack-mcp.pages.dev/mcp" } } }

Free tier: no key, 20 calls/day per IP. Paid plans (Starter $19/mo · 8,000/day, Pro $59/mo · 80,000/day) return an API key sent as X-API-Key. One key covers all three products and the composites — about half the cost of subscribing to them separately. Landing page: https://agentstack-mcp.pages.dev.


The three namespaces (24 tools)

namespaceenginetools
sim_*ScenarioSim — what-if / scenario simulationsim_run, sim_sensitivity, sim_break_even, sim_compare, sim_list_templates
decide_*DecisionMatrix — multi-criteria decision analysisdecide, decide_score, decide_sensitivity, decide_compare_two, decide_list_methods
calc_*PrecisionCalc — exact finance/business mathcalc_metric, calc_list_metrics, calc_currency_convert, calc_business_days, calc_compound_growth, calc_npv, calc_irr, calc_loan_amortization, calc_depreciation
meta—list_capabilities, health_check

Note on two deliberately-namespaced collisions: sim_sensitivity varies scenario inputs; decide_sensitivity varies criteria weights. They are different operations — the prefix disambiguates them for the agent.

Composite tools — the reason to use the stack

Deterministic end-to-end; each chains engines that no single server bundles:

ToolPipelineWhat it does
plan_to_valuationsimulate → computeProject a scenario, take a per-period cash-flow line (cashflow_metric), and value it: NPV at a discount rate, IRR, undiscounted total. initial_investment becomes the period-0 outflow (needed for IRR).
evaluate_options_with_scenariossimulate → decideProject each option as its own scenario, then rank the options against weighted criteria drawn from the scenario outcomes (key_results).
stress_test_decisionsimulate × decideStress one scenario assumption across every option and report how often the baseline winner survives (robustness) and where it flips.

Composite responses report the pipeline they ran and carry each stage's structured output, so an agent can drill into any step.

Profiles — fight tool-selection noise

Append ?profile= to the endpoint to load only a subset:

profiletools
all (default)every tool (24)
financecalc_* + plan_to_valuation + meta
decisiondecide_* + evaluate_options_with_scenarios + stress_test_decision + meta
simulationsim_* + all composites + meta
json
{ "mcpServers": { "agentstack": {    "url": "https://agentstack-mcp.pages.dev/mcp?profile=finance" } } }

Response envelope

Namespaced tools return the exact envelope of their underlying product. Composite tools add composite, pipeline, per-stage blocks, methodology, notes, and a plain-language explanation. Errors are always structured data:

json
{ "status": "error", "error": { "type": "unknown_metric", "message": "...", "hint": "..." } }

Example — plan_to_valuation (trimmed):

json
{  "status": "success",  "composite": "plan_to_valuation",  "pipeline": ["scenariosim.run_scenario", "precisioncalc.net_present_value", "precisioncalc.internal_rate_of_return"],  "scenario": { "template": "saas_growth", "horizon": 12, "key_results": { "ending_mrr": 26982.1 } },  "cashflow_metric": "mrr",  "cashflows": [-150000, 14040, 15600, "..."],  "valuation": { "discount_rate": 0.01, "npv": 11157.386023, "irr": 0.02504, "value_creating": true },  "explanation": "Projecting 'saas_growth' over 12 month(s) and valuing the 'mrr' stream at 1%/period gives an NPV of ..."}

Project structure

agentstack-mcp/├── worker-src/│   ├── index.mjs           # Cloudflare Pages Function: MCP transport, namespacing, profiles, billing│   ├── composites.mjs      # the 3 cross-domain tools (simulate -> decide -> compute)│   ├── billing.mjs         # Stripe + KV: one key / one quota for the whole stack│   └── engines/            # vendored, unmodified product engines (100% deterministic)│       ├── scenariosim.mjs│       ├── decisionmatrix.mjs│       └── precisioncalc.mjs├── server.mjs              # local stdio MCP server (same engines + composites; AGENTSTACK_PROFILE env)├── site/                   # landing page + mcp.json + llms.txt + _worker.js (built)├── tests/composites.test.mjs├── examples/agent_example.mjs├── scripts/sync-engines.sh # re-vendor engines from the sibling repos├── package.json · wrangler.toml · server.json · smithery.yaml · Dockerfile · LICENSE└── README.md

Why vendor the engines? So this repo is self-contained and reproducible. The engines are the same deterministic modules that power the three standalone servers; npm run sync-engines re-copies them from the sibling repos when an upstream change lands.


Run it locally

bash
git clone <your-fork> agentstack-mcp && cd agentstack-mcpnpm installnpm test                      # composite-logic tests (no network)npm run dev                   # -> http://127.0.0.1:8788/mcpnode examples/agent_example.mjs            # hosted demonode examples/agent_example.mjs http://127.0.0.1:8788node server.mjs               # dependency-light stdio server (AGENTSTACK_PROFILE=finance to subset)

Quick manual call:

bash
curl -s http://127.0.0.1:8788/mcp \  -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_capabilities","arguments":{}}}'

Install via npm (stdio, no hosting)

Run the server locally over stdio with a single command — nothing to deploy:

bash
npx -y agentstack-mcp

Claude Desktop / any stdio MCP client (claude_desktop_config.json):

json
{ "mcpServers": { "agentstack": { "command": "npx", "args": ["-y", "agentstack-mcp"] } } }

This is the same deterministic engine as the hosted server, running on your machine.

Client configuration

Cursor — ~/.cursor/mcp.json

json
{ "mcpServers": { "agentstack": { "url": "https://agentstack-mcp.pages.dev/mcp" } } }

Claude Desktop — claude_desktop_config.json (via mcp-remote)

json
{ "mcpServers": { "agentstack": { "command": "npx", "args": ["-y", "mcp-remote", "https://agentstack-mcp.pages.dev/mcp"] } } }

VS Code — .vscode/mcp.json

json
{ "servers": { "agentstack": { "type": "http", "url": "https://agentstack-mcp.pages.dev/mcp" } } }

Windsurf — ~/.codeium/windsurf/mcp_config.json

json
{ "mcpServers": { "agentstack": { "serverUrl": "https://agentstack-mcp.pages.dev/mcp" } } }

Add "headers": { "X-API-Key": "ssak_live_..." } once you have a key.


Example composite payloads

Rank growth strategies on their projected outcomes:

json
{ "name": "evaluate_options_with_scenarios", "arguments": {  "template": "saas_growth", "horizon": 12,  "options": [    { "name": "Aggressive", "inputs": { "new_customers_per_period": 60, "churn_rate": 0.05 } },    { "name": "Lean",       "inputs": { "new_customers_per_period": 20, "churn_rate": 0.02 } }  ],  "criteria": [    { "metric": "ending_mrr", "weight": 3, "direction": "benefit" },    { "metric": "total_churned_customers", "weight": 1, "direction": "cost" }  ]} }

Value a plan's MRR stream:

json
{ "name": "plan_to_valuation", "arguments": {  "template": "saas_growth", "horizon": 12,  "inputs": { "new_customers_per_period": 60, "churn_rate": 0.05, "arpu": 60 },  "cashflow_metric": "mrr", "rate": 0.01, "initial_investment": 150000} }

Stress-test the decision:

json
{ "name": "stress_test_decision", "arguments": {  "template": "saas_growth", "horizon": 12,  "options": [ { "name": "Aggressive", "inputs": { "churn_rate": 0.05 } },               { "name": "Lean", "inputs": { "churn_rate": 0.02 } } ],  "criteria": [ { "metric": "ending_mrr", "weight": 3 } ],  "stress": { "variable": "churn_rate", "variation": 0.5, "steps": 5 }} }

Deploy on Cloudflare Pages

bash
npm installnpx wrangler loginnpm run deploy      # esbuild -> site/_worker.js, then wrangler pages deploy

Runs fully free / private with no bindings or secrets (fails open on the free tier). For billing: bind a KV namespace AGENTSTACK_KV, set PRICE_STARTER / PRICE_PRO in [vars], and add Stripe secrets:

bash
wrangler pages secret put STRIPE_SECRET_KEY    --project-name agentstack-mcpwrangler pages secret put STRIPE_WEBHOOK_SECRET --project-name agentstack-mcp

Routes: /mcp (Streamable HTTP), /checkout, /success, /portal, /webhook, /metrics.

Auth & rate limiting

Enforced in worker-src/billing.mjs: identify() reads X-API-Key / Authorization: Bearer and falls back to per-IP free tier; consumeQuota() is a KV daily counter (the single gating point). One key / one quota spans the whole stack. Marked NOTE (auth) / NOTE (rate limiting) seams show where to swap in JWT/mTLS or a token-bucket. None of it touches the deterministic math.

Relationship to the standalone servers

AgentStack is additive, not a replacement. The three products keep running on their own for single-domain use:

License

MIT — see LICENSE.

來源:README.md,提交 7f659dd

工具

24

list_capabilities

Discovery: the three namespaces (sim_*, decide_*, calc_*), the cross-domain composite tools, the available ?profile= filters, and links to the standalone servers. Call this first to see everything AgentStack exposes. No parameters.

無需輸入參數。

health_check

Aggregated health/status for the whole stack (all three engines + composites). No parameters.

無需輸入參數。

sim_run

SIMULATE. Deterministic what-if projection from a template (saas_growth, pricing_change, churn_impact, cost_reduction, hiring_plan, cash_runway, unit_economics, marketing_funnel, compound_growth) or a free-form 'metrics' model. Returns per-period projections, key_results, assumptions_used, methodology, and an explanation.

輸入參數inputshorizonmetricstemplateperiod_label

sim_sensitivity

SIMULATE. Vary one or more scenario inputs and show the impact on a target output metric (one-at-a-time), with elasticity + most-influential ranking. Requires 'template' and 'variable' (or 'variables').

輸入參數maxminstepsinputsvalueshorizontemplate必填variablevariablesvariationperiod_labeltarget_metric

sim_break_even

SIMULATE. Solve for the scenario input value required to make an output metric hit a target value (deterministic bisection). Requires 'template', 'solve_for', 'target_value'.

輸入參數boundsinputshorizontemplate必填solve_for必填period_labeltarget_value必填target_metric

sim_compare

SIMULATE. Run 2-3 scenarios and compare their key_results side by side with deltas vs the first (baseline). Optional 'compare_metric' + 'goal' (max|min) picks a winner.

輸入參數goalhorizonscenarios必填compare_metricinclude_projections

sim_list_templates

SIMULATE. List every scenario template (inputs, defaults, outputs) plus the custom-model format and period labels. No parameters.

無需輸入參數。

decide

DECIDE. Rank named options against weighted criteria and return the winner, full ranking, per-criterion breakdowns, methodology, weights, and an explanation. Provide options, criteria [{name, weight, direction}], and a scores matrix. method: weighted_sum (default) | weighted_product | topsis.

輸入參數methodscores必填options必填criteria必填

decide_score

DECIDE. Return the full normalized scored matrix (per-option, per-criterion) + ranking when scores are supplied separately, without the winner narrative.

輸入參數methodscores必填options必填criteria必填

decide_sensitivity

DECIDE. Test how robust the decision winner is to changes in CRITERIA WEIGHTS (distinct from sim_sensitivity, which varies scenario inputs). Sweeps each weight +/-variation and reports a robustness score + flip points.

輸入參數stepsmethodscores必填options必填criteria必填variation

decide_compare_two

DECIDE. Head-to-head comparison of exactly two options with per-criterion win counts and margin. Pass option_a/option_b (or a 2-element options array), criteria, and scores.

輸入參數methodscores必填optionscriteria必填option_aoption_b

decide_list_methods

DECIDE. List the scoring methods (weighted_sum, weighted_product, topsis) with normalization details and when to use each. No parameters.

無需輸入參數。

calc_metric

COMPUTE. Exact business/SaaS/finance metric: ltv, cac, ltv_cac_ratio, payback_period_months, contribution_margin, gross_margin, churn_rate, mrr_growth_rate, arr, break_even_units, nrr, grr, rule_of_40, magic_number. Rates/margins are decimals (0.05=5%). Call calc_list_metrics for schemas.

輸入參數metric必填params必填currency

calc_list_metrics

COMPUTE. List every supported metric with descriptions and required/optional params. No parameters.

無需輸入參數。

calc_currency_convert

COMPUTE. Convert between major currencies (USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, INR) with Decimal precision. Static offline table by default; live/historical ECB rates via date/live=true.

輸入參數dateliveamount必填to_currency必填from_currency必填

calc_business_days

COMPUTE. Business-day arithmetic honoring weekends + regional holidays. operation: add_business_days | count_business_days | next_business_day | previous_business_day. region: US | UK | EU | NONE.

輸入參數daysregionend_dateoperation必填start_date必填custom_holidays

calc_compound_growth

COMPUTE. Compound-interest/growth math. operation: future_value | present_value | cagr. rate is annual decimal; compounding: daily|weekly|monthly|quarterly|semiannually|annually|continuous.

輸入參數rateyearscurrencyend_valueoperation必填begin_valuecompoundingfuture_valuepresent_value

calc_npv

COMPUTE. Net Present Value (discounted cash flow). NPV = sum(CF_t/(1+rate)^t); cashflows[0] is period 0 (usually the negative outlay).

輸入參數rate必填currencycashflows必填

calc_irr

COMPUTE. Internal Rate of Return: per-period rate where NPV=0 (Newton + bisection). Requires a sign change in cashflows.

輸入參數guesscashflows必填

calc_loan_amortization

COMPUTE. Level-payment loan: monthly payment, total interest, payoff, and (optional) full schedule.

輸入參數currencyprincipal必填annual_rate必填term_months必填extra_paymentinclude_schedule

calc_depreciation

COMPUTE. Asset depreciation schedule. method: straight_line | declining_balance | sum_of_years_digits.

輸入參數cost必填method必填currencysalvage_value必填useful_life_years必填

plan_to_valuation

COMPOSITE (simulate -> compute). Project a scenario, take a per-period cash-flow line from its projections ('cashflow_metric', e.g. 'mrr' or 'net_burn'), and value it exactly: NPV at a discount 'rate', IRR, and undiscounted total. Optional 'initial_investment' becomes the period-0 outflow (needed for IRR). Combines ScenarioSim + PrecisionCalc.

輸入參數rate必填inputshorizonmetricscurrencytemplate必填period_labelcashflow_metric必填initial_investment

evaluate_options_with_scenarios

COMPOSITE (simulate -> decide). Project each option as its own scenario, then rank the options against weighted criteria drawn from the scenario OUTCOMES. Provide a base 'template', an 'options' array ([{name, inputs}]), and 'criteria' ([{metric, weight, direction}]) where each metric is a scenario key_result. Combines ScenarioSim + DecisionMatrix.

輸入參數inputsmethodhorizonoptions必填criteria必填templateperiod_label

stress_test_decision

COMPOSITE (simulate x decide). Take an options-vs-scenarios decision and stress ONE scenario assumption across a range applied to every option; report how often the baseline winner survives (robustness) and where it flips. Same args as evaluate_options_with_scenarios plus 'stress': {variable, variation, steps}.

輸入參數inputsmethodstress必填horizonoptions必填criteria必填templateperiod_label

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

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

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