opencode-bridge 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opencode_bridge-0.1.3/.claude-plugin/plugin.json +22 -0
- opencode_bridge-0.1.3/.github/workflows/ci.yml +50 -0
- opencode_bridge-0.1.3/.github/workflows/release.yml +34 -0
- opencode_bridge-0.1.3/.gitignore +28 -0
- opencode_bridge-0.1.3/PKG-INFO +151 -0
- opencode_bridge-0.1.3/README.md +129 -0
- opencode_bridge-0.1.3/opencode_bridge/__init__.py +3 -0
- opencode_bridge-0.1.3/opencode_bridge/install.py +57 -0
- opencode_bridge-0.1.3/opencode_bridge/server.py +817 -0
- opencode_bridge-0.1.3/pyproject.toml +47 -0
- opencode_bridge-0.1.3/skills/opencode.md +120 -0
- opencode_bridge-0.1.3/uv.lock +752 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opencode-bridge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Continuous discussion sessions with OpenCode (GPT-5, Claude, Gemini)",
|
|
5
|
+
"author": "Antonio Fernandez-Guerra",
|
|
6
|
+
"repository": "https://github.com/genomewalker/opencode-bridge",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": ["opencode", "gpt", "discussion", "code-review", "mcp"],
|
|
9
|
+
"mcpServers": {
|
|
10
|
+
"opencode-bridge": {
|
|
11
|
+
"command": "opencode-bridge",
|
|
12
|
+
"description": "Continuous OpenCode discussion sessions"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"skills": [
|
|
16
|
+
{
|
|
17
|
+
"name": "opencode",
|
|
18
|
+
"file": "skills/opencode.md",
|
|
19
|
+
"description": "Start continuous discussion with OpenCode"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v4
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv pip install --system -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
- name: Check import
|
|
31
|
+
run: python -c "from opencode_bridge.server import OpenCodeBridge; print('OK')"
|
|
32
|
+
|
|
33
|
+
lint:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- name: Set up Python
|
|
39
|
+
uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
|
|
43
|
+
- name: Install uv
|
|
44
|
+
uses: astral-sh/setup-uv@v4
|
|
45
|
+
|
|
46
|
+
- name: Install dependencies
|
|
47
|
+
run: uv pip install --system ruff
|
|
48
|
+
|
|
49
|
+
- name: Lint
|
|
50
|
+
run: ruff check opencode_bridge/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
|
|
22
|
+
- name: Install build tools
|
|
23
|
+
run: uv pip install --system build
|
|
24
|
+
|
|
25
|
+
- name: Build package
|
|
26
|
+
run: python -m build
|
|
27
|
+
|
|
28
|
+
- name: Publish to PyPI
|
|
29
|
+
env:
|
|
30
|
+
TWINE_USERNAME: __token__
|
|
31
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
32
|
+
run: |
|
|
33
|
+
uv pip install --system twine
|
|
34
|
+
twine upload dist/*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.so
|
|
5
|
+
.Python
|
|
6
|
+
build/
|
|
7
|
+
develop-eggs/
|
|
8
|
+
dist/
|
|
9
|
+
downloads/
|
|
10
|
+
eggs/
|
|
11
|
+
.eggs/
|
|
12
|
+
lib/
|
|
13
|
+
lib64/
|
|
14
|
+
parts/
|
|
15
|
+
sdist/
|
|
16
|
+
var/
|
|
17
|
+
wheels/
|
|
18
|
+
*.egg-info/
|
|
19
|
+
.installed.cfg
|
|
20
|
+
*.egg
|
|
21
|
+
.venv/
|
|
22
|
+
venv/
|
|
23
|
+
ENV/
|
|
24
|
+
.idea/
|
|
25
|
+
.vscode/
|
|
26
|
+
*.swp
|
|
27
|
+
*.swo
|
|
28
|
+
.DS_Store
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opencode-bridge
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: MCP server for continuous OpenCode discussion sessions
|
|
5
|
+
Project-URL: Repository, https://github.com/genomewalker/opencode-bridge
|
|
6
|
+
Author: Antonio Fernandez-Guerra
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Keywords: claude,code-review,discussion,gpt,mcp,opencode
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Requires-Dist: mcp>=1.0.0
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
20
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# OpenCode Bridge
|
|
24
|
+
|
|
25
|
+
MCP server for continuous discussion sessions with OpenCode. Collaborate with GPT-5, Claude, Gemini, and other models through Claude Code.
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# 1. Install
|
|
31
|
+
uv pip install git+https://github.com/genomewalker/opencode-bridge.git
|
|
32
|
+
|
|
33
|
+
# 2. Register with Claude Code
|
|
34
|
+
opencode-bridge-install
|
|
35
|
+
|
|
36
|
+
# 3. Use in Claude Code
|
|
37
|
+
# The tools are now available - Claude will use them automatically
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- **Continuous sessions**: Conversation history persists across messages
|
|
43
|
+
- **Multiple models**: Access all OpenCode models (GPT-5.x, Claude, Gemini, etc.)
|
|
44
|
+
- **Agent support**: plan, build, explore, general agents
|
|
45
|
+
- **Variant control**: Set reasoning effort (minimal → max)
|
|
46
|
+
- **File attachment**: Share code files for review
|
|
47
|
+
- **Session continuity**: Conversations continue across tool calls
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
### With uv (recommended)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv pip install git+https://github.com/genomewalker/opencode-bridge.git
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### With pip
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install git+https://github.com/genomewalker/opencode-bridge.git
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### From source
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/genomewalker/opencode-bridge.git
|
|
67
|
+
cd opencode-bridge
|
|
68
|
+
pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Register with Claude Code
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Install (registers MCP server)
|
|
75
|
+
opencode-bridge-install
|
|
76
|
+
|
|
77
|
+
# Verify
|
|
78
|
+
claude mcp list
|
|
79
|
+
|
|
80
|
+
# Uninstall
|
|
81
|
+
opencode-bridge-uninstall
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Available Models
|
|
85
|
+
|
|
86
|
+
| Provider | Models |
|
|
87
|
+
|----------|--------|
|
|
88
|
+
| openai | gpt-5.2-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini |
|
|
89
|
+
| github-copilot | claude-opus-4.5, claude-sonnet-4.5, gpt-5, gemini-2.5-pro |
|
|
90
|
+
| opencode | gpt-5-nano (free), glm-4.7-free, grok-code |
|
|
91
|
+
|
|
92
|
+
Run `opencode models` to see all available models.
|
|
93
|
+
|
|
94
|
+
## MCP Tools
|
|
95
|
+
|
|
96
|
+
| Tool | Description |
|
|
97
|
+
|------|-------------|
|
|
98
|
+
| `opencode_start` | Start a new session |
|
|
99
|
+
| `opencode_discuss` | Send a message |
|
|
100
|
+
| `opencode_plan` | Start planning discussion |
|
|
101
|
+
| `opencode_brainstorm` | Open-ended brainstorming |
|
|
102
|
+
| `opencode_review` | Review code |
|
|
103
|
+
| `opencode_models` | List available models |
|
|
104
|
+
| `opencode_agents` | List available agents |
|
|
105
|
+
| `opencode_model` | Change session model |
|
|
106
|
+
| `opencode_agent` | Change session agent |
|
|
107
|
+
| `opencode_variant` | Change reasoning effort |
|
|
108
|
+
| `opencode_config` | Show current configuration |
|
|
109
|
+
| `opencode_configure` | Set defaults (persisted) |
|
|
110
|
+
| `opencode_history` | Show conversation history |
|
|
111
|
+
| `opencode_sessions` | List all sessions |
|
|
112
|
+
| `opencode_switch` | Switch to another session |
|
|
113
|
+
| `opencode_end` | End current session |
|
|
114
|
+
| `opencode_health` | Server health check |
|
|
115
|
+
|
|
116
|
+
## Configuration
|
|
117
|
+
|
|
118
|
+
### Environment variables
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
export OPENCODE_MODEL="openai/gpt-5.2-codex"
|
|
122
|
+
export OPENCODE_AGENT="plan"
|
|
123
|
+
export OPENCODE_VARIANT="medium"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Config file
|
|
127
|
+
|
|
128
|
+
`~/.opencode-bridge/config.json`:
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"model": "openai/gpt-5.2-codex",
|
|
132
|
+
"agent": "plan",
|
|
133
|
+
"variant": "medium"
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Variants (reasoning effort)
|
|
138
|
+
|
|
139
|
+
`minimal` → `low` → `medium` → `high` → `xhigh` → `max`
|
|
140
|
+
|
|
141
|
+
Higher variants use more reasoning tokens for complex tasks.
|
|
142
|
+
|
|
143
|
+
## Requirements
|
|
144
|
+
|
|
145
|
+
- Python 3.10+
|
|
146
|
+
- [OpenCode CLI](https://opencode.ai) installed
|
|
147
|
+
- Claude Code
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# OpenCode Bridge
|
|
2
|
+
|
|
3
|
+
MCP server for continuous discussion sessions with OpenCode. Collaborate with GPT-5, Claude, Gemini, and other models through Claude Code.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 1. Install
|
|
9
|
+
uv pip install git+https://github.com/genomewalker/opencode-bridge.git
|
|
10
|
+
|
|
11
|
+
# 2. Register with Claude Code
|
|
12
|
+
opencode-bridge-install
|
|
13
|
+
|
|
14
|
+
# 3. Use in Claude Code
|
|
15
|
+
# The tools are now available - Claude will use them automatically
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **Continuous sessions**: Conversation history persists across messages
|
|
21
|
+
- **Multiple models**: Access all OpenCode models (GPT-5.x, Claude, Gemini, etc.)
|
|
22
|
+
- **Agent support**: plan, build, explore, general agents
|
|
23
|
+
- **Variant control**: Set reasoning effort (minimal → max)
|
|
24
|
+
- **File attachment**: Share code files for review
|
|
25
|
+
- **Session continuity**: Conversations continue across tool calls
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### With uv (recommended)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
uv pip install git+https://github.com/genomewalker/opencode-bridge.git
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### With pip
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install git+https://github.com/genomewalker/opencode-bridge.git
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### From source
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://github.com/genomewalker/opencode-bridge.git
|
|
45
|
+
cd opencode-bridge
|
|
46
|
+
pip install -e .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Register with Claude Code
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Install (registers MCP server)
|
|
53
|
+
opencode-bridge-install
|
|
54
|
+
|
|
55
|
+
# Verify
|
|
56
|
+
claude mcp list
|
|
57
|
+
|
|
58
|
+
# Uninstall
|
|
59
|
+
opencode-bridge-uninstall
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Available Models
|
|
63
|
+
|
|
64
|
+
| Provider | Models |
|
|
65
|
+
|----------|--------|
|
|
66
|
+
| openai | gpt-5.2-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini |
|
|
67
|
+
| github-copilot | claude-opus-4.5, claude-sonnet-4.5, gpt-5, gemini-2.5-pro |
|
|
68
|
+
| opencode | gpt-5-nano (free), glm-4.7-free, grok-code |
|
|
69
|
+
|
|
70
|
+
Run `opencode models` to see all available models.
|
|
71
|
+
|
|
72
|
+
## MCP Tools
|
|
73
|
+
|
|
74
|
+
| Tool | Description |
|
|
75
|
+
|------|-------------|
|
|
76
|
+
| `opencode_start` | Start a new session |
|
|
77
|
+
| `opencode_discuss` | Send a message |
|
|
78
|
+
| `opencode_plan` | Start planning discussion |
|
|
79
|
+
| `opencode_brainstorm` | Open-ended brainstorming |
|
|
80
|
+
| `opencode_review` | Review code |
|
|
81
|
+
| `opencode_models` | List available models |
|
|
82
|
+
| `opencode_agents` | List available agents |
|
|
83
|
+
| `opencode_model` | Change session model |
|
|
84
|
+
| `opencode_agent` | Change session agent |
|
|
85
|
+
| `opencode_variant` | Change reasoning effort |
|
|
86
|
+
| `opencode_config` | Show current configuration |
|
|
87
|
+
| `opencode_configure` | Set defaults (persisted) |
|
|
88
|
+
| `opencode_history` | Show conversation history |
|
|
89
|
+
| `opencode_sessions` | List all sessions |
|
|
90
|
+
| `opencode_switch` | Switch to another session |
|
|
91
|
+
| `opencode_end` | End current session |
|
|
92
|
+
| `opencode_health` | Server health check |
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
### Environment variables
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
export OPENCODE_MODEL="openai/gpt-5.2-codex"
|
|
100
|
+
export OPENCODE_AGENT="plan"
|
|
101
|
+
export OPENCODE_VARIANT="medium"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Config file
|
|
105
|
+
|
|
106
|
+
`~/.opencode-bridge/config.json`:
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"model": "openai/gpt-5.2-codex",
|
|
110
|
+
"agent": "plan",
|
|
111
|
+
"variant": "medium"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Variants (reasoning effort)
|
|
116
|
+
|
|
117
|
+
`minimal` → `low` → `medium` → `high` → `xhigh` → `max`
|
|
118
|
+
|
|
119
|
+
Higher variants use more reasoning tokens for complex tasks.
|
|
120
|
+
|
|
121
|
+
## Requirements
|
|
122
|
+
|
|
123
|
+
- Python 3.10+
|
|
124
|
+
- [OpenCode CLI](https://opencode.ai) installed
|
|
125
|
+
- Claude Code
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Install/uninstall opencode-bridge MCP server with Claude Code."""
|
|
3
|
+
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def install():
|
|
9
|
+
"""Register opencode-bridge as an MCP server with Claude Code."""
|
|
10
|
+
try:
|
|
11
|
+
result = subprocess.run(
|
|
12
|
+
["claude", "mcp", "add", "--transport", "stdio", "--scope", "user",
|
|
13
|
+
"opencode-bridge", "--", "opencode-bridge"],
|
|
14
|
+
capture_output=True,
|
|
15
|
+
text=True
|
|
16
|
+
)
|
|
17
|
+
if result.returncode == 0:
|
|
18
|
+
print("opencode-bridge registered with Claude Code")
|
|
19
|
+
print(result.stdout)
|
|
20
|
+
else:
|
|
21
|
+
if "already exists" in result.stderr.lower():
|
|
22
|
+
print("opencode-bridge already registered")
|
|
23
|
+
else:
|
|
24
|
+
print(f"Failed to register: {result.stderr}")
|
|
25
|
+
sys.exit(1)
|
|
26
|
+
except FileNotFoundError:
|
|
27
|
+
print("Claude Code CLI not found. Install from: https://claude.ai/download")
|
|
28
|
+
sys.exit(1)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def uninstall():
|
|
32
|
+
"""Remove opencode-bridge MCP server from Claude Code."""
|
|
33
|
+
try:
|
|
34
|
+
result = subprocess.run(
|
|
35
|
+
["claude", "mcp", "remove", "opencode-bridge"],
|
|
36
|
+
capture_output=True,
|
|
37
|
+
text=True
|
|
38
|
+
)
|
|
39
|
+
if result.returncode == 0:
|
|
40
|
+
print("opencode-bridge removed from Claude Code")
|
|
41
|
+
print(result.stdout)
|
|
42
|
+
else:
|
|
43
|
+
if "not found" in result.stderr.lower():
|
|
44
|
+
print("opencode-bridge not registered")
|
|
45
|
+
else:
|
|
46
|
+
print(f"Failed to remove: {result.stderr}")
|
|
47
|
+
sys.exit(1)
|
|
48
|
+
except FileNotFoundError:
|
|
49
|
+
print("Claude Code CLI not found")
|
|
50
|
+
sys.exit(1)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if __name__ == "__main__":
|
|
54
|
+
if len(sys.argv) > 1 and sys.argv[1] == "uninstall":
|
|
55
|
+
uninstall()
|
|
56
|
+
else:
|
|
57
|
+
install()
|