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.
-
An MCP-compatible AI assistant
- IBM Project Bob
- Claude Desktop
- VS Code with MCP extension
- Cursor IDE
- Claude Code
-
uv package manager
Install uv to run the MCP server:
macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
winget install --id=astral-sh.uv -eVerify installation:
uv --version -
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:
- Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens.
- Click Generate new token.
- Configure the token:
- Repository access: Public repositories only
- Permissions: No private access scopes needed
- Expiration: Set to 90 days or longer
- 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
-
Open IBM Project Bob Marketplace:
- Click the marketplace icon in the Bob pane.
- Navigate to the MCP tab.
-
Find and install TIM-MCP:
- Search for "Terraform IBM Modules (TIM)".
- Click Install on the TIM-MCP server card.
-
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").
-
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).
-
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:
-
Create
.bob/mcp.jsonin your project directory:mkdir -p .bob -
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:
- Click the Settings icon (⚙️) in the top navigation of the Bob pane.
- Scroll to the bottom of the MCP settings view.
- Click Edit Global MCP to open
mcp_settings.json. - Add the TIM-MCP configuration by using the same JSON format as mentioned in the Install TIM-MCP for Claude Desktop section.
- Verify the installation:
- Click the Settings icon (⚙️) in the Bob panel → MCP settings to confirm
tim-mcpshows as connected.
- Click the Settings icon (⚙️) in the Bob panel → MCP settings to confirm
Install TIM-MCP for Claude Desktop
Claude Desktop is a standalone application that supports MCP servers through JSON configuration.
-
Locate the configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
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" } } } } -
Restart Claude Desktop completely.
-
Verify the installation:
- Check Settings icon (⚙️) → Connectors to confirm
tim-mcpis connected.
- Check Settings icon (⚙️) → Connectors to confirm
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
-
Configure TIM-MCP by using one of these methods:
- Create
.vscode/mcp.jsonin your project directory. - Use Command Palette (Ctrl+Shift+P or Cmd+Shift+P) →
MCP: Add Server.
- Create
-
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" } } } } -
Restart VS Code.
-
To start the server, open the Command Palette (Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS), select
MCP: Show Servers, right-clicktim-mcp, and selectStart Server.
Install TIM-MCP for Cursor
Cursor IDE supports MCP servers through configuration files.
-
Create the configuration file:
- Project-level:
.cursor/mcp.jsonin your project directory. - Global:
~/.cursor/mcp.jsonfor all projects.
- Project-level:
-
Add the TIM-MCP configuration by using the same JSON format as mentioned in the Install TIM-MCP for Claude Desktop section.
-
Verify the installation:
- Check MCP Servers panel to confirm
tim-mcpis connected.
- Check MCP Servers panel to confirm
Install TIM-MCP for Claude Code
Claude Code supports MCP configuration via CLI or config file.
-
Navigate to your project directory:
cd /path/to/your/project -
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-mcpWithout GitHub token:
claude mcp add tim-mcp -- uvx --from git+https://github.com/terraform-ibm-modules/tim-mcp.git tim-mcp -
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:
- Start with clear requirements - Describe your infrastructure needs, constraints, and compliance requirements.
- Review generated code - Always review AI-generated Terraform code before applying.
- Test in non-production - Deploy to development or staging environments first.
- Validate configurations - Run
terraform planto review changes before applying. - Use version pinning - Pin module versions in production deployments.
- Follow security best practices - Review security group rules, IAM policies, and encryption settings.
- 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
- Explore Terraform IBM Modules.
- Learn about Model Context Protocol.
- Review IBM Cloud Terraform best practices white paper.
- Join the Terraform IBM Modules community.