n8n community node for OpenCode Server API - enables session management, message operations, and AI agent integration for AI coding assistant automation in n8n workflows.
This skill enables integration between n8n workflows and OpenCode AI Server, allowing you to automate AI coding assistant operations through n8n's visual workflow builder.
Provides three specialized n8n nodes for interacting with OpenCode Server:
You must have:
1. **OpenCode Server** running and accessible
2. **n8n** instance (version 1.0.0+)
3. **Node.js** 18.0.0 or later
```bash
curl -fsSL https://opencode.ai/install | bash
```
Alternative installation methods available at: https://opencode.ai/docs/installation/
For enhanced capabilities including Sisyphus agent (Claude Opus 4.5):
```bash
bunx oh-my-opencode install
```
```bash
OPENCODE_SERVER_USERNAME=your_username OPENCODE_SERVER_PASSWORD=your_password opencode serve --port 4096
```
**Production deployment**: Use secure environment files, HTTPS reverse proxy, and strong authentication.
In your n8n instance:
1. Navigate to **Settings > Community Nodes**
2. Click **Install**
3. Enter: `n8n-nodes-opencode-ai`
4. Click **Install**
1. Create new **OpenCode Server API** credential
2. Set **Base URL**: `http://127.0.0.1:4096` (or your server URL)
3. Set **Username** and **Password** (matching your server credentials)
#### Session Management
**Create Session:**
1. Add **OpenCode** node to workflow
2. Select **Session** resource
3. Choose **Create** operation
4. Configure agent (default: `claude-sonnet-4.5-20250929`)
5. Execute
**List Sessions:**
1. Select **Session** resource
2. Choose **List** operation
3. Execute to see all active sessions
#### Send Messages
**Synchronous Message:**
1. Add **OpenCode** node
2. Select **Message** resource
3. Choose **Send** operation
4. Select or create session
5. Enter message content
6. Execute and receive response
**Asynchronous Message:**
1. Same setup as synchronous
2. Choose **Send Async** operation
3. Returns immediately without waiting for completion
#### Execute Commands
**Slash Commands:**
1. Select **Message** resource
2. Choose **Execute Command** operation
3. Enter command (e.g., `/help`, `/clear`)
**Shell Commands:**
1. Select **Message** resource
2. Choose **Run Shell** operation
3. Enter shell command
4. Optionally set working directory
**Using OpenCode as Chat Model:**
1. Add **OpenCode Chat Model** node
2. Configure credentials
3. Select agent/model
4. Connect to **AI Agent** node
**Using OpenCode as Tool:**
1. Add **OpenCode Tool** node
2. Configure credentials
3. Set tool name and description
4. Connect to **AI Agent** node
5. Agent can now delegate coding tasks to OpenCode
Enable for stateless operations:
1. In any Message operation
2. Toggle **Temporary Session** option
3. Session auto-creates and deletes per request
**Automated Code Review:**
1. Trigger on git webhook
2. Create OpenCode session
3. Send code diff for review
4. Parse AI response
5. Post to Slack/GitHub
**Batch File Processing:**
1. Loop through files
2. Use temporary sessions
3. Send each file for analysis
4. Aggregate results
5. Generate report
**AI Agent with OpenCode Backend:**
1. User message triggers workflow
2. AI Agent node processes intent
3. Delegates coding tasks to OpenCode Tool
4. Returns formatted response
1. **Never hardcode credentials** in workflows
2. Use **environment variables** for sensitive data
3. Deploy server behind **HTTPS reverse proxy**
4. Implement **IP allowlisting** where possible
5. Use **strong, unique passwords**
6. **Rotate credentials** regularly
7. **Monitor access logs** for suspicious activity
**Connection Failed:**
**Authentication Error:**
**Timeout Issues:**
**Model Not Available:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/n8n-opencode-integration/raw