Configuring MCP server for CUAZ

This topic explains how to configure the Model Context Protocol (MCP) server for COBOL Upgrade Advisor for z/OS® in IBM Bob™.

Prerequisites

  • Ensure that IBM Bob IDE 2.0.1 or later is installed and running.
  • Install the COBOL Upgrade Advisor extension into IBM Bob.
  • Ensure that the CUAZ MCP server is accessible at http://localhost:4000/mcp.
  • Ensure that the project containing the load library, application, or invalid data detection report is open in the Side Bar. For more information, see Projects and reports.

Procedure

Follow these steps to configure the MCP server and access CUAZ MCP tools in Bob.

  1. Configure the MCP server connection in Bob.
    1. Select the Settings icon in Bob panel to open Bob Settings.
    2. Navigate to the MCP tab, and then click to add a new MCP server.
    3. Set the Configuration Scope to Global.
    4. Click Open Configuration File, and add the following JSON configuration:
      {"mcpServers":
        {"cuaz-tools":
           {
           "type":"streamable-http",
           "url":"http://localhost:4000/mcp",
           "alwaysAllow":[],
           "disabled":false
           }
         }
      }
  2. Create a custom COBOL Upgrade Advisor mode.
    1. Create a new YAML file on your local system, for example cuaz-mode.yaml, and add the following configuration.
      customModes:
        - slug: cobol-upgrade-advisor
          name: COBOL Upgrade Advisor
          roleDefinition: >-
            You are an AI assistant for IBM COBOL Upgrade Advisor for z/OS (CUAZ)
      
            CRITICAL - FIRST INTERACTION BEHAVIOR (MANDATORY):
            On EVERY first interaction, you MUST immediately:
            1. Call access_mcp_resource to fetch prompt://cuaz_agent_greeting from "cuaz-mcp" server
            2. Present the greeting content exactly as received
            3. Execute any [AGENT: ...] instructions in the greeting (never show these to users)
      
            ALWAYS fetch and present the MCP greeting FIRST before any other interaction
      
            **Your Role:**
            Help users upgrade COBOL applications using CUAZ 
            
            **Available MCP Resources:**
            - `prompt://cuaz_agent_greeting` - Welcome and capabilities overview
            - `prompt://cuaz_smart_code_converter` - Upgrade old COBOL programs to COBOL 85 compatible syntax
            - `prompt://cuaz_invalid_data_detection` - Fix runtime or invalid data issues 
      
            **Key Principles:**
            1. Fetch prompts and follow instructions in prompts
            2. Use technical terminology as defined in prompts
            3. Never make up z/OS commands - only use operations from MCP prompts
             
          whenToUse: >- 
            Use this when users need help using CUAZ
            - Identify programs with old COBOL syntax
            - Upgrade COBOL source to Enterprise COBOL compatible standards
            - Fix COBOL compilation errors
            - Fix invalid data errors at runtime
      
          description: Help identify and fixing syntax issues and compilation/runtime
            errors during COBOL compiler upgrade.
      
          customInstructions: >-
            **When user wants to upgrade COBOL programs :**
            1. Fetch and follow instructions from prompt://cuaz_smart_code_converter
            
            **When user wants to fix runtime or invalid data issues:**
            1. Fetch and follow instructions from prompt://cuaz_invalid_data_detection
      
          groups:
            - read
            - edit
            - mcp
            - modes
            - command
            - browser
          source: project
    2. In Bob Settings, navigate to the Modes tab.
    3. Select to import the yaml file you created.

      The new COBOL Upgrade Advisor mode will appear in the available modes list.

  3. Enable MCP in VS Code.
    1. Open VS Code Settings and navigate to Extensions.
    2. Locate the COBOL Upgrade Advisor Extension settings.
    3. Enable the Enable the CUAZ Model Context Protocol (MCP) server option.
    Note:
    • If the CUAZ MCP server is displayed as Disconnected on the MCP tab in Bob Settings, click to refresh the server connection.
    • If the CUAZ MCP server returns a timeout error, select the server from the list on the MCP tab in Bob Settings, and then increase the Network timeout value.
  4. To use the CUAZ tools in Bob, select the COBOL Upgrade Advisor mode from the mode selector.

    The CUAZ MCP tools will now be available for analyzing the inventory and invalid data detection reports, upgrading COBOL syntax, and resolving invalid data runtime issues.

Note: When using AI assistants, it is recommended that you do not enable the auto approve features to avoid unintended changes or data loss.