capforge
An MCP server that scaffolds CAP and CDS for a coding agent and then holds it to cds compile — the agent does not stop until the generated code builds clean.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1, contributes to 1@automatizatodomaintainer
What it declares
Every artifact
- Type
- MCP server
- Origin
- Independently maintained
Connections
Letting a coding agent read and act on your project or system
Download
Install
npm add capforgeDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from automatizatodo/capforge under MIT, readCAPforge
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:
- Curated, sourced knowledge — modern CAP/UI5 best practices distilled from official SAP docs (capire, OData vocabularies, reference samples), every rule with its source URL.
- 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: context → scaffold → write → validate → correct → until green.
Migration flow: analyze_legacy → context (target) → propose map (REUSED / NEW / DISCARDED) → scaffold → validate.
Requirements
- Node.js 18+
@sap/cds-dkavailable (globally or in the project) forcap_validateto work.
Install & try
npm install
node test-loop.js # full-loop demo against the bundled sandbox
VS Code / SAP Business Application Studio
Install the "CAPforge" extension from the VS Code Marketplace (also on Open VSX): it registers the MCP server automatically for Copilot agent mode, no mcp.json editing.
Point the capforge.conventionsPath setting to your team's private conventions. 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 (optional):
"env": { "CAPFORGE_CONVENTIONS": "PATH/to/team-conventions.md" }
Make your agent actually use it
Registering an MCP server does not force the agent to call it: agents only invoke tools when they decide the task needs them, and for CAP they often just write CDS from memory. Two ways to fix that:
- Workspace instructions (recommended). Add this to your project's agent instructions file —
.github/copilot-instructions.md(Copilot),CLAUDE.md(Claude Code) or.cursorrules(Cursor):
For every SAP CAP or UI5 task: call cap_project_context before generating and reuse existing names; scaffold with cap_scaffold_entity / ui5_scaffold_section; validate with cap_validate, cap_lint and cap_deploy_check (UI5: ui5_validate_view, ui5_lint) and correct until everything is green. Never hand-write CDS without a clean cap_validate run.
- The
cap_workflowprompt. CAPforge ships an MCP prompt with the same workflow: pick it from your client's prompt list (in VS Code: type/in chat) at the start of a CAP session.
You can also just ask explicitly ("scaffold this with the capforge tools and validate until clean") — but the instructions file is what makes it automatic for the whole team.
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 viaCAPFORGE_CONVENTIONS. Wins over the core on style conflicts.
The conventions://cap resource serves both, combined, to the agent.
Community
The roadmap is decided by the people who build CAP every day: roadmap discussion. Contributions welcome — see CONTRIBUTING.md.
License
MIT.
History
Others providing
Compare all 4 on the Agent access to your code page →- @cap-js/mcp-server@cap-js/mcp-serverSAP's MCP server for CAP development, run as cds-mcp: search_model searches the project's compiled CDS model, search_docs searches the CAP documentation indexed as embeddings on the developer's own machine.sap official, capMCP server for CAP development: model and docs search
- @sap-ux/fiori-mcp-server@sap-ux/fiori-mcp-serverSAP's Fiori MCP server, run as fiori-mcp, letting a coding assistant create and edit Fiori applications directly rather than describing the steps.sap official, ui5MCP server for creating and editing Fiori applications
- @ui5/mcp-server@ui5/mcp-serverSAP's MCP server for UI5 development: ten tools that scaffold an app or a card, read the project in front of the agent, and run the linter and the manifest validator against it.sap official, ui5MCP server for UI5 development with ten tools
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- MCP is how this is delivered, not what it answers — artifact_type carries the transport. It helps an agent work on real code rather than exposing a running service to one, which is a different capability.
- Typed cds-plugin by placement, which defaults every candidate to that. It is not one.
- An MCP server that scaffolds CAP and CDS for a coding agent and then holds it to `cds compile` — the agent does not stop until the generated code builds clean.
- First seen.
For your agent
- Ref
artifact:automatizatodo-capforge- JSON
- /artifacts/automatizatodo-capforge.json
- MCP
- Connecting an agent