bc-webclient-mcp
Version:
Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server
65 lines • 2.3 kB
TypeScript
/**
* RCC (Repeater Column Control) Extractor
*
* Extracts column metadata from BC WebSocket responses containing 'rcc' messages.
* Columns appear when BC realizes a repeater as an active grid (systemAction 40/120, Navigate, etc.)
*
* KEY INSIGHT: BC stores TemplateControlPath on CurrentRow.Children (dc/sc/lc controls),
* NOT on the rcc column definitions. This module enriches rcc columns with TemplateControlPath
* from CurrentRow when available.
*
* See: COLUMN_METADATA_DISCOVERY.md for full analysis
*/
import type { RepeaterColumnDescription } from '../types/mcp-types.js';
/**
* Raw RCC message from BC WebSocket protocol
*/
export interface RawRccMessage {
t: 'rcc';
Caption: string;
DesignName?: string;
Editable?: boolean;
TableEditable?: boolean;
ColumnBinder?: {
Name: string;
};
Formatter?: {
HorizontalAlignment?: 'Left' | 'Right' | 'Center';
};
ControlIdentifier?: string;
TemplateControlPath?: string;
}
/**
* Repeater with columns found in a BC response
*/
export interface DiscoveredRepeater {
formId: string;
controlPath: string;
caption: string;
columns: RepeaterColumnDescription[];
}
/**
* Extract column metadata from BC WebSocket response handlers
*
* Looks for handlers containing LogicalForm structures with repeater Columns (rcc messages).
*
* @param handlers - Array of handler objects from BC response
* @returns Array of discovered repeaters with their column metadata
*/
export declare function extractColumnsFromHandlers(handlers: unknown[]): DiscoveredRepeater[];
/**
* Extract columns from a complete BC WebSocket response
*
* @param response - JsonRpcResponse or raw response object
* @returns Array of discovered repeaters with columns
*/
export declare function extractColumnsFromResponse(response: unknown): DiscoveredRepeater[];
/**
* Merge new columns with existing columns, preferring new values
*
* @param existing - Existing column metadata (may be empty)
* @param discovered - Newly discovered column metadata
* @returns Merged column array
*/
export declare function mergeColumns(existing: readonly RepeaterColumnDescription[], discovered: RepeaterColumnDescription[]): RepeaterColumnDescription[];
//# sourceMappingURL=rcc-extractor.d.ts.map