CAPforge

CAPforge

MCP server that makes AI agents get SAP CAP/CDS right by providing curated knowledge and a feedback loop with real validation against cds compile.

Category
访问服务器

README

CAPforge

MCP server that makes your AI agent (Claude Code, Cursor, …) get SAP CAP/CDS right: scaffolding that follows real conventions, plus real validation against cds compile. The agent doesn't stop until the code compiles clean.

Website · npm · Leelo en español

It calls no LLM itself: your agent brings the model (BYOK). Zero inference cost, nothing leaves your machine.

Why

General-purpose models hallucinate CDS — annotation terms that don't exist, OData v2 syntax mixed into v4, invented fields — because there's barely any public CAP code in training data. CAPforge gives your agent the two things it's missing:

  1. Curated, sourced knowledge — modern CAP/UI5 best practices distilled from official SAP docs (capire, OData vocabularies, reference samples), every rule with its source URL.
  2. A real feedback loop — tools that run the actual compiler and linter and feed errors back until everything is green.

Tools

Tool What it does
cap_project_context Codebase-aware: compiles your real project to CSN and returns the existing model (services, entities, fields, associations) so the agent reuses instead of inventing
cap_scaffold_entity Generates all 5 layers of an entity following conventions: CDS model with aspects (cuid, managed), projection, annotations.cds (HeaderInfo, LineItem, Facets, FieldGroups), mock CSV, i18n
cap_write_files Writes files into the project
cap_validate Runs cds compile and returns errors (the loop)
cap_lint Runs cds lint (best practices / anti-patterns)
cap_deploy_check Layer 3: deploys to a throwaway sqlite DB and loads the mock CSVs — catches what compile can't (CSV columns that don't exist, bad data, duplicate keys)
cap_analyze_legacy_ui5 Migration mode: inventories a legacy freestyle UI5 app (read-only) — datasources, sections, columns, bound fields, value helps, actions, i18n
ui5_scaffold_section Generates a freestyle ObjectPage section (SmartTable with p13nData, or SimpleForm) + handler stubs + i18n
ui5_validate_view The UI5 loop: well-formed XML + every declared event handler exists in the controller
ui5_lint Layer 3: runs SAP's official ui5lint — deprecated APIs, UI5 2.x readiness, CSP issues
resource conventions://cap Canonical knowledge core + your team's convention profile + migration map

Normal flow: contextscaffoldwritevalidate → correct → until green. Migration flow: analyze_legacycontext (target) → propose map (REUSED / NEW / DISCARDED) → scaffoldvalidate.

Requirements

  • Node.js 18+
  • @sap/cds-dk available (globally or in the project) for cap_validate to work.

Install & try

npm install
node test-loop.js   # full-loop demo against the bundled sandbox

VS Code / SAP Business Application Studio

The extension/ folder ships a VS Code extension that registers the MCP server automatically (no mcp.json editing) for Copilot agent mode and any MCP client. Build it locally until it lands on the Marketplace / Open VSX:

cd extension && npm install && npx vsce package
code --install-extension capforge-0.1.3.vsix

Point the capforge.conventionsPath setting to your team's private conventions (Pro preview). BAS note: BAS installs extensions from Open VSX, but its AI assistant does not consume MCP servers natively yet — the extension is ready for the day it does.

Claude Code / Cursor

Register in Claude Code (project .mcp.json or global config):

{
  "mcpServers": {
    "capforge": {
      "command": "npx",
      "args": ["-y", "capforge"]
    }
  }
}

Load your team's private conventions (a preview of the Pro tier):

"env": { "CAPFORGE_CONVENTIONS": "PATH/to/team-conventions.md" }

Knowledge

  • knowledge/canonical core: modern CAP/UI5 best practices (aspects, compositions, drafts, authorization, Fiori annotations, i18n, tooling, migration map), anchored to official SAP docs with cited sources.
  • conventions/house profile: one team's style, overridable via CAPFORGE_CONVENTIONS. Wins over the core on style conflicts.

The conventions://cap resource serves both, combined, to the agent.

Free vs Pro

  • Free (open source): all the tools + the canonical knowledge core.
  • Pro: private team profile, codebase-aware generation at scale, migration mode, CI checks, support. Coming soon.

License

MIT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选