Using TIM-MCP with AI assistants

Learn how to set up and use the Terraform IBM Modules MCP Server (TIM-MCP) with AI assistants to accelerate IBM Cloud infrastructure development with best practices and validated module patterns.

Always review AI-generated infrastructure code with skilled practitioners before deploying to any environment.

What is TIM-MCP?

The Terraform IBM Modules MCP Server (TIM-MCP) implements the Model Context Protocol (MCP) to connect AI assistants with the Terraform IBM Modules ecosystem. This integration enables AI models to:

  • Search and discover relevant IBM Cloud Terraform modules
  • Access accurate module documentation, inputs, and outputs
  • Retrieve implementation examples and best practices
  • Generate infrastructure code following IBM Cloud standards

Why use TIM-MCP?

TIM-MCP enhances AI-assisted infrastructure development by:

Steering toward best practices
Without TIM-MCP, AI models might generate generic or outdated Terraform code. TIM-MCP guides models toward IBM-validated patterns and current best practices.
Providing contextual guardrails
TIM-MCP helps AI models navigate the complex IBM Cloud ecosystem with structured access to module interfaces, dependencies, and implementation patterns.
Ensuring accuracy
Foundation models may have limited or outdated knowledge of IBM Cloud modules. TIM-MCP provides real-time access to module details, ensuring accurate parameter usage and proper versioning.
Unlocking distributed knowledge
By connecting models to documentation across many repositories, TIM-MCP helps AI leverage the collective expertise embedded in the Terraform IBM Modules ecosystem.

Before you begin

Before you can use TIM-MCP, you need the following prerequisites.

  1. An MCP-compatible AI assistant

  2. uv package manager

    Install uv to run the MCP server:

    macOS/Linux:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

    Windows:

    winget install --id=astral-sh.uv -e
    

    Verify installation:

    uv --version
    
  3. GitHub Personal Access Token (optional but recommended)

    A GitHub token helps avoid API rate limits:

    • Without token: 60 requests/hour
    • With token: 5,000 requests/hour

    To create a token:

    1. Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens.
    2. Click Generate new token.
    3. Configure the token:
      • Repository access: Public repositories only
      • Permissions: No private access scopes needed
      • Expiration: Set to 90 days or longer
    4. Copy and save the token securely.

Install TIM-MCP for IBM Project Bob

IBM Project Bob supports MCP servers through the IBM Project Bob Marketplace or manual configuration files.

Install from IBM Project Bob Marketplace

  1. Open IBM Project Bob Marketplace:

    • Click the marketplace icon in the Bob pane.
    • Navigate to the MCP tab.
  2. Find and install TIM-MCP:

    • Search for "Terraform IBM Modules (TIM)".
    • Click Install on the TIM-MCP server card.
  3. Choose installation method:

    • Installation Scope: Select Project (current workspace) or Global (all workspaces).
    • Installation Method: Choose UVX or UVX (Pinned Version).
    • Version:
      • For latest version: Leave as "latest".
      • For pinned version (recommended for production): Enter specific version (e.g., "v1.0.0").
  4. Configure GitHub token (optional but recommended):

    • In the GitHub Token field, enter your GitHub personal access token.
    • This helps avoid API rate limits (60 requests/hour without token, 5,000 with token).
  5. Complete installation:

    • Click Install.
    • The server will be automatically configured with your settings.

Manual configuration

If you prefer manual configuration or need project-specific settings:

Project-level configuration:

  1. Create .bob/mcp.json in your project directory:

    mkdir -p .bob
    
  2. Add the configuration:

    {
      "mcpServers": {
        "tim-mcp": {
          "command": "uvx",
          "args": [
            "--from",
            "git+https://github.com/terraform-ibm-modules/tim-mcp.git",
            "tim-mcp"
          ],
          "env": {
            "GITHUB_TOKEN": "your_github_token_here"
          }
        }
      }
    }
    

Global configuration:

  1. Click the Settings icon (⚙️) in the top navigation of the Bob pane.
  2. Scroll to the bottom of the MCP settings view.
  3. Click Edit Global MCP to open mcp_settings.json.
  4. Add the TIM-MCP configuration by using the same JSON format as mentioned in the Install TIM-MCP for Claude Desktop section.
  5. Verify the installation:
    • Click the Settings icon (⚙️) in the Bob panel → MCP settings to confirm tim-mcp shows as connected.

Install TIM-MCP for Claude Desktop

Claude Desktop is a standalone application that supports MCP servers through JSON configuration.

  1. Locate the configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add TIM-MCP configuration:

    Basic configuration (without GitHub token):

    {
      "mcpServers": {
        "tim-mcp": {
          "command": "uvx",
          "args": [
            "--from",
            "git+https://github.com/terraform-ibm-modules/tim-mcp.git",
            "tim-mcp"
          ]
        }
      }
    }
    

    Recommended configuration (with GitHub token):

    {
      "mcpServers": {
        "tim-mcp": {
          "command": "uvx",
          "args": [
            "--from",
            "git+https://github.com/terraform-ibm-modules/tim-mcp.git",
            "tim-mcp"
          ],
          "env": {
            "GITHUB_TOKEN": "your_github_token_here"
          }
        }
      }
    }
    
  3. Restart Claude Desktop completely.

  4. Verify the installation:

    • Check Settings icon (⚙️) → Connectors to confirm tim-mcp is connected.

Install TIM-MCP for VS Code

VS Code supports MCP servers through the MCP extension.

Quick install

To install TIM-MCP directly into VS Code, click Install TIM-MCP (requires VS Code 1.99+ with GitHub Copilot).

Manual installation

  1. Configure TIM-MCP by using one of these methods:

    • Create .vscode/mcp.json in your project directory.
    • Use Command Palette (Ctrl+Shift+P or Cmd+Shift+P) → MCP: Add Server.
  2. Add the configuration:

    {
      "servers": {
        "tim-mcp": {
          "command": "uvx",
          "args": [
            "--from",
            "git+https://github.com/terraform-ibm-modules/tim-mcp.git",
            "tim-mcp"
          ],
          "env": {
            "GITHUB_TOKEN": "your_github_token_here"
          }
        }
      }
    }
    
  3. Restart VS Code.

  4. To start the server, open the Command Palette (Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS), select MCP: Show Servers, right-click tim-mcp, and select Start Server.

Install TIM-MCP for Cursor

Cursor IDE supports MCP servers through configuration files.

  1. Create the configuration file:

    • Project-level: .cursor/mcp.json in your project directory.
    • Global: ~/.cursor/mcp.json for all projects.
  2. Add the TIM-MCP configuration by using the same JSON format as mentioned in the Install TIM-MCP for Claude Desktop section.

  3. Verify the installation:

    • Check MCP Servers panel to confirm tim-mcp is connected.

Install TIM-MCP for Claude Code

Claude Code supports MCP configuration via CLI or config file.

  1. Navigate to your project directory:

    cd /path/to/your/project
    
  2. Add TIM-MCP using the CLI:

    With GitHub token (recommended):

    claude mcp add tim-mcp --env GITHUB_TOKEN=your_github_token_here \
      -- uvx --from git+https://github.com/terraform-ibm-modules/tim-mcp.git tim-mcp
    

    Without GitHub token:

    claude mcp add tim-mcp -- uvx --from git+https://github.com/terraform-ibm-modules/tim-mcp.git tim-mcp
    
  3. Verify configuration:

    claude mcp list
    

Use TIM-MCP with AI assistants

Once TIM-MCP is configured, your AI assistant can help you build IBM Cloud infrastructure from simple to complex deployments.

Getting started examples

Try these prompts to get started:

Simple virtual server:

I want to create a simple basic virtual server on IBM Cloud and SSH to it

OpenShift cluster:

I am new to IBM Cloud. Help me create a simple and cheap OpenShift cluster and access the console

Enterprise infrastructure examples

For more complex scenarios:

VPC with OpenShift:

Design a VPC + OpenShift: Create a complete container platform with networking,
including multi-zone VPC, subnets, OpenShift/ROKS cluster, and load balancers

Secure landing zone:

Design a Secure Landing Zone: Implement enterprise-grade security with network
isolation, encryption key management, private endpoints, and security groups

Multi-zone HA database:

Design a Multi-Zone HA Database: Design resilient database infrastructure across
3+ availability zones with automated failover, backup strategies, and disaster recovery

Financial Services validated architecture:

Design a FS-Validated Architecture: Deploy compliant infrastructure meeting
Financial Services requirements with HPCS encryption, audit logging, and regulatory controls

Best practices for AI-assisted development

When using TIM-MCP with AI assistants:

  1. Start with clear requirements - Describe your infrastructure needs, constraints, and compliance requirements.
  2. Review generated code - Always review AI-generated Terraform code before applying.
  3. Test in non-production - Deploy to development or staging environments first.
  4. Validate configurations - Run terraform plan to review changes before applying.
  5. Use version pinning - Pin module versions in production deployments.
  6. Follow security best practices - Review security group rules, IAM policies, and encryption settings.
  7. Document customizations - Add comments explaining any modifications to generated code.

Troubleshooting

To troubleshoot errors that you experience when you use TIM-MCP, visit the topic, How can I resolve the errors while experimenting with TIM-MCP server ?.

Version pinning for production

For production use, pin TIM-MCP to a specific version to ensure consistent behavior:

{
  "mcpServers": {
    "tim-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/terraform-ibm-modules/tim-mcp.git@v1.0.0",
        "tim-mcp"
      ],
      "env": {
        "GITHUB_TOKEN": "your_github_token_here"
      }
    }
  }
}

Check the TIM-MCP releases page for the latest version.

Next steps