mcpField
F
fiori-mcp-server

fiori-mcp-server

本地服务
github.com/SAP开发工具160今天更新

关于 fiori-mcp-server

fiori-mcp-server 是 SAP Fiori 的 MCP 服务,供 AI 编码助手创建或修改 SAP Fiori 应用。它面向使用 CAP 或 OData 项目的 SAP 开发者,并可与 @cap-js/mcp-server、@ui5/mcp-server 配合使用。

主要功能

  1. 01创建 SAP Fiori elements 应用
  2. 02检索 SAP Fiori、UI5 与 OPA5 文档
  3. 03读取 SAP 系统连接并下载 OData 元数据
  4. 04分步列出并执行现有应用的修改功能
  5. 05支持自签名 SSL 证书配置

适用场景

  1. 01为 CAP 项目添加 List Report 页面
  2. 02基于 OData 服务元数据生成 Fiori 应用
  3. 03为现有 Fiori 应用启用初始加载或添加页面

MCP 相关

该项目是一个 MCP 服务,以 stdio 传输方式运行,向 MCP 客户端提供文档检索、应用生成、系统查询和应用修改等工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"sap-fiori": {
"command": "npx",
"args": [
"-y",
"@sap-ux/fiori-mcp-server"
],
"env": {
"LOG_LEVEL": "<LOG_LEVEL>",
"SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY": "<SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY>"
}
}
}
}
启动命令npx -y @sap-ux/fiori-mcp-server
需要配置的环境变量
LOG_LEVELSets logger verbosity. Allowed values: 'off', 'error', 'warn', 'info', 'debug', 'verbose', 'silly'.
SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRYSet to 'true' to opt out of SAP Fiori tools usage analytics telemetry.

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@sap-ux/fiori-mcp-server1.15.18

工具

9

收录的工具列表 · 更新于 今天

参数类型必填说明
querystring是搜索查询
maxResultsnumber否要返回的最大结果数

详细介绍

Changelog Github repo

@sap-ux/fiori-mcp-server

此软件包包含一个 Model Context Protocol(MCP)服务,可用于与 AI 编码助手集成。

该服务可帮助 AI 模型根据提示词创建或修改 SAP Fiori 应用,例如:

  • 请为我的 CAP 项目添加一个 SAP Fiori elements 列表报表应用

  • 根据 my_picture.png 生成一个新的 CAP 项目和 SAP Fiori 应用

  • 为 odata 服务 https://hostname:port/sap/opu/odata4/sap/my_v4_service?sap-client=000 生成一个新的 SAP Fiori elements 列表报表应用。

    ℹ️此提示词需要使用 Connection Manager for SAP Systems 扩展保存 SAP 系统连接。

  • 将 FCL 添加到 SAP Fiori elements 应用中

  • 为 fiori 应用启用初始加载

为获得最佳体验,我们建议将此服务与 @cap-js/mcp-server 和 @ui5/mcp-server 搭配使用。

设置

此服务使用 stdio 传输,并通过 npx 启动——无需全局安装。请在下方选择对应 MCP 客户端的章节。

注意: 将 <version> 替换为要固定使用的特定版本(例如 1.12.2)。当前发布版本请见 npm 页面。使用固定版本而非 @latest 可确保行为可复现,并避免自动获取未经测试的更新。

Claude Code

选项 A — CLI(推荐):

claude mcp add fiori-mcp -- npx --yes @sap-ux/fiori-mcp-server@<version> fiori-mcp

选项 B — 将 .mcp.json 文件放在项目根目录中:

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"]
    }
  }
}
Cline

打开 Cline 扩展设置,并在 MCP Servers 下添加服务:

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"]
    }
  }
}
Cursor

编辑(或创建)适用于相应范围的 MCP 配置文件:

  • 全局: ~/.cursor/mcp.json
  • 项目: 项目根目录中的 .cursor/mcp.json
{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"]
    }
  }
}
Windsurf

编辑 ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"]
    }
  }
}
其他客户端

对于其他任何 MCP 客户端,请使用以下基于 npx 的配置:

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"]
    }
  }
}
全局 npm 安装(任意客户端)

如果你不想使用 npx,请先全局安装此软件包:

npm install -g @sap-ux/fiori-mcp-server

然后使用 fiori-mcp 作为命令(无需 args):

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "fiori-mcp"
    }
  }
}

规则

以下规则有助于引导 AI 模型正确使用此服务。请将其添加到系统提示词或规则文件中:

  • Claude Code: 项目根目录中的 AGENTS.md 或 CLAUDE.md
  • Cline: Cline 扩展设置中的自定义指令
  • Cursor: 项目根目录中的 .cursorrules
  • Windsurf: 全局规则或项目级 .windsurfrules
## Rules for creation or modification of SAP Fiori elements apps

- When asked to create an SAP Fiori elements app check whether the user input can be interpreted as an application organized into one or more pages containing table data or forms, these can be translated into a SAP Fiori elements application, else ask the user for suitable input.
- The application typically starts with a List Report page showing the data of the base entity of the application in a table. Details of a specific table row are shown in the ObjectPage. This first Object Page is therefore based on the base entity of the application.
- An Object Page can contain one or more table sections based on to-many associations of its entity type. The details of a table section row can be shown in an another Object Page based on the associations target entity.
- The data model must be suitable for usage in a SAP Fiori elements frontend application. So there must be one main entity and one or more navigation properties to related entities.
- Each property of an entity must have a proper datatype.
- For all entities in the data model provide primary keys of type UUID.
- When creating sample data in CSV files, all primary keys and foreign keys MUST be in UUID format (e.g., `550e8400-e29b-41d4-a716-446655440001`).
- When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available.
- When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function.
- When previewing the SAP Fiori elements application use the most specific `npm run watch-*` script for the app in the `package.json`.

可用工具

search_docs

根据给定查询搜索 SAP Fiori elements、注释、UI5、OPA5 指南和 SAP Fiori tools 文档。

注意:搜索结果基于最新索引的 UI5 文档版本

首次使用时下载: search_docs 使用本地文本嵌入模型(all-MiniLM-L6-v2,约 86 MB)进行语义搜索。首次使用时会从 HuggingFace Hub 下载模型,并在本地缓存(位置遵循 HF_HOME / TRANSFORMERS_CACHE 环境变量,默认为 ~/.cache/huggingface/hub)。后续启动时会从缓存加载模型,无需网络连接。

list_fiori_apps

扫描指定目录,查找可修改的现有 SAP Fiori 应用。

list_sap_systems

列出用户环境中存储的所有 SAP 系统(例如 SAP Fiori tools 系统存储)。用户在调用 download_odata_service_metadata 或生成 Fiori 应用之前按名称提及 SAP 系统时,请使用此工具。

download_odata_service_metadata

从 SAP 系统下载特定 OData 服务的 EDMX 元数据,并将其保存为 metadata.xml。用户提供 SAP 系统引用或服务 URL 时,请在调用 generate_fiori_app_odata 之前使用此工具。

generate_fiori_app_odata

为 OData(非 CAP)项目生成新的 SAP Fiori UI 应用,例如基于 ABAP RESTful Application Programming Model 的 OData 服务。

generate_fiori_app_cap

在现有的 SAP Cloud Application Programming Model (CAP) 项目中生成新的 SAP Fiori UI 应用。

list_functionality(第 1 步,共 3 步)

获取现有 SAP Fiori 应用支持的修改功能列表。需要提供有效的应用绝对路径。

支持的修改包括:

  • 在应用中添加和删除页面
  • 添加和修改控制器扩展
  • 根据应用修改 manifest.json 属性,例如,根据编程模型的灵活性添加布局或启用初始加载
get_functionality_details(第 2 步,共 3 步)

获取用于修改现有 SAP Fiori 应用的特定功能所需的参数和详细信息。

execute_functionality(第 3 步,共 3 步)

使用提供的参数执行特定功能,以修改现有 SAP Fiori 应用。

日志记录

默认情况下,日志记录在 error 级别启用。若要调整日志级别或完全禁用日志记录,可以在配置中使用 env 属性。

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes","@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"],
      "env": {
        "LOG_LEVEL": "debug"
      }
    }
  }
}

支持以下日志级别:off、error、warn、info、debug 和 verbose。

日志存储在文件系统中的 ~/.fioritools/fiori-mcp-server.log

处理自签名 SSL 证书

如果需要 MCP 服务使用自签名 SSL 证书连接到 OData 服务,可以使用以下方法之一。

如果遇到 unable to get local issuer certificate 等错误,这些方法会很有用。

选项 1:添加自定义 CA 证书(推荐)

将 NODE_EXTRA_CA_CERTS 环境变量设置为 CA 证书文件的路径。Node.js 支持多种文件扩展名(.pem、.crt、.cer、.cert)。

配置示例:

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"],
      "env": {
        "NODE_EXTRA_CA_CERTS": "/path/to/your/certificate.crt"
      }
    }
  }
}

Windows 示例:

"env": {
  "NODE_EXTRA_CA_CERTS": "C:\\temp\\certs\\CustomCA.crt"
}

macOS/Linux 示例:

"env": {
  "NODE_EXTRA_CA_CERTS": "/Users/username/certs/Custom_CA.crt"
}
选项 2:绕过 SSL 验证(不推荐)

⚠️ 安全警告:设置 NODE_TLS_REJECT_UNAUTHORIZED=0 会禁用所有 SSL 证书验证,并带来重大安全风险。仅在非生产环境中使用。

{
  "mcpServers": {
    "fiori-mcp": {
      "type": "stdio",
      "timeout": 600,
      "command": "npx",
      "args": ["--yes", "@sap-ux/fiori-mcp-server@<version>", "fiori-mcp"],
      "env": {
        "NODE_TLS_REJECT_UNAUTHORIZED": "0"
      }
    }
  }
}
其他资源

遥测

你可以启用或禁用分析数据收集。默认情况下,系统会使用不可识别个人身份的信息,帮助了解你如何使用产品,从而改进 Fiori MCP Server。如果你想选择退出,可以通过以下两种方式禁用遥测。

方法 1:配置文件

创建或修改文件 ~/.fioritools/telemetrysettings.json:

{
  "telemetrysettings": {
    "telemetrySetting": {
      "enableTelemetry": false
    }
  }
}

将 enableTelemetry 设置为 false,即可禁用遥测数据收集。

方法 2:环境变量

将环境变量 SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY 设置为 true:

export SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY=true

设置此环境变量会禁用遥测客户端。

行为准则

只要遵守我们的行为准则,欢迎所有参与此联合项目的人员。

许可

有关版权和许可信息,请参阅我们的 LICENSE。包括第三方组件及其许可和版权信息在内的详细信息,可通过 REUSE 工具查看。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。