### Clone and Build BCKB MCP Server (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Steps to clone the BCKB MCP Server repository, install its dependencies using npm, build the project, and verify the installation with tests. Assumes Node.js and Git are installed. ```bash # Clone the repository git clone https://github.com/your-org/bc-knowledgebase-mcp.git cd bc-knowledgebase-mcp # Install dependencies npm install # Build the server npm run build # Verify installation npm test ``` -------------------------------- ### VS Code Extension Installation and Configuration (Bash & JSON) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Instructions for installing the BCKB VS Code extension, including building and packaging it, and configuring the extension's settings in VS Code's `settings.json` to point to the BCKB server. ```bash # Install the extension: cd vscode-extension npm install && npm run compile vsce package code --install-extension bckb-knowledge-assistant-1.0.0.vsix ``` ```json { "bckb.serverPath": "node", "bckb.serverArgs": ["/full/path/to/bc-knowledgebase-mcp/dist/index.js"], "bckb.autoConnect": true } ``` -------------------------------- ### Learning BC Development with BCKB CLI (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Example commands using the BCKB CLI for learning Business Central development, focusing on searching for beginner-level topics and retrieving specific topic details. ```bash # Start with beginner topics bckb search "AL basics" --difficulty beginner --limit 10 # Get specific topic details bckb get "al-development-fundamentals-001" ``` -------------------------------- ### Build and Test BCKB MCP Server (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/integrations/claude-desktop/setup-guide.md Commands to navigate to the BCKB MCP server directory, install its dependencies, build the project, and run tests. Assumes Node.js and npm are installed. ```bash cd bc-knowledgebase-mcp npm install npm run build npm test ``` -------------------------------- ### MCP Tools Setup and Execution (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/README.md Provides the basic bash commands to set up and start an MCP project. This includes installing dependencies, building the project, and running the application. It's a common starting point for using the MCP tools. ```bash npm install npm run build npm start ``` -------------------------------- ### Verify MCP Installation Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Verify the connection to your MCP-compatible AI tool by asking it to list available BC topics related to performance. This confirms the server is operational and accessible. ```text Ask: "List available BC topics about performance" ``` -------------------------------- ### BCKB Basic Configuration (.env file) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Example of a `.env` file for configuring the BCKB server, covering logging levels, debug layers, cache settings (enabled, TTL), knowledge source URLs, request timeouts, and search result limits. ```bash # Logging BCKB_LOG_LEVEL=info BCKB_DEBUG_LAYERS=false # Caching BCKB_CACHE_ENABLED=true BCKB_CACHE_TTL_SECONDS=600 # Knowledge Sources BCKB_COMPANY_KNOWLEDGE_URL=https://github.com/your-org/bc-knowledge BCKB_PROJECT_OVERRIDES_PATH=./bckb-overrides # Performance BCKB_MAX_SEARCH_RESULTS=10 BCKB_REQUEST_TIMEOUT_MS=10000 ``` -------------------------------- ### GitHub Copilot Integration Configuration (Bash & Text) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Details on how to integrate BCKB with GitHub Copilot within VS Code by modifying `settings.json`. It also shows example prompts for using BCKB commands within Copilot Chat. ```bash # In your VS Code settings echo '{ "github.copilot.chat.participants": ["@bckb"] }' >> .vscode/settings.json ``` ```text @bckb search posting procedures @bckb analyze [paste AL code here] @bckb explain table relationships ``` -------------------------------- ### Get optimization suggestions for AL file Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Retrieves optimization suggestions for a specified AL file (MyReport.al). ```bash # Get optimization suggestions bckb analyze --file MyReport.al --type optimization ``` -------------------------------- ### Get detailed system analytics Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Connects to the BCKB server and retrieves detailed system analytics, including usage patterns. ```typescript // Get detailed analytics const analytics = await client.getSystemAnalytics(); console.log('Usage Analytics:', analytics); ``` -------------------------------- ### BCKB CLI Usage Examples (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Demonstrates various commands for the BCKB CLI, including searching for knowledge with filters, retrieving detailed topic information, analyzing AL code snippets, checking server status in JSON format, and entering interactive mode. ```bash # Search for BC knowledge bckb search "posting procedures" --domain finance --difficulty intermediate # Get detailed topic information bckb get "topic-posting-routines-001" # Analyze AL code bckb analyze --code " table 50100 Customer { fields { field(1; No; Code[20]) { } field(2; Name; Text[100]) { } } }" --type validation # Check server health bckb status --json # Interactive mode bckb interactive ``` -------------------------------- ### Repository Setup (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Contributing-Guide Commands to set up the project repository, including forking, cloning, adding an upstream remote for synchronization, installing project dependencies, and setting up pre-commit hooks. ```bash # Fork and clone the repository git clone https://github.com/your-username/bc-knowledgebase-mcp.git cd bc-knowledgebase-mcp # Add upstream remote git remote add upstream https://github.com/bc-knowledge/bc-knowledgebase-mcp.git # Install dependencies npm install # Install development dependencies npm install --save-dev # Set up pre-commit hooks npm run setup-hooks ``` -------------------------------- ### BCKB Layer Configuration (YAML) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Configuration example for BCKB layers using a `layers.yaml` file. It defines different knowledge source types (embedded, git, local) with their paths, URLs, priorities, and enabled status. ```yaml # config/layers.yaml layers: - name: "base" type: "embedded" path: "./knowledge/base" priority: 100 enabled: true - name: "company" type: "git" url: "${BCKB_COMPANY_KNOWLEDGE_URL}" priority: 200 enabled: true - name: "project" type: "local" path: "${BCKB_PROJECT_OVERRIDES_PATH}" priority: 300 enabled: true ``` -------------------------------- ### Start BCKB server with debug output Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Starts the BCKB server using the 'dev' npm script, which typically includes debug output. ```bash # Start server with debug output npm run dev ``` -------------------------------- ### Check Node.js version Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Checks the installed Node.js version. Requires version 18 or higher. ```bash # Check Node.js version node --version # Should be 18+ ``` -------------------------------- ### AI Assistant Prompts for BC Code Intelligence Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Examples of questions to ask an AI assistant for help with BC Code Intelligence. These prompts cover configuration, specialist identification, and methodology inquiries. ```natural language Ask: "How do I configure BC version context?" Ask: "What specialists are available for API design?" Ask: "Show me the systematic analysis methodology" ``` -------------------------------- ### Install BC Code Intelligence MCP from Source Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Installation-Guide Installs the BC Code Intelligence MCP server by cloning the repository from GitHub, installing dependencies, and building the project. This method requires Git. ```bash git clone https://github.com/JeremyVyska/bc-knowledgebase-mcp.git cd bc-knowledgebase-mcp npm install && npm run build ``` -------------------------------- ### Test BCKB MCP Server and CLI (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Commands to manually start the BCKB server and test its command-line interface (CLI) functionality, including checking status and performing searches. ```bash # Start the server manually to verify it works node dist/index.js # In another terminal, test the CLI npx bckb status npx bckb search "table relationships" --limit 5 ``` -------------------------------- ### Execute New Developer Onboarding Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Starts a workflow for onboarding new developers, specifying their experience level and focus area. This provides a structured learning path for BC fundamentals. ```javascript workflow_new_developer_onboarding({ experience_level: "intermediate", focus_area: "development" }) ``` -------------------------------- ### Get Optimization Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Retrieves a step-by-step optimization plan tailored to a specific scenario and performance target. Useful for addressing performance bottlenecks in BC applications. ```AL get_optimization_workflow( scenario="slow report with large dataset", target_performance="sub-5 second response" ) ``` -------------------------------- ### Verify project build Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Runs the build script and lists the contents of the 'dist/' directory to ensure the build was successful. ```bash # Verify build npm run build ls dist/ # Should contain index.js ``` -------------------------------- ### Initiate Systematic Analysis Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Start a systematic analysis of BC code using a methodology-driven workflow. The system guides users through proven methodologies with step-by-step instructions. ```text Ask: "Start a systematic performance analysis of my BC code" ``` -------------------------------- ### Get Workflow Guidance Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Provides detailed guidance and context for the current phase of a workflow. It helps specialists understand the specific tasks and considerations for their stage. ```AL # Get specialist guidance for current phase get_workflow_guidance({ workflow_id: "workflow-abc123", detailed_context: "Working on Customer table extension with external API integration" }) ``` -------------------------------- ### Run BC Code Intelligence MCP on a Custom Port Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Installation-Guide Starts the BC Code Intelligence MCP server on a specified port to avoid conflicts with other running services. ```bash npx bc-code-intelligence-mcp --port 3001 ``` -------------------------------- ### Check environment variables Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Lists all environment variables, filtering for those starting with 'BCKB'. ```bash # Check environment variables env | grep BCKB ``` -------------------------------- ### Interactive architecture planning Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Initiates an interactive session to search for microservices patterns and retrieve specific integration API patterns. ```bash # Get workflow recommendations bckb interactive bckb> search microservices patterns bckb> get integration-api-patterns-001 bckb> exit ``` -------------------------------- ### Troubleshooting: Manually Run Server (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/integrations/claude-desktop/setup-guide.md Bash command to manually start the BCKB MCP server for troubleshooting connection issues. It navigates to the server directory and executes the main JavaScript file. ```bash cd bc-knowledgebase-mcp node dist/index.js ``` -------------------------------- ### Install BC Code Intelligence MCP via NPM Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Installation-Guide Installs the BC Code Intelligence MCP server globally or locally within a project using npm. Ensure Node.js and npm are installed and meet the version requirements. ```bash npm install -g bc-code-intelligence-mcp ``` ```bash npm install bc-code-intelligence-mcp ``` -------------------------------- ### Quick Start Guidance Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/MCP-Tools-Reference Provides initial guidance for new users of BC development. This involves getting started, analyzing code, finding resources, and obtaining contextual help. ```javascript ask_bc_expert({ question: "I'm new to BC development and need guidance" }) ``` ```javascript analyze_al_code({ code: "workspace", analysis_type: "comprehensive" }) ``` ```javascript find_bc_knowledge({ query: "best practices for my scenario" }) ``` ```javascript get_bc_help({ current_situation: "describe your situation" }) ``` -------------------------------- ### Search for architectural patterns Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Searches the BCKB knowledge base for architectural patterns within the 'integration' domain, limiting results to 20. ```bash # Search for architectural patterns bckb search "integration patterns" --domain "integration" --limit 20 ``` -------------------------------- ### Load Methodology Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Initiates a systematic analysis workflow based on a user's request. This tool helps in starting structured processes for tasks like performance optimization or architecture reviews. ```AL # Performance optimization workflow load_methodology(user_request="optimize slow BC report performance") ``` ```AL # Architecture review workflow load_methodology(user_request="review BC integration architecture") ``` -------------------------------- ### Enable debug logging for BCKB Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Enables debug logging for the BCKB server by setting the log level to 'debug' and enabling debug layers. ```bash # Enable debug logging export BCKB_LOG_LEVEL=debug export BCKB_DEBUG_LAYERS=true ``` -------------------------------- ### Get Context-Aware Help for BC Versions Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Retrieve context-aware help by querying for specific features or optimizations related to particular Business Central versions. This demonstrates the MCP server's ability to understand version-specific requirements. ```text Ask: "What SIFT optimizations are available for BC 23?" ``` ```text Ask: "Show me OData v4 features for BC 22 and later" ``` -------------------------------- ### Test server manually and check health endpoint Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Starts the server in the background and then uses curl to check the '/health' endpoint on port 3000. ```bash # Test server manually node dist/index.js & curl http://localhost:3000/health ``` -------------------------------- ### Validate BCKB configuration Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Validates the BCKB configuration settings. ```bash # Validate configuration bckb config --validate ``` -------------------------------- ### Search for table design patterns (Intermediate) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Searches the BCKB knowledge base for table design patterns at an intermediate difficulty level. ```bash bckb search "table design patterns" --difficulty intermediate ``` -------------------------------- ### Local Development Setup Configuration Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Configuration-Examples Configuration example for a local development environment of the BC Knowledge Base MCP Server. It specifies server settings, local knowledge source paths, caching, specialist configurations, methodology paths, and logging levels. ```yaml # config/development.yaml development_config: server: port: 3000 host: "localhost" ssl_enabled: false knowledge: sources: local: enabled: true path: "./local-knowledge" watch_changes: true auto_reload: true git_repository: enabled: true url: "https://github.com/company/bc-knowledge" branch: "development" sync_interval: "5_minutes" cache: enabled: true provider: "memory" max_size: "100MB" ttl: "30_minutes" specialists: enabled: true custom_specialists: - name: "local_development_expert" description: "Specialized for local development patterns" prompt_template: "./specialists/dev-expert.md" methodologies: enabled: true methodology_paths: - "./methodologies/development" - "./methodologies/testing" logging: level: "debug" output: "console" format: "pretty" development_features: hot_reload: true debug_mode: true performance_profiling: false mock_external_services: true ``` -------------------------------- ### Search for error handling patterns Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Searches the BCKB knowledge base for 'error handling patterns' within the 'development' domain. ```bash # During review: Quick checks bckb search "error handling patterns" --domain "development" ``` -------------------------------- ### Check detailed debug logs Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Follows the content of the BCKB debug log file in real-time. ```bash # Check detailed logs tail -f logs/bckb-debug.log ``` -------------------------------- ### Verify BC Code Intelligence MCP Installation Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Installation-Guide Commands to check the installed version and the health status of the BC Code Intelligence MCP Server. These commands are run using npx. ```bash npx bc-code-intelligence-mcp --version ``` ```bash npx bc-code-intelligence-mcp --health-check ``` -------------------------------- ### Enable caching for BCKB Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Enables caching for the BCKB server and sets the cache Time-To-Live (TTL) to 1800 seconds (30 minutes). ```bash # Enable caching export BCKB_CACHE_ENABLED=true export BCKB_CACHE_TTL_SECONDS=1800 ``` -------------------------------- ### Export daily development analytics Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Exports the daily analytics of the development progress to a JSON file named 'daily-analytics.json'. ```bash # Evening: Review learning progress bckb config --export daily-analytics.json ``` -------------------------------- ### Analyze AL file for performance Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Analyzes a specific AL file (src/MyCodeunit.al) for performance-related issues. ```bash # Analyze a specific AL file bckb analyze --file src/MyCodeunit.al --type performance ``` -------------------------------- ### Running the Development Server (Bash) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Contributing-Guide Commands to start and manage the development server. Includes starting with hot reload, running with a specific configuration file, enabling debugging, and running in watch mode for testing. ```bash # Start development server with hot reload npm run dev # Run with specific configuration npm run dev -- --config ./config/custom-dev.yaml # Start with debugging enabled npm run dev:debug # Run in watch mode for testing npm run test:watch ``` -------------------------------- ### Execute BC Version Upgrade Planning Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Starts a workflow for planning a Business Central version upgrade. It requires specifying the current and target BC versions to generate a risk-assessed migration strategy. ```bash workflow_upgrade_planning({ current_version: "20.4", target_version: "23.1" }) ``` -------------------------------- ### Start Workflow Prompts Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Initiates various automated workflows directly through predefined prompts. These are designed for quick access to specialized tasks like code optimization or security audits. ```AL # Start workflows directly through prompts: workflow_code_optimization({ code_location: "src/MyExtension.al", bc_version: "23.1" }) ``` ```AL workflow_architecture_review({ scope: "Complete sales module review" }) ``` ```AL workflow_security_audit({ audit_scope: "Permission sets and data access" }) ``` -------------------------------- ### Code Optimization Workflow Initiation Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Initiate a code optimization workflow by providing the code location and BC version. This demonstrates how to start a structured analysis for improving code quality and performance. ```text # Your client will show these workflow prompts: - workflow_code_optimization - workflow_architecture_review - workflow_security_audit - workflow_performance_analysis - workflow_integration_design - workflow_upgrade_planning - workflow_testing_strategy - workflow_new_developer_onboarding - workflow_pure_review ``` ```text code_location: "src/CustomerExtension.al" bc_version: "23.1" ``` -------------------------------- ### Validate AL code with best practices Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Checks AL code from a file (MyTable.al) for best practices and outputs the results in JSON format. ```bash # Check for best practices bckb analyze --code "$(cat MyTable.al)" --type validation --json ``` -------------------------------- ### Install bc-knowledgebase-mcp with npm Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Layer-System-Overview Installs the BC Knowledge Base MCP Server package using npm. This is the first step for individual developers or getting started with zero configuration. ```bash npm install bc-knowledgebase-mcp ``` -------------------------------- ### BCKB TypeScript SDK Usage Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Illustrates how to use the BCKB TypeScript SDK to connect to the server, search for topics with specific criteria, and analyze AL code snippets. It includes connecting, disconnecting, and processing results. ```typescript import { BCKBClient, BCKBClientDefaults } from './src/sdk/bckb-client.js'; // Create and connect client const client = new BCKBClient(BCKBClientDefaults.local()); await client.connect(); // Search for topics const topics = await client.searchTopics('purchase orders', { domain: 'purchase', difficulty: 'beginner', limit: 10 }); console.log(`Found ${topics.length} topics:`); topics.forEach(topic => { console.log(`- ${topic.title} (${topic.domain})`); }); // Analyze code const analysis = await client.analyzeCode({ code_snippet: "" + "codeunit 50100 \"My Codeunit\"\n" + "{\n" + " procedure DoSomething()\n" + " begin\n" + " Message('Hello World');\n" + " end;\n" + "}\n" + "", analysis_type: 'general', suggest_topics: true }); console.log('Analysis results:', analysis.issues); console.log('Suggested topics:', analysis.suggested_topics); await client.disconnect(); ``` -------------------------------- ### Get Topic Content Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Retrieves detailed content for a specific knowledge base topic, identified by its topic_id. Can optionally include code samples related to the topic. ```AL # Get SIFT optimization guide get_topic_content(topic_id="sift-technology-fundamentals") ``` ```AL # Include code samples get_topic_content(topic_id="query-optimization-patterns", include_samples=true) ``` -------------------------------- ### Get Workflow Status Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Retrieves the current status and progress of a specified workflow. The output includes details like the current phase, assigned specialist, and progress percentage. ```AL # Get complete workflow state get_workflow_status({ workflow_id: "workflow-abc123" }) ``` -------------------------------- ### MCP Tools Reference - Onboarding Tools Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/docs/SPECIALIST-BUNDLE-GUIDE.md Demonstrates how to use MCP onboarding tools to get agent-friendly introductions to the specialist team. This includes providing context and specifying focus areas for the introductions. ```json { "name": "introduce_bc_specialists", "arguments": { "context": "BC/AL development", "focus_areas": ["performance", "security"] } } ``` -------------------------------- ### Get Specialist Roster Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Retrieve a list of available AI specialists and their respective domains. This helps users identify the right expert for their specific BC development needs. ```text Ask: "Get specialist roster" ``` -------------------------------- ### Claude Desktop Integration Configuration (JSON) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Configuration steps for integrating BCKB with Claude Desktop by adding server details to the `claude_desktop_config.json` file, including command, arguments, and environment variables for logging and caching. ```json { "mcpServers": { "bckb": { "command": "node", "args": ["/full/path/to/bc-knowledgebase-mcp/dist/index.js"], "env": { "BCKB_LOG_LEVEL": "info", "BCKB_CACHE_ENABLED": "true" } } } } ``` -------------------------------- ### Scenario 1: Performance Optimization Steps Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Outlines a sequence of commands or questions for optimizing BC report performance, involving loading methodologies, analyzing code, and seeking specific optimization workflows. ```Text 1. Ask: "Load performance optimization methodology" 2. Ask: "Analyze this report code for performance issues: [paste code]" 3. Ask: "Get optimization workflow for slow report with large dataset" 4. Ask: "What SIFT optimizations apply to this scenario?" ``` -------------------------------- ### Workflow Progress Status Response Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start An example JSON response detailing the progress of a workflow, including its ID, type, current and total phases, progress percentage, current and next specialist, and constitutional gate statuses. ```json { "workflow_id": "workflow-abc123", "type": "code-optimization", "current_phase": 2, "total_phases": 6, "progress_percentage": 33, "current_specialist": "Dean (Performance)", "next_specialist": "Sam (Developer)", "constitutional_gates": { "extensibility_compliance": true, "performance_consideration": false, // ← Still working on this "test_coverage_planned": false } } ``` -------------------------------- ### Configuration Example Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Knowledge-Overrides An example of JSON configuration settings for performance and caching. ```APIDOC ## JSON Configuration Example ### Description Provides example JSON structure for configuring performance and caching parameters. ### Method N/A (Configuration) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ### Configuration Example ```json // JSON configuration with explanatory comments { "performance_settings": { "enable_sift": true, // Enables SIFT optimization "max_records": 10000, // Prevents memory issues "timeout_seconds": 30 // Query timeout protection }, "cache_settings": { "enabled": true, "ttl_minutes": 15 // Cache expiration time } } ``` ``` -------------------------------- ### AL Code Example Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Knowledge-Overrides An example of an AL table definition for customer analytics. ```APIDOC ## AL Table: Customer Analytics ### Description Defines a table to store customer performance metrics. ### Method N/A (Code Definition) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ### AL Code Example ```al // Always include context comments table 50100 "Customer Analytics" { // Purpose: Store customer performance metrics DataClassification = CustomerContent; fields { field(1; "Customer No."; Code[20]) { // Links to standard Customer table TableRelation = Customer."No."; Caption = 'Customer No.'; } field(10; "Total Sales Amount"; Decimal) { // Calculated via SIFT FieldClass = FlowField; CalcFormula = Sum("Sales Line".Amount WHERE("Sell-to Customer No." = FIELD("Customer No."))); Caption = 'Total Sales Amount'; } } keys { key(PK; "Customer No.") { Clustered = true; } // SIFT key for performance key(SalesAnalysis; "Customer No.") { SumIndexFields = "Total Sales Amount"; } } } ``` ``` -------------------------------- ### Create custom analysis tools with BCKB SDK Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Demonstrates how to create a custom analyzer class using the BCKBClient SDK to analyze AL files for custom patterns. ```typescript // Create custom analysis tools import { BCKBClient } from './src/sdk/bckb-client.js'; class CustomAnalyzer { constructor(private client: BCKBClient) {} async analyzeProject(projectPath: string) { // Your custom analysis logic const files = await this.getAllALFiles(projectPath); const analyses = await Promise.all( files.map(file => this.client.analyzeCode({ code_snippet: file.content, analysis_type: 'custom' })) ); return this.consolidateResults(analyses); } } ``` -------------------------------- ### Retrieve AL error handling best practices Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Retrieves specific best practices related to AL error handling from the BCKB knowledge base. ```bash bckb get "al-error-handling-best-practices" ``` -------------------------------- ### REST API Example Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Knowledge-Overrides An example of a REST API request to create a customer in Business Central. ```APIDOC ## POST /api/v2.0/companies({{company-id}})/customers ### Description Creates a new customer record in the specified company. ### Method POST ### Endpoint /api/v2.0/companies/{{company-id}}/customers ### Parameters #### Request Body - **number** (string) - Required - The unique identifier for the customer. - **displayName** (string) - Required - The name of the customer. - **type** (string) - Optional - The type of customer (e.g., 'Person', 'Company'). - **email** (string) - Optional - The email address of the customer. ### Request Example ```http POST /api/v2.0/companies({{company-id}})/customers Content-Type: application/json Authorization: Bearer {{access-token}} { "number": "C001", "displayName": "Acme Corporation", "type": "Company", "email": "contact@acme.com" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the created customer. - **number** (string) - The customer number. - **displayName** (string) - The customer's display name. #### Response Example ```json { "id": "a_guid_for_the_customer", "number": "C001", "displayName": "Acme Corporation" } ``` ``` -------------------------------- ### Configure BC Version using JSON Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Sets the current Business Central version context by creating a `.bcbp-config.json` file. This ensures accurate analysis and guidance based on the specified version. ```json { "version_context": { "current_version": "23.1" } } ``` -------------------------------- ### Scenario 4: Troubleshooting Steps Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Details steps for debugging BC performance issues, including activating specialists, analyzing potential causes, examining query patterns, and initiating systematic analysis. ```Text 1. Ask: "Activate BC Debugger Specialist" 2. Ask: "What could cause slow page loading in BC?" 3. Ask: "Analyze this query pattern: [paste AL code]" 4. Ask: "Start systematic analysis phase for performance debugging" ``` -------------------------------- ### Conventional Commit Message Example Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Contributing-Guide An example of a conventional commit message following the 'feat' type for adding a new feature. This promotes a standardized way of communicating changes. ```bash git commit -m "feat: add methodology validation framework" ``` -------------------------------- ### GitHub Actions: BC Knowledge Integration Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Configuration-Examples This GitHub Actions workflow automates BC Knowledge integration. It checks out code, sets up Node.js, installs and configures the BC Knowledge CLI, analyzes code changes, generates recommendations, and comments on pull requests with the findings. ```yaml name: BC Knowledge Integration on: push: branches: [main, develop] pull_request: branches: [main] env: BCKB_SERVER_URL: ${{ secrets.BCKB_SERVER_URL }} BCKB_API_KEY: ${{ secrets.BCKB_API_KEY }} jobs: bc-knowledge-analysis: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '18' - name: Install BC Knowledge CLI run: npm install -g @bc-knowledge/cli - name: Configure BC Knowledge run: | bckb configure \ --server-url ${{ env.BCKB_SERVER_URL }} \ --api-key ${{ env.BCKB_API_KEY }} - name: Analyze changes run: | bckb analyze \ --git-diff origin/main..HEAD \ --focus performance,maintainability,security \ --output bc-analysis.json - name: Generate recommendations run: | bckb recommend \ --input bc-analysis.json \ --scenario "pull_request_review" \ --output recommendations.md - name: Comment on PR if: github.event_name == 'pull_request' uses: actions/github-script@v6 with: script: | const fs = require('fs'); const recommendations = fs.readFileSync('recommendations.md', 'utf8'); await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: `## BC Knowledge Base Recommendations\n\n${recommendations}` }); ``` -------------------------------- ### Deprecation Management Example (YAML) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Knowledge-System A YAML example showcasing deprecation management for a legacy pattern. It specifies the version in which the pattern was deprecated, its replacement, a migration guide, and the end-of-life version. ```yaml --- title: "Legacy Pattern - Classic Report Design" bc_versions: "14..19" deprecation: deprecated_in: "20" replacement: "modern-report-patterns" migration_guide: "report-modernization-guide" end_of_life: "25" --- ``` -------------------------------- ### Execute Pre-Production Review Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Launches a comprehensive pre-production review workflow for a specific module. This ensures a thorough analysis before deployment, with a focus on compliance and stability. ```bash workflow_pure_review({ review_target: "Complete sales module", review_depth: "comprehensive" }) ``` -------------------------------- ### Extract and display popular team topics Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Connects to the BCKB server, retrieves system analytics, and displays the top 5 most accessed topics for team knowledge sharing. ```typescript // Extract team insights const client = new BCKBClient(BCKBClientDefaults.local()); await client.connect(); // Get popular topics for team knowledge sharing const analytics = await client.getSystemAnalytics(); const popularTopics = analytics.usage_patterns.most_accessed_topics; console.log('Share these topics with the team:'); popularTopics.slice(0, 5).forEach(topic => { console.log(`- ${topic.title}: ${topic.access_count} views`); }); ``` -------------------------------- ### Check file permissions Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Checks the permissions of the 'dist/index.js' file. ```bash # Check permissions ls -la dist/index.js ``` -------------------------------- ### Execute Code Optimization Workflow Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Initiates a code optimization workflow by specifying the code location. This workflow guides the analysis and improvement of BC code performance. ```bash 1. workflow_code_optimization({ code_location: "src/SlowReport.al" }) 2. Alex analyzes architecture impact 3. Dean identifies SIFT violations 4. Sam recommends coding improvements 5. Eva adds error handling 6. Roger validates maintainability ``` -------------------------------- ### Intelligent BCAssistant Usage Example (TypeScript) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/advanced-usage-examples.md Demonstrates how to use the IntelligentBCAssistant class. It includes initializing the assistant, listening for proactive recommendations, and processing code input. The example shows how to log suggestions and topic details when a recommendation is received. ```TypeScript // Usage example const assistant = new IntelligentBCAssistant(); await assistant.initialize(); // Listen for proactive recommendations assistant.on('proactive_recommendation', (recommendation) => { console.log('💡 Suggestion:', recommendation.reason); recommendation.topics.forEach(topic => { console.log(` - ${topic.title} (${topic.domain})`); }); }); // Process code with intelligent analysis const result = await assistant.processCodeInput(` ``` -------------------------------- ### Manage npm Dependencies Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Troubleshooting Check for missing npm dependencies, install them, or force a clean installation if the existing ones are corrupted. This is crucial for MCP server functionality. ```bash # Check for missing dependencies npm list --depth=0 # Install missing dependencies npm install # Force reinstall if corrupted npm ci ``` -------------------------------- ### Consultant Configuration Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Quick-Start Sets up a configuration tailored for consultants, emphasizing flexibility in knowledge layers and a guided approach to methodology enforcement. This aids in adapting to various client needs. ```json { "consultant_config": { "layers": ["embedded", "personal-library", "client-standards"], "knowledge_priority": "flexibility", "methodology_enforcement": "guided" } } ``` -------------------------------- ### Manage Node.js Versions with NVM Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Installation-Guide Installs and switches to Node.js version 18 using NVM (Node Version Manager) to resolve potential version-related issues with the MCP server. ```bash node --version # Should be v18+ nvm install 18 && nvm use 18 ``` -------------------------------- ### Check BCKB server status and search latest features Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/blob/main/examples/quick-start-guide.md Retrieves the current status of the BCKB server and searches for the latest features with a limit of 5 results. ```bash # Morning: Check what's new bckb status bckb search "latest BC features" --limit 5 ``` -------------------------------- ### Install and Run BC Knowledge Base MCP Server (Level 0) Source: https://github.com/jeremyvyska/bc-code-intelligence-mcp/wiki/Basic-Configuration Installs the BC Knowledge Base MCP Server globally and runs it with default zero configuration. This is suitable for immediate use and provides basic features like embedded knowledge and automatic project override detection. ```bash npm install -g bc-knowledgebase-mcp bc-mcp ```