@cap-js/mcp

中文文档
1.5.0发布于 2026/09/17Apache-2.0构建来源已验证近 30 天下载 2.1万

CAP plugin to expose services as MCP servers for AI agent consumption

原始使用文档
文档目录6 节
  1. Feature Flags
  2. Custom Server Instructions
  3. Support, Feedback, Contributing
  4. Security / Disclosure
  5. Code of Conduct
  6. Licensing

REUSE status

About this project

This is a protocol adapter for the Model Context Protocol to expose CAP services for agent consumption. For more information, check the official documentation.

[!IMPORTANT] SAP API Policy Applies

The SAP API Policy remains applicable even when exposing data via MCP. Before exposing any SAP service or data through an MCP endpoint, ensure your use case complies with the SAP API Policy and any applicable licensing terms.

Feature Flags

All configuration lives under cds.mcp in your package.json:

{
  "cds": {
    "mcp": {
      "per_action_tool": false,
      "prefix": false,
      "format": "cql"
    }
  }
}
FlagDefaultDescription
per_action_toolfalseExpose each action/function as its own dedicated tool instead of the generic call tool.
prefixfalsePrefix tool names with the service name to avoid collisions when a MCP client connects to multiple MCP servers (e.g. CatalogService-query, AdminService-query).
format"cql"Change the query input format. "cqn" uses structured CQN input. "cql" uses CQL SELECT statement

For all other configuration options, refer to the official documentation.

Custom Server Instructions

You can customize the MCP server instructions sent to agents during initialization using the @mcp.instructions annotation:

annotate MyService with @mcp.instructions: 'Use describe to explore the product catalog. Use query to search products by name or category.';

If not set, a default instruction is used. The annotation also supports i18n references ({i18n>key}).

Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.

Security / Disclosure

If you find any bug that may be a security problem, please follow the instructions found in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.

Code of Conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

Copyright 2026 SAP SE or an SAP affiliate company and cap-js/mcp contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.

版本与发布记录

@cap-js/mcp 共发布 10 个版本,首次发布于 2026/07/03;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.0latest2026/09/171 个月前
1.4.32026/08/142 个月前
1.4.22026/08/132 个月前
1.4.12026/08/073 个月前
1.4.02026/08/033 个月前
1.3.02026/07/313 个月前

关于 @cap-js/mcp 的常见问题

@cap-js/mcp 是什么?

CAP plugin to expose services as MCP servers for AI agent consumption

如何安装 @cap-js/mcp?

在项目目录运行 npm install @cap-js/mcp,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:express(>=4)、@sap/cds(>=8)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cap-js/mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cap-js__mcp 是否存在。

@cap-js/mcp 可以商用吗?

@cap-js/mcp 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cap-js/mcp 的下载量有多少?

根据 npm 官方下载统计,@cap-js/mcp 在 2026/10/09 – 2026/11/07 这 30 天内被下载 20,729 次,日均约 691 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cap-js/mcp 还在维护吗?

最新版本 1.5.0 发布于 2026/09/17(1 个月前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/07/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。