loading…
Search for a command to run...
loading…
Enables D365 F\&O development including object creation, modification, deletion, and analysis through the MCP standard.
Enables D365 F&O development including object creation, modification, deletion, and analysis through the MCP standard.
A Model Context Protocol (MCP) server for Microsoft Dynamics 365 Finance & Operations development. This tool enables D365 object creation, modification, and analysis through the MCP standard, allowing integration with various development environments.
Date: September 18, 2025
Status: Functional with VS2022 service integration and enhanced form creation
September 19, 2025 - Safe Object Deletion Feature:
September 18, 2025 - Array Modifications & Form Creation Enhancements:
execute_object_modification now exclusively uses batch format for consistent operationsThis MCP server provides D365 F&O development capabilities including:
The system consists of two main components communicating through Windows Named Pipes:
mcp-xpp-d365-serviceThe architecture enables D365 development from various MCP-compatible clients while maintaining compatibility with existing D365 development workflows.
The server provides 10 specialized tools for D365 development:
npm install.\tools\build-and-run.ps1 -Action setup.\tools\build-and-run.ps1 -Action buildRun the MCP server using:
node build/index.js
The server automatically detects D365 paths from your VS2022 installation. For manual configuration, use:
node build/index.js --xpp-path "C:\path\to\PackagesLocalDirectory"
Configure in .vscode/mcp.json:
{
"servers": {
"mcp-xpp-server": {
"command": "node",
"args": ["./build/index.js"],
"cwd": "${workspaceFolder}",
"type": "stdio"
}
}
}
Add to Claude Desktop configuration file:
{
"mcpServers": {
"mcp-xpp-server": {
"command": "node",
"args": ["path/to/mcp_xpp/build/index.js"]
}
}
}
create_xpp_objectCreates D365 F&O objects using VS2022 service integration.
⚠️ Important: For creating forms, use the dedicated create_form tool instead as it provides specialized pattern support and datasource integration.
Parameters:
objectName (string) - Name of the D365 objectobjectType (string) - Object type (AxClass, AxTable, AxEnum, etc.) - Excludes AxFormlayer (string, optional) - Application layer (usr, cus, var)outputPath (string, optional) - Output directory (default: "Models")publisher (string, optional) - Company name (default: "YourCompany")version (string, optional) - Version number (default: "1.0.0.0")dependencies (array, optional) - Model dependenciesproperties (object, optional) - Object-specific configurationExample:
create_xpp_object({
"objectName": "MyCustomClass",
"objectType": "AxClass",
"layer": "usr"
})
create_form ✨ NEWSpecialized tool for creating D365 forms with advanced pattern support and datasource integration. This tool combines form creation and pattern discovery in one interface.
Parameters:
mode (string, required) - Operation mode:"create" - Create a new form with patterns and datasources"list_patterns" - Discover available D365 form patternsformName (string, optional) - Form name (required when mode='create')patternName (string, optional) - D365 form pattern to apply (e.g., 'SimpleListDetails', 'DetailsMaster', 'Dialog')patternVersion (string, optional) - Pattern version (default: 'UX7 1.0')dataSources (array|string, optional) - Table names for form datasourcesmodelName (string, optional) - D365 model/package name (default: 'ApplicationSuite')Key Features:
Examples:
// Discover available patterns
create_form({"mode": "list_patterns"})
// Create simple list form with datasource
create_form({
"mode": "create",
"formName": "MyCustomerListForm",
"patternName": "SimpleListDetails",
"dataSources": ["CustTable"]
})
// Create DetailsMaster form with multiple datasources
create_form({
"mode": "create",
"formName": "MySalesOrderForm",
"patternName": "DetailsMaster",
"patternVersion": "UX7 1.0",
"dataSources": ["SalesTable", "SalesLine", "CustTable"],
"modelName": "MyCustomModel"
})
// Create dialog form without datasources
create_form({
"mode": "create",
"formName": "MyConfirmationDialog",
"patternName": "Dialog"
})
Technical Notes:
delete_xpp_object ✨ NEWSafely deletes D365 F&O objects with comprehensive dependency validation and cache consistency. This tool prevents breaking changes by validating dependencies before deletion.
Parameters:
objectName (string, required) - Name of the D365 object to deleteobjectType (string, required) - D365 object type (AxClass, AxTable, AxForm, AxEnum, etc.)cascadeDelete (boolean, optional) - Delete dependent objects too (default: false)Key Features:
Examples:
// Delete a custom class
delete_xpp_object({
"objectName": "MyCustomClass",
"objectType": "AxClass"
})
// Delete a table with cascade (removes dependent field groups, relations, etc.)
delete_xpp_object({
"objectName": "MyTestTable",
"objectType": "AxTable",
"cascadeDelete": true
})
// Delete a form (will fail if dependencies exist without cascade)
delete_xpp_object({
"objectName": "MyCustomForm",
"objectType": "AxForm"
})
Response Format:
{
"success": true,
"message": "Successfully deleted object: MyCustomClass (AxClass)",
"objectName": "MyCustomClass",
"objectType": "AxClass",
"cascadeDelete": false,
"dependenciesRemoved": [],
"cacheUpdate": "Success",
"performance": "156ms"
}
⚠️ Safety Notes:
find_xpp_object before deletioncascadeDelete: false (default) for maximum safetyCommon Object Types:
AxClass - X++ classes and business logicAxTable - Data tables and schemaAxForm - User interface forms AxEnum - Enumerations and value listsAxEdt - Extended data typesAxView - Database viewsAxQuery - Data queriesAxReport - SSRS reportsfind_xpp_objectLocates X++ objects by name with optional filtering.
Parameters:
objectName (string, required) - Name of the X++ objectobjectType (string, optional) - Filter by object typemodel (string, optional) - Filter by D365 model/package namesearch_objects_patternSearches D365 objects using wildcard patterns.
Parameters:
pattern (string, required) - Search pattern with wildcards (*, ?)objectType (string, optional) - Filter by object typemodel (string, optional) - Filter by D365 model/package namelimit (number, optional) - Maximum results (default: 50)format (string, optional) - Output format: 'text' or 'json'inspect_xpp_objectAnalyzes D365 objects with multiple inspection modes.
Parameters:
objectName (string, required) - Name of the X++ objectobjectType (string, optional) - D365 object typeinspectionMode (string, optional) - Inspection level:summary - Fast overview with collection countsproperties - All object properties with descriptionscollection - Specific collection items (requires collectionName)xppcode - Extract X++ source code (requires codeTarget)collectionName (string, optional) - Required when inspectionMode='collection'codeTarget (string, optional) - Required when inspectionMode='xppcode':methods - Extract all method source codespecific-method - Single method (requires methodName)event-handlers - Event handler methods onlymethodName (string, optional) - Required when codeTarget='specific-method'maxCodeLines (number, optional) - Limit lines of source code per methodfilterPattern (string, optional) - Wildcard filter for resultsExamples:
// Get object summary
inspect_xpp_object({"objectName": "CustTable", "inspectionMode": "summary"})
// Extract specific method source code
inspect_xpp_object({
"objectName": "SalesLine",
"objectType": "AxTable",
"inspectionMode": "xppcode",
"codeTarget": "specific-method",
"methodName": "validateWrite"
})
execute_object_modification ✨ ENHANCED WITH BATCH PROCESSINGExecutes modification methods on existing D365 objects with array-based batch processing. Always use array format - single operations use array with one element.
📋 BEST PRACTICE: Group ALL modifications for the same object into ONE call instead of making separate calls. This provides better performance, error handling, and transactional integrity.
Parameters:
objectType (string, required) - D365 object type (e.g., 'AxTable', 'AxClass', 'AxForm')objectName (string, required) - Name of existing object to modifymodifications (array, required) - Array of modification operations:methodName (string, required) - Modification method to executeparameters (object, required) - Method-specific parameters including:concreteType (string, required) - Exact type from discover_modification_capabilitiesName (string) - Field/object name (use 'Name' not 'fieldName')✅ Features:
Examples:
✅ Single field (array with one element):
execute_object_modification({
"objectType": "AxTable",
"objectName": "CustTable",
"modifications": [
{
"methodName": "AddField",
"parameters": {
"concreteType": "AxTableFieldString",
"Name": "MyCustomField",
"Label": "My Custom Field",
"HelpText": "Custom field description",
"SaveContents": "Yes",
"Mandatory": "No",
"AllowEditOnCreate": "Yes",
"AllowEdit": "Yes",
"Visible": "Yes",
"AosAuthorization": "None",
"MinReadAccess": "Auto",
"IgnoreEDTRelation": "No",
"Null": "Yes",
"IsSystemGenerated": "No",
"IsManuallyUpdated": "No",
"IsObsolete": "No",
"GeneralDataProtectionRegulation": "None",
"SysSharingType": "Duplicate"
}
}
]
})
⭐ Multiple fields in one batch (PREFERRED):
execute_object_modification({
"objectType": "AxTable",
"objectName": "CustTable",
"modifications": [
{
"methodName": "AddField",
"parameters": {
"concreteType": "AxTableFieldString",
"Name": "CustomerCategory",
"Label": "Customer Category",
"HelpText": "Customer classification category",
"SaveContents": "Yes",
"Mandatory": "No",
"AllowEditOnCreate": "Yes",
"AllowEdit": "Yes",
"Visible": "Yes",
"AosAuthorization": "None",
"MinReadAccess": "Auto",
"IgnoreEDTRelation": "No",
"Null": "Yes",
"IsSystemGenerated": "No",
"IsManuallyUpdated": "No",
"IsObsolete": "No",
"GeneralDataProtectionRegulation": "None",
"SysSharingType": "Duplicate"
}
},
{
"methodName": "AddField",
"parameters": {
"concreteType": "AxTableFieldInt",
"Name": "CustomerPriority",
"Label": "Customer Priority",
"HelpText": "Priority level for customer",
"SaveContents": "Yes",
"Mandatory": "No",
"AllowEditOnCreate": "Yes",
"AllowEdit": "Yes",
"Visible": "Yes",
"AosAuthorization": "None",
"MinReadAccess": "Auto",
"IgnoreEDTRelation": "No",
"Null": "Yes",
"IsSystemGenerated": "No",
"IsManuallyUpdated": "No",
"IsObsolete": "No",
"GeneralDataProtectionRegulation": "None",
"SysSharingType": "Duplicate"
}
}
]
})
📊 Response Format: The tool returns detailed per-operation results:
{
"summary": "2 succeeded, 1 failed (3 total)",
"targetObject": "AxTable:CustTable",
"operations": [
{
"methodName": "AddField",
"success": true,
"processingTime": "371ms",
"message": "Successfully executed AddField on AxTable:CustTable"
},
{
"methodName": "AddField",
"success": false,
"processingTime": "0ms",
"error": "Parameter validation failed: Missing required parameters"
}
]
}
💡 Tips:
discover_modification_capabilities first to get exact parameter requirementsSaveContents, Mandatory, etc.discover_modification_capabilitiesDiscovers available modification methods for D365 object types.
Parameters:
objectType (string, required) - D365 object type to analyzeget_current_configReturns comprehensive server configuration and status information.
build_object_indexBuilds or updates the searchable object index.
Parameters:
objectType (string, optional) - Specific object type to indexforceRebuild (boolean, optional) - Force complete rebuildCommon D365 object types supported:
The system supports 544+ object types total.
The build-and-run.ps1 script provides unified project management:
# Setup VS2022 integration
.\tools\build-and-run.ps1 -Action setup
# Build both TypeScript and C# components
.\tools\build-and-run.ps1 -Action build
# Run the MCP server
.\tools\build-and-run.ps1 -Action run -Target mcp
# Run the C# service
.\tools\build-and-run.ps1 -Action run -Target csharp
# Run tests
.\tools\build-and-run.ps1 -Action test
# Clean builds
.\tools\build-and-run.ps1 -Action clean
# Create a custom class
create_xpp_object {
"objectName": "MyBusinessLogic",
"objectType": "AxClass",
"layer": "usr"
}
# Add a method to the class
execute_object_modification {
"objectType": "AxClass",
"objectName": "MyBusinessLogic",
"methodName": "AddMethod",
"parameters": {
"methodName": "processData",
"returnType": "void",
"source": "public void processData() { }"
}
}
# Find customer-related objects
search_objects_pattern {
"pattern": "Cust*",
"objectType": "AxTable",
"limit": 20
}
# Analyze a specific table
inspect_xpp_object {
"objectName": "CustTable",
"objectType": "AxTable",
"inspectionMode": "summary"
}
# Extract method source code
inspect_xpp_object {
"objectName": "CustTable",
"objectType": "AxTable",
"inspectionMode": "xppcode",
"codeTarget": "specific-method",
"methodName": "validateWrite"
}
.xpp - X++ source files.xml - Metadata and configuration files.json - Configuration files"VS2022 extension not found"
.\tools\build-and-run.ps1 -Action setup"Named pipe connection failed"
"Object not found" errors
build_object_index"Pattern validation failed" for forms
create_form tool instead of create_xpp_object for better form creation"Form creation without datasources fails"
create_form with "mode": "list_patterns" to see pattern requirementslogs/ folder for detailed error informationget_current_config to verify system configurationThis project welcomes contributions. Please:
Note that APIs may change as the project evolves.
MIT License - see LICENSE file for details.
This software is provided "as is" without warranty. It is intended for research and development purposes only, not for production use.
Important Notes:
Report issues or contribute improvements through the GitHub repository.
Выполни в терминале:
claude mcp add mcp-x-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.