Skip to main content
The IBM i MCP Server includes a curated collection of pre-built SQL tools in the tools/ directory. These production-ready tools cover common IBM i operations from system monitoring to security analysis, allowing you to start building AI agents immediately without writing custom YAML configurations.
Prerequisites: This guide assumes you’ve completed the Quickstart and have:
  • IBM i database credentials configured (DB2i_HOST, DB2i_USER, DB2i_PASS)
  • Access to the pre-built tools directory (clone or download from GitHub)

Getting the Tools Directory

Download the pre-built tools from the repository:
All examples use npx @ibm/ibmi-mcp-server to run the published package. Point --tools to wherever you’ve saved the tools/ directory.

Available Tool Categories

The tools/ directory contains pre-built tool configurations organized by functional domain:
List All Available Toolsets:
This command shows all toolsets with descriptions and tool counts.

Loading Strategies

1. Load All Tools from Directory

Load every YAML file in the tools/ directory and all subdirectories:
Important: When loading all tools from the directory, you must set YAML_ALLOW_DUPLICATE_SOURCES=true. Multiple YAML files define the same database sources (e.g., ibmi-system), and this setting allows the server to merge them instead of failing with a duplicate source error.
Alternative: Use .env file Create a .env file in your working directory:
Then start the server:
What happens:
  • Recursively scans tools/ for all .yaml files
  • Loads all tools from all categories
  • Makes every toolset available to AI agents
  • Merges sources, tools, and toolsets across files
  • Allows duplicate source definitions (e.g., ibmi-system appears in multiple files)
Why Duplicate Sources? Each YAML file is designed to be self-contained with its own source definitions. When loading multiple files, the same database connection (like ibmi-system) appears in multiple files. The YAML_ALLOW_DUPLICATE_SOURCES=true setting intelligently merges these duplicate definitions.

2. Load Specific Configuration File

Target a single YAML file for focused operations:
Includes tools for:
  • System status and health
  • Active job monitoring
  • Memory pool utilization
  • HTTP server statistics
Benefits:
  • Fast startup - Only loads tools from specified file
  • Clear scope - Agent sees only relevant tools for the task
  • Easy debugging - Isolated tool configuration
  • Production ready - Minimal resource usage
  • No duplicate sources - Single file = single source definition

3. Load Specific Toolsets

Select logical groups of tools across multiple files using toolset filtering:
Discover Available Toolsets: Before loading specific toolsets, list all available default toolsets and their tools:
This shows toolset names, descriptions, and tool counts to help you choose which ones to load.

Single Toolset

Result: Only tools tagged with performance_monitoring toolset are loaded, even though all YAML files are scanned.

Multiple Toolsets

Combine related toolsets for comprehensive operations:
Toolset Names: Use the exact toolset identifiers from the YAML configurations. Run --list-toolsets to see available names.

Environment Variables

Configure database connections and runtime behavior:

Required Database Credentials

Server Configuration

Complete Example

Use .env Files: Create a .env file in your working directory for persistent configuration:
The server automatically loads environment variables from .env files in the current directory.

Usage Scenarios

Testing Your Server: Each scenario includes examples for testing with:
  • MCP Inspector: Interactive browser-based tool for exploring and testing MCP tools
  • Agno Agent (Python): Quick AI agent testing with natural language prompts (setup guide)

Scenario 1: Quick System Health Check

Goal: Monitor IBM i system health with AI assistance. Start the server:
In Inspector: Select any performance tool and fill in parameters to execute queries.

Scenario 2: Security Audit

Goal: Perform comprehensive security analysis. Start the server:
In Inspector: Explore security tools like library list analysis and authority checks.

Scenario 3: Development Workflow

Goal: Help developers find and manage IBM i objects. Start the server:
In Inspector: Test developer tools for object statistics and dependency tracking.

Scenario 4: Production Monitoring Dashboard

Goal: Create a monitoring agent with specific tool access. Start the server:
In Inspector: Monitor real-time system performance metrics.

Command Reference

CLI Options

Path Formats

The --tools argument accepts multiple formats:

Troubleshooting

No Tools Loaded

Symptom: Server starts but no tools are available. Solutions:
  1. Verify path exists:
  2. Check path is relative to current directory:
  3. Check for duplicate source errors:
  4. Review server logs: The server outputs to console when using --transport http. Look for YAML parsing errors in the startup output.

Connection Failures

Symptom: Tools load but queries fail with connection errors. Solutions:
  1. Verify environment variables:
  2. Test connection manually:
  3. Check SSL configuration:

Toolset Not Found

Symptom: --toolsets specified but tools don’t load. Solutions:
  1. List available toolsets:
  2. Check exact toolset names:
    • Toolset names are case-sensitive
    • Use underscores, not spaces: performance_monitoring not performance monitoring
  3. Verify toolset exists in YAML:

Best Practices

Development:
  • Use --transport http for easier debugging
  • Load all tools: --tools ./tools (no toolset filter)
  • Enable debug logging: MCP_LOG_LEVEL=debug
  • Allow SSL bypass: DB2i_IGNORE_UNAUTHORIZED=true
  • Set YAML_ALLOW_DUPLICATE_SOURCES=true in .env
Production:
  • Use --transport stdio for MCP client integration
  • Load specific toolsets: --toolsets performance_monitoring
  • Use info logging: MCP_LOG_LEVEL=info
  • Enforce SSL: DB2i_IGNORE_UNAUTHORIZED=false
  • Still need YAML_ALLOW_DUPLICATE_SOURCES=true if loading from directory
Create environment-specific configurations:
  1. Load only needed tools: Use --toolsets to reduce memory
  2. Use specific files: Target exact YAML files instead of directories
  3. Monitor resource usage: Check logs/combined.log for performance metrics
  4. Cache connections: The server automatically pools database connections
  1. Credential management: Use environment variables, never hardcode
  2. Least privilege: Load only toolsets needed for the agent’s role
  3. Audit logging: Enable MCP_LOG_LEVEL=info in production
  4. SSL enforcement: Set DB2i_IGNORE_UNAUTHORIZED=false for production
  5. Read-only tools: Prefer query-only tools for non-admin agents

Next Steps

Building Custom Tools

Learn to create your own YAML SQL tools for custom IBM i operations

Tools Reference

Complete YAML tools configuration reference with all options

Toolsets Guide

Organize tools into logical groups for better agent discovery

Configuration Guide

Complete server configuration and environment variables

Examples Repository

View Default Tools on GitHub

Browse the complete collection of pre-built YAML tools with documentation and examples →
Contributing: Found a bug or want to add a new default tool? Contributions are welcome! See the Contributing Guide for details.