Configure F5XC API MCP Server with OpenCode AI Assistant¶
Configure the F5XC API MCP Server with OpenCode AI Assistant for natural language interaction with F5XC APIs.
Prerequisites
- OpenCode AI Assistant installed
- Node.js 24+ installed (for npx)
Configuration¶
Step 1: Locate Config File¶
OpenCode uses opencode.json or opencode.jsonc configuration files:
Step 2: Add MCP Server¶
Edit the config file and add the F5XC API server under the mcp key:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"f5xc-api": {
"type": "local",
"command": ["npx", "@robinmordasiewicz/f5xc-api-mcp"],
"environment": {
"F5XC_API_URL": "https://your-tenant.console.ves.volterra.io",
"F5XC_P12_BUNDLE": "/path/to/certificate.p12",
"F5XC_P12_PASSWORD": "your-password"
}
}
}
}
Adding to Existing Config
If you already have an opencode.json with other settings, add the mcp section alongside your existing configuration:
Step 3: Restart OpenCode¶
Full Restart Required
Completely quit and restart OpenCode AI Assistant for changes to take effect. Just refreshing the interface is not sufficient.
Verification¶
After restart, OpenCode should have access to F5XC tools. Try asking:
"What F5XC API tools are available?"
Or check the server info:
"Get the F5XC API server info"
Multiple MCP Servers¶
You can run multiple MCP servers alongside F5XC:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"f5xc-api": {
"type": "local",
"command": ["npx", "@robinmordasiewicz/f5xc-api-mcp"]
},
"filesystem": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
}
}
}
Configuration Reference¶
Required Fields¶
| Field | Description |
|---|---|
type | Must be "local" for stdio-based MCP servers |
command | Array of command and arguments (e.g., ["npx", "package-name"]) |
Optional Fields¶
| Field | Description | Default |
|---|---|---|
environment | Object with environment variables | {} |
enabled | Whether to load the server on startup | true |
timeout | Response timeout in milliseconds | 5000 |
Troubleshooting¶
Server Not Loading¶
- Validate JSON syntax (use a JSON validator or
.jsoncfor comments) - Ensure
type: "local"is specified - Verify
commandis an array, not a string - Completely quit OpenCode (not just close window)
- Check OpenCode logs for errors
Authentication Issues¶
Verify Credentials First
Test your credentials work before configuring:
- Verify your API URL is correct
- Check your API token hasn't expired
- For P12 certificates, verify the file path is absolute
- Ensure the password is correct
npx Issues¶
If npx fails to find the package:
# Clear npx cache
npx clear-npx-cache
# Or use -y flag to auto-confirm
npx -y @robinmordasiewicz/f5xc-api-mcp
Advanced Configuration¶
Custom Node Path¶
If Node.js isn't in your PATH:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"f5xc-api": {
"type": "local",
"command": ["/usr/local/bin/node", "/path/to/f5xc-api-mcp/dist/index.js"]
}
}
}
Logging¶
Enable debug logging:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"f5xc-api": {
"type": "local",
"command": ["npx", "@robinmordasiewicz/f5xc-api-mcp"],
"environment": {
"LOG_LEVEL": "debug"
}
}
}
}
Environment Variable References¶
OpenCode supports environment variable references using {env:VAR_NAME} syntax: