About BcWordLayout.Mcp
BcWordLayout.Mcp is an MCP server in the Science category: mCP server that lets AI agents create, edit, validate, and preview Microsoft Word report layouts for Microsoft Dynamics 365 Business Central - 23 deterministic, typed tools over stdio, with validate-before-save write safety and an offline mock PDF preview.
Install
git clone https://github.com/TKapitan/bc-word-layout-mcpThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (26)
clear_cell_textRemove all PLAIN TEXT from a table cell, leaving a valid empty cell (the cell/column is preserved) — e.g. blank an unwanted column-header label.
Parameters not published.
create_layoutCreate a new blank layout `.docx` from a schema, optionally starting from a branded/styled (unbound) template. A blank build ships deterministic default typography (Calibri 11 pt via a scaffolded styles part) so it renders with the same font in Word and in BC, plus a settings part declaring `compatibilityMode` 15 so its repeaters survive being opened and saved in Word.
Parameters not published.
get_layout_infoInspect a layout: report name/id, dataset namespace, `storeItemID`, the full control inventory (kind, alias, tag, xpath, part, parent repeater), per-part details (kind, header/footer role `default`/`first`/`even`, and which part a `partName`-less header/footer edit targets) plus a `hasTitlePage` flag, and a quick validation summary.
Parameters not published.
insert_columnAdd a new column at any grid position (append by default) — a bound field/label cell (as `insert_field`/`insert_label`) or a plain-text column. Adds the `w:gridCol` and one cell per row; a spanned cell in a row with no content there is widened instead.
Parameters not published.
insert_fieldInsert a plain-text FIELD content control bound to a dataset path, in the body, a header, or a footer.
Parameters not published.
insert_labelInsert a plain-text LABEL content control bound to a label-suffixed (`Lbl`/`_Lbl`) dataset path.
Parameters not published.
insert_page_numberInsert Word `PAGE`/`NUMPAGES` field codes — the "Page X / Y" chrome every stock BC document header carries (by default the full `X / Y` shape; `includeTotal=false` for the current page alone). Field codes are plain runs, so no `controlId`.
Parameters not published.
insert_pictureInsert a PICTURE content control bound to a picture dataset path (e.g. `/Header/CompanyPicture`) — the logo placeholder a from-scratch layout needs; BC fills it at render time.
Parameters not published.
insert_repeater_rowAdd a nested DETAIL ROW repeater inside an existing repeater's item — the standard BC shape for per-line detail (assembly components, serial/lot nos): a row under each line, aligned to the parent grid via spans, repeating once per parent row.
Parameters not published.
insert_repeater_tableInsert a complete repeater table (label/static header row + one bound data row) for a repeating data item — the flagship editing tool. Draws the BC-native look by default (no grid, one rule under the header row); optional per-column widths and alignments, pinned with a fixed table layout so Word renders the grid as specified.
Parameters not published.
Show all 26 tools
insert_subtotal_rowAppend a STATIC per-group row at the end of an existing repeater's item — the stock BC shape for group subtotal (and spacer) rows: it renders once per PARENT row, after the nested detail rows, never per detail row.
Parameters not published.
insert_tableInsert a plain (unbound) table — the building block for non-repeating layout sections (address columns, label/value header grids, right-anchored totals blocks). Column widths are pinned with a fixed table layout, so Word keeps the grid you asked for. Returns the new table's index for `set_cell_text`/`insert_field` to fill.
Parameters not published.
insert_table_rowInsert ONE STATIC (non-repeating) row into an existing table — the stock BC shape for the totals block INSIDE the line-items table (spacer cells, a spanned bound caption cell, a right-aligned bound amount cell). Cells bind FULL dataset paths; the row renders exactly once, never per data row.
Parameters not published.
insert_textInsert plain STATIC text — a literal run, not a content control: the separator space, colon or `" / "` that glues two inline controls together (without it, chained controls render as `Document NoDOCU-0150`). Creates no control, so it has no `controlId` and cannot be targeted by `remove_control`.
Parameters not published.
list_dataset_fieldsList the dataset hierarchy (data items + columns) from a `.docx` layout or a standalone schema `.xml`; flags labels and, for a layout, bound/unbound columns.
Parameters not published.
merge_cellsHorizontally merge a run of adjacent cells in one row into a single `gridSpan` cell (keeps the first cell's content).
Parameters not published.
preview_layoutMock preview: merges deterministic (or supplied) sample data into a working copy and converts it to PDF via Word COM or LibreOffice.
Parameters not published.
refresh_xml_partUpdate a layout's BC dataset XML part to a new schema in place; remaps/orphans bindings, re-points any binding left naming a foreign report's namespace (which BC refuses to upload), and reports newly-unbound fields.
Parameters not published.
remove_columnRemove a whole grid column: drops each row's covering cell (a bound cell too) or decrements its `gridSpan`, and removes the `w:gridCol`.
Parameters not published.
remove_controlRemove a content control (field/label/repeater/picture/unbound) by its `w:id`, searching the body and every header/footer.
Parameters not published.
render_preview_pagesRender pages of a preview PDF (the `pdfPath` from `preview_layout`) as PNG images returned inline as MCP image content blocks, so the calling agent can visually inspect the preview (default 3 pages, cap 10 per call; page onward via `firstPage`). Pass `outputDir` to also write each page as a `.png` a human can open — optionally with `inlineImages=false` to skip the token cost of the inline copies.
Parameters not published.
set_cell_bordersDraw (or clear) the per-cell rules a BC document's look is actually made of — a line above a totals row, an underline on one cell — on a whole row or one cell.
Parameters not published.
set_cell_textSet (replace) the PLAIN TEXT of a table cell, addressed by table/row/column index — e.g. re-label a line-items column header. Rejects cells that hold a bound control.
Parameters not published.
set_column_widthsSet a table's column widths (one twip value per grid column); `gridSpan`-aware — each cell is resized to the sum of the columns it spans.
Parameters not published.
split_cellsHorizontally split one spanned cell back into single-column cells.
Parameters not published.
validate_layoutValidate a layout: `level=quick` (structural + binding checks, including a `repeater-downgraded` error for a repeater a Word save turned into a plain content control and a warning when a layout containing repeaters declares a Word compatibility mode below 15) or `level=full` (adds a dry-run merge that surfaces every unresolved binding as a finding).
Parameters not published.
Ask AI
Ask AI about BcWordLayout.Mcp
Powered by Claude · Grounded in docs
Security checks
6 checks have not been run yet.