second-opinion-mcp 0.3.0__py3-none-any.whl
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.
- second_opinion_mcp/__init__.py +16 -0
- second_opinion_mcp/__main__.py +18 -0
- second_opinion_mcp/cli.py +272 -0
- second_opinion_mcp/server.py +1537 -0
- second_opinion_mcp-0.3.0.dist-info/METADATA +324 -0
- second_opinion_mcp-0.3.0.dist-info/RECORD +9 -0
- second_opinion_mcp-0.3.0.dist-info/WHEEL +4 -0
- second_opinion_mcp-0.3.0.dist-info/entry_points.txt +2 -0
- second_opinion_mcp-0.3.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: second-opinion-mcp
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Multi-model AI analysis for Claude - get second opinions from DeepSeek, Kimi, and OpenRouter
|
|
5
|
+
Project-URL: Homepage, https://github.com/MarvinFS/second-opinion-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/MarvinFS/second-opinion-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/MarvinFS/second-opinion-mcp/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/MarvinFS/second-opinion-mcp/blob/main/docs/CHANGELOG.md
|
|
9
|
+
Author: MarvinFS
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai,claude,code-review,deepseek,mcp,moonshot,openrouter,second-opinion
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
24
|
+
Classifier: Topic :: Software Development :: Testing
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: httpx>=0.27.0
|
|
27
|
+
Requires-Dist: keyring>=25.6.0
|
|
28
|
+
Requires-Dist: mcp[cli]>=1.6.0
|
|
29
|
+
Requires-Dist: openai>=1.68.0
|
|
30
|
+
Requires-Dist: questionary>=2.0.0
|
|
31
|
+
Requires-Dist: tenacity>=8.2.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: build; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: twine; extra == 'dev'
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
# Second Opinion MCP
|
|
40
|
+
|
|
41
|
+
Get second opinions from multiple AI models while using Claude. Break the single-model echo chamber by consulting DeepSeek Reasoner, Kimi K2.5 (Moonshot), and 300+ OpenRouter models.
|
|
42
|
+
|
|
43
|
+
## What It Does
|
|
44
|
+
|
|
45
|
+
When working with Claude Code or Claude Desktop, this MCP server lets you:
|
|
46
|
+
|
|
47
|
+
- Get alternative perspectives on code, architecture, and decisions
|
|
48
|
+
- Run systematic code reviews with severity-classified issues
|
|
49
|
+
- Stage multi-model debates where AI models argue opposing positions
|
|
50
|
+
- Challenge proposals with anti-sycophancy mode (finds weaknesses, not validation)
|
|
51
|
+
|
|
52
|
+
## Quickstart
|
|
53
|
+
|
|
54
|
+
### 1. Install
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pipx install second-opinion-mcp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If you don't have pipx, install it first: `pip install pipx && pipx ensurepath`
|
|
61
|
+
|
|
62
|
+
### 2. Setup
|
|
63
|
+
|
|
64
|
+
Run the interactive setup wizard:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
second-opinion-mcp setup
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The wizard will guide you through selecting providers and entering API keys. Keys are stored securely in your system's credential manager.
|
|
71
|
+
|
|
72
|
+
### 3. Register
|
|
73
|
+
|
|
74
|
+
After setup, copy the registration command from the wizard output, e.g.:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
claude mcp add -s user second-opinion -e SECOND_OPINION_PROVIDERS="deepseek,moonshot" -- second-opinion-mcp
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
That's it. Restart Claude Code and the tools are available.
|
|
81
|
+
|
|
82
|
+
## Supported Models
|
|
83
|
+
|
|
84
|
+
### DeepSeek V3.2 (Recommended)
|
|
85
|
+
|
|
86
|
+
Chain-of-thought reasoning model. Best for code reviews and complex analysis.
|
|
87
|
+
|
|
88
|
+
- Get your API key at https://platform.deepseek.com
|
|
89
|
+
- Pricing: ~$0.28/$0.42 per million tokens (input/output)
|
|
90
|
+
|
|
91
|
+
### Kimi K2.5 (Moonshot)
|
|
92
|
+
|
|
93
|
+
Chinese AI model with thinking mode. Good for alternative perspectives and debates.
|
|
94
|
+
|
|
95
|
+
- Get your API key at https://platform.moonshot.cn
|
|
96
|
+
- Supports 256K context window
|
|
97
|
+
|
|
98
|
+
### OpenRouter (Optional)
|
|
99
|
+
|
|
100
|
+
Access 300+ models through a single API. Enable for variety or specific model access.
|
|
101
|
+
|
|
102
|
+
- Get your API key at https://openrouter.ai/keys
|
|
103
|
+
|
|
104
|
+
## Available Tools
|
|
105
|
+
|
|
106
|
+
### second_opinion
|
|
107
|
+
|
|
108
|
+
Get a straightforward second opinion on any question, code, or decision.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Use second_opinion to review this database schema: [paste schema]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### challenge
|
|
115
|
+
|
|
116
|
+
Anti-sycophancy mode. The model is instructed to find weaknesses, not validate.
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Use challenge to critique: "We should use a global singleton for database connections"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### code_review
|
|
123
|
+
|
|
124
|
+
Systematic directory-based code review with BLOCKER/CRITICAL/MAJOR/MINOR classifications.
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
Use code_review on directory="./src" with focus_areas=["security", "performance"]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### consensus
|
|
131
|
+
|
|
132
|
+
Multi-model debate where DeepSeek and Moonshot argue opposing positions, then synthesize.
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Use consensus to debate: "GraphQL vs REST for internal microservices"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### review_synthesis
|
|
139
|
+
|
|
140
|
+
Full workflow: parallel reviews from both models, debate, then synthesis instructions.
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
Perform a comprehensive code review of ./myproject using review_synthesis
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Configuration
|
|
147
|
+
|
|
148
|
+
### Changing Providers
|
|
149
|
+
|
|
150
|
+
After initial setup, reconfigure providers:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
second-opinion-mcp setup
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Or manually set the environment variable:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Claude Code CLI
|
|
160
|
+
claude mcp add -s user second-opinion -e SECOND_OPINION_PROVIDERS="deepseek" -- second-opinion-mcp
|
|
161
|
+
|
|
162
|
+
# Only DeepSeek
|
|
163
|
+
export SECOND_OPINION_PROVIDERS="deepseek"
|
|
164
|
+
|
|
165
|
+
# Only Moonshot
|
|
166
|
+
export SECOND_OPINION_PROVIDERS="moonshot"
|
|
167
|
+
|
|
168
|
+
# All providers
|
|
169
|
+
export SECOND_OPINION_PROVIDERS="deepseek,moonshot,openrouter"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### API Key Management
|
|
173
|
+
|
|
174
|
+
Keys are stored in your system's credential manager (Windows Credential Manager, macOS Keychain, or Linux Secret Service).
|
|
175
|
+
|
|
176
|
+
To update keys:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
second-opinion-mcp setup
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Or manually:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
python -c "import keyring; keyring.set_password('second-opinion', 'deepseek', 'sk-YOUR_NEW_KEY')"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Claude Desktop Configuration
|
|
189
|
+
|
|
190
|
+
For Claude Desktop (the standalone app), add to `claude_desktop_config.json`:
|
|
191
|
+
|
|
192
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
193
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"mcpServers": {
|
|
198
|
+
"second-opinion": {
|
|
199
|
+
"command": "second-opinion-mcp",
|
|
200
|
+
"env": {
|
|
201
|
+
"SECOND_OPINION_PROVIDERS": "deepseek,moonshot"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Troubleshooting
|
|
209
|
+
|
|
210
|
+
### "No API key configured" Error
|
|
211
|
+
|
|
212
|
+
Run the setup wizard again:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
second-opinion-mcp setup
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### "Keyring access failed" (Linux)
|
|
219
|
+
|
|
220
|
+
Linux without a desktop environment needs a keyring backend configured:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
pip install keyrings.alt
|
|
224
|
+
mkdir -p ~/.local/share/python_keyring
|
|
225
|
+
echo -e "[backend]\ndefault-keyring=keyrings.alt.file.EncryptedKeyring" > ~/.local/share/python_keyring/keyringrc.cfg
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Connection Timeout
|
|
229
|
+
|
|
230
|
+
Check firewall, VPN, or proxy settings. Both DeepSeek (api.deepseek.com) and Moonshot (api.moonshot.ai) must be accessible.
|
|
231
|
+
|
|
232
|
+
### Rate Limit Exceeded
|
|
233
|
+
|
|
234
|
+
Moonshot has rate limits (3 concurrent, 20 RPM at Tier 0). Wait a minute and retry, or use fast mode for non-critical queries.
|
|
235
|
+
|
|
236
|
+
### Tool Not Found in Claude
|
|
237
|
+
|
|
238
|
+
Verify registration:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
claude mcp list
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
If not listed, re-register:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
claude mcp add -s user second-opinion -e SECOND_OPINION_PROVIDERS="deepseek,moonshot" -- second-opinion-mcp
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Advanced Usage
|
|
251
|
+
|
|
252
|
+
### Fast Mode
|
|
253
|
+
|
|
254
|
+
Skip the thinking/reasoning phase for quicker responses:
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
Use second_opinion with fast=true to check: is this regex correct?
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Note: Code reviews always use full thinking mode regardless of this setting.
|
|
261
|
+
|
|
262
|
+
### Include Reasoning
|
|
263
|
+
|
|
264
|
+
See the model's chain-of-thought:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
Use second_opinion with include_reasoning=true to analyze this algorithm
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Focus Areas for Reviews
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
Use code_review with focus_areas=["security", "error-handling", "performance"]
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Save Review Output
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Use code_review on directory="./src" with save_to="./docs/reviews"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Uninstalling
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# Remove from Claude
|
|
286
|
+
claude mcp remove second-opinion
|
|
287
|
+
|
|
288
|
+
# Uninstall package
|
|
289
|
+
pipx uninstall second-opinion-mcp
|
|
290
|
+
|
|
291
|
+
# Optional: remove stored API keys
|
|
292
|
+
python -c "import keyring; keyring.delete_password('second-opinion', 'deepseek')"
|
|
293
|
+
python -c "import keyring; keyring.delete_password('second-opinion', 'moonshot')"
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Security
|
|
297
|
+
|
|
298
|
+
API keys are stored in your OS keyring, not in environment variables or config files. The code review tool:
|
|
299
|
+
|
|
300
|
+
- Skips `.env` files, credentials, SSH keys, and certificates
|
|
301
|
+
- Validates directories against allowed roots
|
|
302
|
+
- Detects symlinks to prevent traversal attacks
|
|
303
|
+
- Limits content size to prevent memory exhaustion
|
|
304
|
+
|
|
305
|
+
## Cost Estimates
|
|
306
|
+
|
|
307
|
+
Per operation (typical usage):
|
|
308
|
+
|
|
309
|
+
| Tool | Approximate Cost |
|
|
310
|
+
|------|------------------|
|
|
311
|
+
| second_opinion / challenge | ~$0.001 |
|
|
312
|
+
| code_review | ~$0.01-0.05 |
|
|
313
|
+
| consensus (2 rounds) | ~$0.004-0.010 |
|
|
314
|
+
| review_synthesis | ~$0.02-0.10 |
|
|
315
|
+
|
|
316
|
+
## License
|
|
317
|
+
|
|
318
|
+
MIT License. See LICENSE file.
|
|
319
|
+
|
|
320
|
+
## Links
|
|
321
|
+
|
|
322
|
+
- [GitHub Repository](https://github.com/MarvinFS/second-opinion-mcp)
|
|
323
|
+
- [Issue Tracker](https://github.com/MarvinFS/second-opinion-mcp/issues)
|
|
324
|
+
- [Changelog](https://github.com/MarvinFS/second-opinion-mcp/blob/main/docs/CHANGELOG.md)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
second_opinion_mcp/__init__.py,sha256=NpyIXDQRLwIAokC8JkOznUSIeX_sez7LjviT_Pg_ihM,373
|
|
2
|
+
second_opinion_mcp/__main__.py,sha256=WDv19O6nvIH69GR_DUfXqDt-wm8bgsHNqvPm1LEIKzs,509
|
|
3
|
+
second_opinion_mcp/cli.py,sha256=waLZH3Av817-3qqu3iG-GZ7YivF3Rp-7h9DzJ5YHgvo,8154
|
|
4
|
+
second_opinion_mcp/server.py,sha256=vD2Cl64PfblmDy1oqM1mwF5V8ouMSLFgzttymFq6UxA,58589
|
|
5
|
+
second_opinion_mcp-0.3.0.dist-info/METADATA,sha256=OqqHisGgVdSRtaHbsfkxlFc_JPsTahJSH7G6JbfZ6n4,8476
|
|
6
|
+
second_opinion_mcp-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
+
second_opinion_mcp-0.3.0.dist-info/entry_points.txt,sha256=-E8BA2gFyU4qW-kJL8SV9Pg1Cc7glOCmraJoZH0PZP8,72
|
|
8
|
+
second_opinion_mcp-0.3.0.dist-info/licenses/LICENSE,sha256=dPx2Jy-Ejearvfh6IlF2PN4Srt-nZW8M4bW5EW7RPAg,1065
|
|
9
|
+
second_opinion_mcp-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 MarvinFS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|