Skip to main content
Claude Code is the official CLI tool for Claude that provides built-in MCP server management commands. It supports both local (stdio) and remote (HTTP) server connections with a simple command-line interface.
Platform Support: macOS, Linux, Windows Transport Modes: Stdio (local) and HTTP (remote) Authentication: Bearer Token for HTTP mode

Prerequisites

Ensure you have Claude Code installed:

Local (Stdio) Setup

Configure a local server that Claude Code will spawn and manage:

Using CLI Commands

Option 1: Interactive setup
Option 2: With environment variable file

Using Configuration File

Edit ~/.claude.json:
Important: The --tools path must be an absolute path, not relative.

Remote (HTTP) Setup

Connect to a remote IBM i MCP Server:

Using CLI Commands

Using Configuration File

Edit ~/.claude.json:
Getting Access Tokens: Use node get-access-token.js --verbose from the server directory to obtain authentication tokens.

Environment Variable Expansion

Claude Code supports environment variable expansion for secure credential management:
Supported syntax:
  • ${VAR} - Expands to the value of environment variable VAR
  • ${VAR:-default} - Expands to VAR if set, otherwise uses default

Managing Servers

Claude Code provides convenient commands for managing MCP servers:

Testing the Connection

After configuration:

CLI Options for Server Command

When adding servers, you can use various CLI options:

Troubleshooting

Symptoms: npx: command not found or ibmi-mcp-server: not foundSolutions:
  • Ensure Node.js and npm are installed: node --version
  • Install server globally: npm link from server directory
  • Use full node path:
Symptoms: 401 Unauthorized for remote connectionsSolutions:
  • Get fresh token: node get-access-token.js --verbose
  • Verify server is running with auth enabled
  • Check token hasn’t expired (default: 1 hour)
  • Ensure header format is correct: Authorization: Bearer TOKEN
Symptoms: Server starts but no tools availableSolutions:
  • Verify tools path is absolute: /full/path/to/tools
  • Check YAML files are valid
  • Test tools path: npx -y @ibm/ibmi-mcp-server@latest --list-toolsets --tools /path
  • Check IBM i connection credentials

Advanced Configuration

Multiple Environments

Configure different servers for dev and production:

Custom Tool Paths

Switch between different tool configurations:

Next Steps

CLI Reference

Learn all CLI options for the server

Configuration

Explore environment variables

SQL Tools

Create custom SQL operations

Other Clients

Explore other MCP clients

Additional Resources