Skip to main content
Glama
丝路E投财务引擎 MCP 适配层

丝路E投财务引擎 MCP 适配层

by chang0911

丝路E投财务引擎 MCP 适配层

纯转发适配层:把 21 个财务工具的调用请求转发至丝路E投技能网关。 本仓库不含任何财务算法与业务数据——财务模型引擎本体由丝路E投云端托管。

接入配置

{
  "mcpServers": {
    "slgj-finance": {
      "command": "python3",
      "args": ["server.py"],
      "env": { "SLGJ_TOKEN": "sk-mcp-****" }
    }
  }
}

SLGJ_TOKEN 填你的丝路E投调用令牌:www.slgj.cn → 注册/登录 → 个人中心 → AI接入 → 生成专用令牌。

适配层做三件事:

  1. 向客户端暴露 21 个工具(清单从网关实时拉取,自动跟随平台更新);

  2. 把 tools/call 原样转发到远端 MCP 端点;

  3. 按下方规则解析并携带调用令牌。

远端端点(默认):https://www.slgj.cn/skills-api/api/v1/mcp · 传输:Streamable HTTP(POST/JSON 档)

Related MCP server: Financial Modeling Prep MCP Server

令牌从哪来

优先级

来源

适用场景

1

工具参数 _token(转发前自动剥离)

客户端不支持自定义请求头时,按会话传入

2

环境变量 SLGJ_TOKEN

托管部署(实例级共享)或本机运行

两者都缺省时:tools/list 免鉴权仍可拉取目录;tools/call 会收到网关 401 提示。

⚠️ 令牌即账户凭证:不要把真实令牌提交进任何公开仓库;托管部署的实例级令牌请自行评估共享范围,正式多用户场景推荐各用户本地运行(下文方式二)或直连远程端点。

方式一:魔搭 ModelScope 托管部署

  1. ModelScope → MCP 部署服务 → +新建部署(或 MCP 广场 → 创建 MCP Server);

  2. 来源选本仓库(GitHub 地址),托管类型选云端可用;

  3. 环境变量配置:SLGJ_TOKEN = 你的丝路E投令牌;

  4. 部署完成后在广场/实验场连接使用。

方式二:本地运行(stdio,推荐给正式用户)

pip install -r requirements.txt
SLGJ_TOKEN=*** python3 server.py

客户端配置(通用 mcpServers 结构):

{
  "mcpServers": {
    "slgj-finance": {
      "command": "python3",
      "args": ["/path/to/server.py"],
      "env": { "SLGJ_TOKEN": "sk-mcp-****" }
    }
  }
}

方式三:Streamable HTTP 模式(可选)

pip install -r requirements.txt uvicorn starlette
python3 server.py --http 0.0.0.0:8000

客户端连 http://<host>:8000。此模式下也可用自定义请求头携带用户令牌。

方式四:不部署,直连远程(最简单)

支持自定义请求头的客户端无需本适配层,直接:

{
  "mcpServers": {
    "slgj-finance": {
      "url": "https://www.slgj.cn/skills-api/api/v1/mcp",
      "headers": { "Authorization": "***" }
    }
  }
}

环境变量

变量

默认

说明

SLGJ_TOKEN

无

调用令牌(实例级兜底,可被参数 _token 覆盖)

SLGJ_ENDPOINT

官方端点

远端 MCP 端点,一般无需修改

SLGJ_TIMEOUT

300

单次转发超时秒数(不确定性分析完整模式需 1-3 分钟)

已知约束

  • 远端仅提供 Streamable HTTP 的 POST/JSON 档(不提供 SSE);

  • 八个成品类工具首次调用需经 get_protocol_instructions 握手(72 小时内有效),客户端模型会自动完成;

  • 按次计费在远端账户体系完成,失败自动退款。

许可

MIT。丝路E投名称、标识与云端服务不在本许可范围内。

Available Tools

21 tools
estimate_etou_jsonB

估算转E投格式:估算数据JSON → construction_data.json(平台侧数据对接用)。前置:需先调 get_protocol_instructions。

Inputs: estimate (required), project_info.

estimate_excelA

投资估算:估算数据JSON → 三表Excel(估算表/汇总/技术经济指标,全公式),返回 file_base64(默认返回72h下载短链,return_mode="base64" 可回退)。格式规范先看 get_skill_instructions(skill=estimate)。前置:需先调 get_protocol_instructions。

Inputs: estimate (required), file_name, return_mode.

fast_calc_excelA

快速测算成品:5类txt → 12表全公式Excel(E投口径)。默认返回72h下载短链(file.url,防大文件撑爆上下文),return_mode="base64" 可回退(超10万字符自动降级短链)。前置:需先调 get_protocol_instructions。

Inputs: files (required), file_name, return_mode.

fast_calc_reportsA

财务测算:5类输入txt → 16键JSON(11张报表+指标+IRR/MIRR诊断+资金缺口)。_meta.years=年份轴;financial_ratios=行清单[序号,指标名,月口径,年口径];其余报表=年度矩阵{行名:{年份:数值}}。整体约50~60KB,若客户端响应上限50KB会被截断(尾部表丢失):可传 tables="表名1,表名2" 分批拉取(省流且截断自检),完整表名清单=invest_exp_fundraising/debt_repayment_schedule/cost_expense_stat/revenue_stat/tax_stat/profit_distribution_stat/cash_flow_stat/balance_sheet/project_invest_cash_flow/investor_cash_flow/financial_ratios;返回JSON末位 complete:true=完整,缺失即被截断(重拉或分批)。数字必须原样引用,禁止自行换算。irr_health/warnings 提示 IRR 未收敛失灵时,以年口径 IRR 与修正后 MIRR 为主判据。

Inputs: files (required), tables.

fast_calc_solveA

指标反算(秒级,二分法+引擎精算):给定5类输入txt与目标指标值(如全投资税后IRR=8%),反推收入/成本/建设投资的调整幅度。杠杆(knob):revenue_pct 收入整体±% / cost_pct 成本整体±% / invest_pct 建设投资±%(含税金额+进度款同步等比+闭合守卫)。目标(target):irr_all_post/irr_all_pre/irr_cap_post/irr_cap_pre/irr_inv_pre/payback/dpayback/npv_all_post/npv_all_pre/npv_cap_post/npv_cap_pre/npv_inv_pre/npvr/pi(14项,IRR%/NPV万元/回收期月同报表原生口径)。want:down(默认,降到目标)/up(升到目标)。建议先用 fast_calc_reports 查看基准值再反算。返回语义:ok=true+nochange=true=已达标无需调整(见 msg);ok=false+reason=range=探索范围内无解(message 含当前值→可达极限值,应如实告知用户并建议换杠杆或结构性调整);k 逼近±90%/+300% 边界时 note 附⚠️边界警告(返回边界最优解而非精确达标解)。

Inputs: goal (required), knob (required), files (required), target (required), +1 more.

generate_dashboardA

财务看板(动态资金流演绎+双口径动态偿债能力分析)→ 单文件HTML(约1.1MB,侧边栏导航:总览/动态资金流演绎/敏感性热力/双口径动态偿债能力,ECharts内联可离线查看),返回 file_base64(约1.1MB大文件,默认返回72h下载短链(return_mode="base64" 可回退))。两种用法二选一:①推荐 input 传完整五类输入(project_basic_info/construction_data/revenue_data/cost_data/financing_data 的 .txt),由平台引擎计算标准11张报表(与平台后续分析同源同口径,勿自行拼装报表);②reports 传E投原生导出的11张标准报表txt+input附 project_basic_info.txt(自行拼装的精简表会被守门拦截)。

Inputs: input (required), reports, return_mode.

generate_ppt_htmlA

演示文稿封装:内容HTML → 自包含HTML(Plotly.js内联,离线可用)。先用 ppt_extract_data 取数并撰写内容,再调本工具出成品(成品常达2~4MB,默认返回72h下载短链(return_mode="base64" 可回退))。HTML结构要求先看 get_skill_instructions(skill=ppt)。前置:需先调 get_protocol_instructions。

Inputs: content_html (required), file_name, return_mode.

generate_word_reportA

Word报告双管线:report_type=gongwen(默认)=通用公文格式,标题+内容块数组;report_type=feasibility/econ=可研/经济评价报告;report_type=national=国民经济评价专项报告(10章标准目录+national_data{benefits,costs,rate}与 run_national_econ 输入同构,附表自动组装)——平台可研技能标准(正文四号字、封面、目录、11张附表自动组装、图表标准渲染;专业版60-75页/简版30-40页),传 report+charts,附表数据源三选一 p_id/files(五类输入,推荐——引擎直算标准11张全年份轴)/reports。章目录与标准硬校验(可研8章/经济评价6章,名称顺序不可改,不符拒收并返回标准目录);正文数字自动与引擎值域比对(number_audit.unmatched 清单=疑似换算/编造,须改回引擎原值);数字占位符(推荐):{{章节.键.年份}} 由系统从引擎值直灌(键名=get_chapter_data 各章 data 键,chapter=list 查清单),数字零漂移。默认返回72h下载短链(return_mode="base64" 可回退)。gongwen 模式 content_blocks 每块:标题/正文 {"type":"heading1|heading2|heading3|body","text":"..."};说明行 {"type":"info","label":"口径","value":"万元"}(或 {"type":"info","text":"..."});表格 {"type":"table","headers":["列1","列2"],"rows":[["a","b"]]}(也接受 header/columns 别名、[[表头行],[数据行]...] 整体二维数组、竖线分隔文本)。

Inputs: p_id, files, stage, title, +12 more.

get_chapter_dataA

报告章节取数:可研报告(feasibility,8章)或经济评价报告(econ,6章)按章节返回结构化数据+写作要点,供撰写后走 generate_word_report 出稿。chapter=list 先看目录;数据源 p_id(+stage) 或 reports 对象(无平台项目号时可先 fast_calc_reports 生成11张表再传入)。数字一律引用返回值。模板先看 get_skill_instructions(skill=feasibility_report|econ_report)。 各章返回的 data 键可作 generate_word_report 段落占位符 {{章节.键[.年份|.total]}}(比率可|pct)——数字由系统直灌,推荐用。

Inputs: report_type (required), p_id, files, stage, +2 more.

get_protocol_instructionsA

读取Agent接入总则(目录结构/文件命名/落盘存档/成品命名强制规范)。调用 fast_calc_excel 前必须先读(记录72小时内有效)。

Inputs: no named parameters.

get_skill_instructionsC

读取技能工作流指令模板:nlmodel=快速测算、estimate=投资估算、ppt=演示文稿、permitted_cost=准许成本定价、national_econ=国民经济评价。

Inputs: skill (required).

match_cost_indicatorsA

造价指标匹配:子项/工程描述 → 平台指标库候选指标(名称/单位/指标值/备注,按相关度排序)。投资估算时逐子项先调本工具匹配,禁止编造指标库中不存在的造价指标;全量指标库不下发,仅返回匹配候选。

Inputs: query (required), top_k.

permitted_cost_excelA

准许成本加合理收益定价:定价数据JSON → 全公式Excel(主表+固定资产+无形资产+有效资产+运营维护费+准许收益+趋势/敏感性,补贴模式含对外收入+政府补贴定价)。返回 file_base64(默认返回72h下载短链,return_mode="base64" 可回退)。数据收集五步与schema先看 get_skill_instructions(skill=permitted_cost)。前置:需先调 get_protocol_instructions。

Inputs: data (required), file_name, return_mode.

ppt_extract_dataA

演示文稿取数:E投报表txt → 结构化数据JSON(供撰写PPT文稿内容,不必手抄报表数字)。dimension: all|debt|profit|investment|cashflow|operation。前置:需先调 get_protocol_instructions。

Inputs: reports (required), dimension.

query_usageA

用量统计:查询自己当月(或指定 YYYY-MM)的调用量/下行流量/平均耗时与分端点统计。

Inputs: month.

run_delivery_bundleA

一键交付流水线(推荐给外部Agent):5类输入txt → Excel(12表)+财务看板+敏感性分析(quick≈20s)+可选Word报告,成品全部72h短链。耗时25-30s(含word≈28s),建议客户端超时≥60s。单件失败不中断:返回 files 成功件清单+errors 失败明细。report 提供合规结构(econ 6章/feasibility 8章标准目录+免责句)时追加 Word。前置:需先调 get_protocol_instructions。

Inputs: files (required), quick, report, file_name, +1 more.

run_model_checkA

报表勾稽体检:E/A/F/B/C/D六段73项勾稽校验(恒等式/跨表一致性/财务逻辑/表内构成/行业易错点/综合评价评级),秒级返回逐项结果(✅通过/⚠️提示/❌失败/ℹ️信息)。两种用法:①传 p_id(+stage) 按平台项目号定位自己的项目;②直接传 reports 对象(可子集,缺的报表自动标数据缺失)。无平台项目号时可先 fast_calc_reports 生成11张表再传入。交付前自检或向用户展示报表质量用。

Inputs: p_id, stage, reports.

run_national_econA

国民经济评价:效益/费用数组(第0年起,万元,影子价格口径,剔除税收/补贴/国内利息等转移支付)→ ENPV/EIRR/BCR/累计净效益+可行性判定,默认附单因素敏感性与多情景对比。效益费用识别与影子价格调整方法先看 get_skill_instructions(skill=national_econ)。

Inputs: costs (required), benefits (required), rate, sensitivity.

run_revenue_reviewA

收入费用合理性审查:R收入(5项)/C费用(6项)/X交叉(5项)共16项,🔴明显不合理/🟡需关注/🟢正常/ℹ️数值输出待联网对标(需benchmark/地方定价的项已给测算数值与判定阈值,宿主AI联网比对后可自行定级)。双输入:p_id(+stage) 或 reports 对象(无平台项目号时可先 fast_calc_reports 生成11张表再传入)。

Inputs: p_id, stage, reports.

run_uncertaintyA

不确定性分析:引擎真算敏感性/情景/蒙特卡洛+总报告。两种用法:①p_id(+stage) 定位自己的平台项目,交付物落盘用户工作区并返回文件清单;②files 直传5类输入txt(无平台项目号场景,可由 fast_calc_reports 造数闭环产出),成品入平台文件库返回72h下载短链清单(url 可直接交给用户浏览器下载)。不回base64。耗时1~3分钟,超时设≥300秒。前置:需先调 get_protocol_instructions。

Inputs: p_id, files, quick, range, +3 more.

submit_feedbackA

提交用户反馈(2026-09-12 新增):宿主AI在用户对工具/结果/平台表达不满、建议或疑问时调用,把反馈转录落库(平台侧每日巡检处理)。content=用户原话或忠实摘要(勿加入AI自己的推测);涉及具体失败时附 tool 与 rid(从报错返回里取)。告知用户已记录。低门槛:无需先读总则。

Inputs: content (required), rid, tool, contact.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools have a clearly distinct output (JSON reports vs Excel vs dashboard vs Word/PPT vs pipeline), so the agent can often tell them apart. However, several tools share the identical '5类输入txt' input and similar names (fast_calc_reports, fast_calc_excel, run_delivery_bundle; estimate_etou_json vs estimate_excel), and the two instruction readers (get_protocol_instructions vs get_skill_instructions) could be confused, though the descriptions do help resolve this.

    Naming Consistency3/5

    There is a strong verb_noun convention for most tools (query_usage, get_*, run_*, generate_*, submit_feedback). But a competing 'domain-prefix + artifact' convention exists (fast_calc_reports, fast_calc_excel, estimate_excel, permitted_cost_excel, ppt_extract_data), so the surface mixes two readable but different patterns.

    Tool Count3/5

    21 tools is borderline heavy for a single server and reflects a broad suite spanning estimation, pricing, national econ, reporting, checks and solving. Each tool maps to a specific artifact, but the count pushes toward the '16-25 feels heavy' band and includes some near-duplicative output variants.

    Completeness4/5

    The surface covers a full financial-modeling lifecycle: protocol/skill instructions, data extraction and matching, calculation, solving, uncertainty, delivery bundles, Word/PPT/dashboard output, model and revenue checks, usage stats and feedback. Only minor gaps remain (e.g. no explicit lifecycle delete/update semantics, and some verification depends on external benchmark lookups).

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables developers to expose product operations as model-callable tools over stdio or Streamable HTTP with bearer-token auth, per-client rate limits, host allow-listing, structured call logging, and a swappable backend for secure, testable deployments.
      3
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to query 250+ financial data tools spanning stocks, ETFs, cryptocurrencies, forex, commodities, economics, technical indicators, and SEC filings. Supports dynamic, static, and all-tools modes over HTTP/SSE transport, with hosted or self-hosted deployment via npm and Docker.
      624 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to access and analyze financial data, stock information, company fundamentals, and market insights through 250+ tools covering equities, ETFs, crypto, forex, commodities, and economics. It supports dynamic toolset loading and can be hosted or self-hosted over HTTP/SSE.
      624 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to access and analyze 250+ financial data tools covering stocks, ETFs, crypto, forex, commodities, economics, and more, with runtime toolset management and hosted or self-hosted HTTP/SSE deployment.
      624 npm
      Apache 2.0