CAPforge
This server provides tools for SAP CAP (Cloud Application Programming) and UI5 development, enabling AI agents to scaffold, validate, and migrate projects with compiler-based feedback.
CAP Tools:
cap_project_context– Compiles the project to CSN, returning a digest of services, entities, fields, associations, and compositions for reuse.cap_scaffold_entity– Generates a full 5-layer entity scaffold (CDS model, service projection, annotations, mock CSV, i18n) following conventions and optionally enabling Fiori draft, cuid/managed.cap_write_files– Writes or updates files in the project, creating folders as needed.cap_validate– Runscds compileto detect syntax and compilation errors.cap_lint– Runscds lintto catch best-practice violations and anti-patterns.cap_deploy_check– Deploys to a temporary SQLite DB and loads mock data to find CSV/data issues like missing columns or duplicate keys.
UI5 Tools:
cap_analyze_legacy_ui5– Inventories a legacy freestyle UI5 app (datasources, sections, columns, bound fields, value helps, actions) for migration planning.ui5_scaffold_section– Generates ObjectPage section fragments (SmartTable or SimpleForm) with handlers and i18n keys.ui5_validate_view– Ensures XML views/fragments are well-formed and event handlers exist.ui5_lint– Runs SAP'sui5lintto flag deprecated APIs, UI5 2.x readiness issues, and CSP concerns.
Additionally, a conventions://cap knowledge resource provides curated CAP/UI5 best practices and team conventions to guide development.
Provides tools for scaffolding, validating, and linting SAP CAP/CDS projects and UI5 applications, including compiling to CSN, deploying to a test SQLite database, and running official UI5 linting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CAPforge scaffold entity SalesOrder with managed aspects"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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:
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.
Related MCP server: @cap-js/mcp-server
Tools
Tool | What it does |
| Codebase-aware: compiles your real project to CSN and returns the existing model (services, entities, fields, associations) so the agent reuses instead of inventing |
| Generates all 5 layers of an entity following conventions: CDS model with aspects ( |
| Writes files into the project |
| Runs |
| Runs |
| Layer 3: deploys to a throwaway sqlite DB and loads the mock CSVs — catches what |
| Migration mode: inventories a legacy freestyle UI5 app (read-only) — datasources, sections, columns, bound fields, value helps, actions, i18n |
| Generates a freestyle ObjectPage section (SmartTable with p13nData, or SimpleForm) + handler stubs + i18n |
| The UI5 loop: well-formed XML + every declared event handler exists in the controller |
| Layer 3: runs SAP's official |
resource | 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 sandboxVS 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.
Available Tools
10 toolscap_analyze_legacy_ui5Migration inventory of a legacy UI5 appA
Analyzes a legacy freestyle UI5 app (manifest, XML views, controllers, i18n) in READ-ONLY mode and returns the migration inventory: OData datasources, sections, tables and columns, bound fields per model, value helps, actions and OData calls from the controllers. Use it as the starting point to migrate to modern CAP/Fiori together with cap_project_context and the conventions://cap knowledge.
Inputs: appPath (required).
cap_deploy_checkTest deploy (cds deploy to throwaway sqlite)A
Third CAP validation layer: deploys the model to a throwaway sqlite database and loads the db/data CSVs. Catches what cds compile cannot: CSV columns that do not exist on the entity, malformed data and duplicate keys. Requires @cap-js/sqlite installed in the project. The throwaway database is deleted afterwards.
Inputs: projectPath (required).
cap_lintLint CAP (cds lint)A
Second validation layer: runs cds lint (@sap/cds eslint plugin) on the project and returns anti-patterns and best-practice warnings that cds compile does not catch. Requires @sap/cds installed in the project.
Inputs: projectPath (required).
cap_project_contextCAP project context (codebase-aware)A
Compiles the real project to CSN and returns a digest of the existing model: services, entities, fields with types and keys, associations and compositions. Call it BEFORE generating code so you reuse what exists instead of inventing fields or entities.
Inputs: projectPath (required).
cap_scaffold_entityCAP entity scaffold (all layers)A
Generates the complete scaffolding of a CAP entity following the loaded conventions: CDS model, service projection, annotations.cds (labels + UI.LineItem), mock CSV header and i18n in two languages. Returns the content so you write it with cap_write_files and validate it with cap_validate.
Inputs: entity (required), fields (required), service (required), namespace (required), +2 more.
cap_validateValidate CAP (cds compile)B
The validation loop. Runs cds compile on the project and returns the errors so the agent can fix them. A clean compile means the scaffolding is valid.
Inputs: projectPath (required).
cap_write_filesWrite files into the projectA
Writes one or more files into the given CAP project. Creates folders when missing.
Inputs: files (required), projectPath (required).
ui5_lintLint UI5 (@ui5/linter)A
Third UI5 validation layer: runs SAP's official ui5lint on the app and returns deprecations and anti-patterns on the road to UI5 2.x that view validation does not catch (obsolete APIs, deprecated libs, CSP). Requires @ui5/linter installed in the app and a ui5.yaml at the root.
Inputs: appPath (required).
ui5_scaffold_sectionUI5 ObjectPage section scaffold (freestyle)A
Generates an ObjectPage section for a freestyle UI5 app following the real pattern: fragment with uxap:ObjectPageSection, SmartTable (table mode, with per-column p13nData) or SimpleForm (form mode), dotted i18n keys, handler stubs and i18n lines. Returns the content so you review it, write it with cap_write_files and validate it with ui5_validate_view.
Inputs: mode (required), fields (required), sectionName (required), handlers, +2 more.
ui5_validate_viewValidate UI5 view/fragmentB
The UI5 validation loop: checks that the XML is well-formed and that ALL declared event handlers (press, change, select...) exist in the controller. Returns the failures so the agent can fix them.
Inputs: xmlPath (required), controllerPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clearly distinct purposes: scaffold vs write vs validate vs analyze vs lint are well-separated by phase. However, there are three validation tools (cap_validate, cap_lint, cap_deploy_check) and two UI5 tools (ui5_validate_view, ui5_lint) with overlapping boundaries that could cause misselection, though their descriptions do explain the distinct layers.
Tool names follow an extremely consistent verb_noun pattern with clear prefixes (cap_ for CAP operations, ui5_ for UI5 operations). Verbs are predictable (validate, scaffold, lint, analyze, write, deploy_check, project_context) and 'cap_' aligns with UI5 namespace separation, making the naming highly predictable.
10 tools is well-scoped for a dual-domain server covering both CAP backend and UI5 frontend migration. Each tool earns its place: scaffolding, writing, project context, three CAP validation layers, three UI5 layers, and analysis. The count balances full lifecycle coverage without bloat.
The lifecycle is well covered: read context (cap_project_context), analyze legacy (cap_analyze_legacy_ui5), scaffold (cap_scaffold_entity, ui5_scaffold_section), write (cap_write_files), and three-layer validation on both sides (compile, lint, deploy-check; view-validate, ui5lint). Minor gaps include no explicit update/delete/modify operations and no scaffolding for non-entity CAP artifacts like services or annotations beyond entities.
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceUnified SAP MCP server combining SAP documentation search, ABAP linting, and BTP service exploration into a single extensible ecosystem for AI assistants.MIT

@cap-js/mcp-serverofficial
AlicenseNot gradedqualityAmaintenanceMCP server for SAP CAP that enables AI-assisted development by searching CDS model definitions and CAP documentation.60,885 npm118Apache 2.0- AlicenseNot gradedqualityCmaintenanceA CAP plugin that automatically generates MCP servers from your CAP services, transforming OData services into AI-accessible resources, tools, and prompts with minimal configuration.1,589 npm61Apache 2.0
- AlicenseBqualityDmaintenanceMCP server for SAP ABAP development that enables AI assistants and code editors to interact with SAP systems via ABAP Developer Toolkit (ADT) APIs, supporting read, create, update, and delete of ABAP objects.100787 npmMIT