MCP and AI Integration
Overview
"BWEB is no longer just a building tool. It is the framework that AI uses to build web applications."
AI integration relies on 3 entry points:
| Entry Point | Role | Description |
|---|---|---|
| CLAUDE.md | Rules and conventions | Project instructions loaded at startup. Conventions, style, patterns. |
| MCP Server | Specialized tools | Claude can search documentation, retrieve patterns, convert HTML. |
| Claude API | Direct actions | HTTP entry point for reading/writing in the 4D database via curl. |
Available MCP Tools
| Tool | Description |
|---|---|
| get_4d_context | Complete context (instructions, rules, index) |
| search_4d_documentation | Search BWEB documentation by keyword |
| get_4d_pattern | Retrieve a pattern (formcontroller, orda, listbox...) |
| read_4d_file | Read a specific documentation file |
| search_4d_official | Search on developer.4d.com |
| convert_html_to_bweb | Convert HTML/Tailwind to .bspkExp file |
| update_4d_documentation | Update a documentation file |
Claude API (/_claude/)
HTTP entry point integrated into the BSPK component. Claude calls 4D directly via curl.
| Route | Description |
|---|---|
| GET /_claude/ping | Availability test |
| POST /_claude/exec | Execute a 4D method |
| GET /_claude/data/TABLE/query | ORDA query with pagination |
| POST /_claude/data/TABLE/create | Create an entity |
| POST /_claude/data/TABLE/update | Modify an entity |
| POST /_claude/data/TABLE/delete | Delete an entity |
Security: Access authorized on localhost or with a temporary token. Write access protected by a table whitelist (claude-api-write-tables.json).
Complete AI Workflow
- Prompt - Describe what you need in natural language
- Claude - Reads the documentation (MCP), queries the database (API)
- Generation - Creates .bspkExp files, .4dm methods, CSS
- Dev Panel - Import, adjustment and deployment
Prompt Examples
- "Create a landing page for a restaurant with hero, menu grid and reservation form"
- "Add a listbox connected to the SUPPLIER DataClass with sorting and pagination"
- "Generate an editing form for the POST entity with validation"
"AI builds, humans maintain and refine."

