nexus-sphere-mcp 0.2.0__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.
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.4
2
+ Name: nexus-sphere-mcp
3
+ Version: 0.2.0
4
+ Summary: Nexus Sphere AI Meeting for coding agents: a multi-AI second opinion inside Claude Code, Codex and Cursor (MCP server + CLI).
5
+ Author: Nexus Sphere
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://nexus-sphere-two.vercel.app/developers
8
+ Project-URL: Documentation, https://nexus-sphere-two.vercel.app/developers
9
+ Keywords: mcp,model-context-protocol,claude-code,codex,cursor,code-review,multi-agent,llm
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Software Development :: Quality Assurance
17
+ Classifier: License :: Other/Proprietary License
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: httpx<1,>=0.27
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=8; extra == "dev"
23
+
24
+ # nexus-sphere-mcp — Nexus の AI会議を Claude Code・Codex・Cursor から
25
+
26
+ コーディングエージェントの**相棒**として、複数の AI(別々の会社のモデル)に
27
+ 独立に考えさせ、反論し合わせ、**結論・一致・相違・各AIの要点・出典**を返す
28
+ MCP サーバーと CLI。エージェントが自分の答えに自信を持てないとき、行動する前に
29
+ 「セカンドオピニオン」を取れる。
30
+
31
+ *A multi-AI second opinion inside your coding agent: several models from different
32
+ vendors answer independently, rebut each other, and you get the conclusion, where
33
+ they agree, where they disagree, each model's position and cited sources.*
34
+
35
+ ## 2分で使う / Quick start
36
+
37
+ 1. **API キーを発行する** — Nexus にログインし、設定 → API キー
38
+ (`/settings/api-keys`)で `deliberate` スコープのキーを作る。`nxs_…` で始まる。
39
+ 2. **エージェントに登録する**(Python 3.11+ と [uv](https://docs.astral.sh/uv/) が必要)
40
+
41
+ ```bash
42
+ export NEXUS_API_KEY=nxs_... # シェルの設定に入れておく
43
+ ```
44
+
45
+ **Claude Code**
46
+
47
+ ```bash
48
+ claude mcp add --transport stdio --env NEXUS_API_KEY=$NEXUS_API_KEY nexus -- uvx --from "git+https://github.com/nexus-core-jp/Nexus-sphere#subdirectory=cli" nexus-sphere-mcp
49
+ ```
50
+
51
+ **Cursor**(`.cursor/mcp.json` またはグローバルの `~/.cursor/mcp.json`)
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "nexus": {
57
+ "command": "uvx",
58
+ "args": ["--from","git+https://github.com/nexus-core-jp/Nexus-sphere#subdirectory=cli","nexus-sphere-mcp"],
59
+ "env": { "NEXUS_API_KEY": "${env:NEXUS_API_KEY}" }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ **Codex CLI**(`~/.codex/config.toml`)
66
+
67
+ ```toml
68
+ [mcp_servers.nexus]
69
+ command = "uvx"
70
+ args = ["--from","git+https://github.com/nexus-core-jp/Nexus-sphere#subdirectory=cli","nexus-sphere-mcp"]
71
+ env_vars = ["NEXUS_API_KEY"]
72
+ # 合議は 1〜3 分かかる。既定の 60 秒だと途中で切られる
73
+ tool_timeout_sec = 300
74
+ ```
75
+
76
+ 3. **頼む** — 例: 「この修正案を Nexus の second_opinion にかけて、反対意見があれば教えて」
77
+
78
+ `nexus mcp-config` が同じ設定を出す(`--installed` でインストール済みの `nexus` を使う形)。
79
+
80
+ ## 道具 / Tools
81
+
82
+ | 道具 | 何をするか |
83
+ |:--|:--|
84
+ | `second_opinion` | **エージェント自身の答え・計画・修正案**を複数の AI に批評させる。誤り・危険な前提・代替案と、各 AI の採否(そのまま採用 / 条件付き / 採用すべきでない) |
85
+ | `deliberate` | 判断を仰ぐ問いを AI会議にかける(設計の選択、トレードオフ、事実確認が要る問い) |
86
+ | `review_diff` | 送る前の差分レビュー。危険度、2社以上が一致した「直せ」、1社だけの異論、見ていない範囲 |
87
+ | `get_result` | 待ちきれなかった合議の結果を trace_id で受け取る(新しい合議は始めない・無料) |
88
+
89
+ 共通の引数: `context`(背景・コード片)、`participants`(優先する AI。例
90
+ `["claude","openai","gemini"]`)、`web_search`(`auto` / `on` / `off`)、
91
+ `mode`(`quick` / `balanced` / `deep`)、`language`(`ja` / `en`)。
92
+
93
+ ## 送るもの / What is sent
94
+
95
+ **道具の引数に渡した文字列だけ。** ファイルは読まない。例外は `review_diff` の
96
+ `source: "git"` で、利用者がそれを頼んだときだけ今のリポジトリの `git diff` を送る。
97
+ 入力には上限がある(問い 4,000 字、背景 20,000 字、提案 12,000 字、差分 400,000 字)。
98
+ 上限を越えたものは切らずに断る。
99
+
100
+ ## 料金 / Pricing
101
+
102
+ 1 回の `deliberate` / `second_opinion` / `review_diff` は、あなたのプランの
103
+ **AI会議 1 回**として数える(組織の月の枠・支出上限に掛かる)。`get_result` は
104
+ 数えない。API キー 1 本あたり 1 時間 30 回の上限もある(漏れた鍵で月の枠を
105
+ 焼き切らないため)。
106
+
107
+ ## 時間 / Timing
108
+
109
+ 合議は 1〜3 分かかる。サーバーは最大 240 秒待ち、クライアントが `progressToken`
110
+ を付けていれば進捗を通知する。それを越えたら trace_id を返すので、`get_result`
111
+ で受け取る(**同じ問いを送り直すと二重に課金される**)。
112
+
113
+ - Claude Code: 道具の締切は `MCP_TOOL_TIMEOUT`(ミリ秒)。短く設定している場合は
114
+ `MCP_TOOL_TIMEOUT=300000` 以上に
115
+ - Codex: `tool_timeout_sec = 300`(上の設定例に入れてある。既定は 60 秒)
116
+ - 待つ秒数は `NEXUS_MCP_MAX_WAIT`(または `nexus-sphere-mcp --max-wait 50`)で変えられる。
117
+ クライアントの締切より短くしておくと、切られる前に trace_id を返せる
118
+
119
+ ## 環境変数 / Environment
120
+
121
+ | 変数 | 既定 | 意味 |
122
+ |:--|:--|:--|
123
+ | `NEXUS_API_KEY` | — | API キー(必須。`nexus login` で保存したものでも可) |
124
+ | `NEXUS_API_URL` | `https://nexus-sphere-api.onrender.com` | API の場所 |
125
+ | `NEXUS_MCP_MAX_WAIT` | `240` | 1 回の呼び出しで結果を待つ秒数 |
126
+ | `NEXUS_APP_URL` | `https://nexus-sphere-two.vercel.app` | 案内に出す画面の URL |
127
+
128
+ ## CLI
129
+
130
+ 同じパッケージに `nexus` コマンドも入る(`uv tool install nexus-sphere-mcp` か
131
+ `pipx install nexus-sphere-mcp`)。
132
+
133
+ ```
134
+ nexus login # 設定 → API キー で発行したキーを貼る
135
+ nexus review # ブランチの差分(PR と同じ範囲)を合議にかける
136
+ nexus review --working-tree # コミット前の変更全体を合議にかける
137
+ nexus pr # 合議 → 確認 → gh で PR 作成(判定を本文に付ける)
138
+ nexus outcome merged # Webhook が無い配備で、顛末を手で返す
139
+ nexus stats # 予測と顛末の突き合わせ
140
+ nexus backtest --limit 100 # 過去の PR で判定を採点する
141
+ ```
142
+
143
+ ### 判定の読み方
144
+
145
+ - **危険度** low / medium / high。1社でも確信を持って high と言えば high。
146
+ 2社以上が独立に「マージ前に直せ」と言った指摘があれば、誰も high と言って
147
+ いなくても high。
148
+ - **一致した指摘 / 異論** は分けて出る。合議の価値は異論の側にある。
149
+ - **合議が見た範囲** は必ず出る。大きな差分は全部は見られない。
150
+ - `nexus review` の終了コードは、high のとき 2。CI やフックで止められる。
151
+
152
+ ### 顛末が返る仕組み
153
+
154
+ `nexus pr` は PR 本文の末尾に `<!-- nexus-review: <id> -->` を埋める。設定 → API キー
155
+ の画面にある GitHub Webhook をリポジトリに登録すると、マージ・CI の失敗・Revert が
156
+ 自動で同じ記録に積まれる。Webhook を置けない環境では `nexus outcome <status>`。
157
+
158
+ ### 設定
159
+
160
+ `~/.config/nexus-sphere/config.json`(0600)。環境変数 `NEXUS_API_URL` /
161
+ `NEXUS_API_KEY` が優先。`NEXUS_CONFIG_DIR` で置き場所を変えられる。
162
+
163
+ ## 開発 / Development
164
+
165
+ ```bash
166
+ cd cli
167
+ PYTHONPATH=. python -m pytest tests -q -o addopts=""
168
+ ```
169
+
170
+ 配布の手順は `docs/MCP_PUBLISHING.md`。
@@ -0,0 +1,147 @@
1
+ # nexus-sphere-mcp — Nexus の AI会議を Claude Code・Codex・Cursor から
2
+
3
+ コーディングエージェントの**相棒**として、複数の AI(別々の会社のモデル)に
4
+ 独立に考えさせ、反論し合わせ、**結論・一致・相違・各AIの要点・出典**を返す
5
+ MCP サーバーと CLI。エージェントが自分の答えに自信を持てないとき、行動する前に
6
+ 「セカンドオピニオン」を取れる。
7
+
8
+ *A multi-AI second opinion inside your coding agent: several models from different
9
+ vendors answer independently, rebut each other, and you get the conclusion, where
10
+ they agree, where they disagree, each model's position and cited sources.*
11
+
12
+ ## 2分で使う / Quick start
13
+
14
+ 1. **API キーを発行する** — Nexus にログインし、設定 → API キー
15
+ (`/settings/api-keys`)で `deliberate` スコープのキーを作る。`nxs_…` で始まる。
16
+ 2. **エージェントに登録する**(Python 3.11+ と [uv](https://docs.astral.sh/uv/) が必要)
17
+
18
+ ```bash
19
+ export NEXUS_API_KEY=nxs_... # シェルの設定に入れておく
20
+ ```
21
+
22
+ **Claude Code**
23
+
24
+ ```bash
25
+ claude mcp add --transport stdio --env NEXUS_API_KEY=$NEXUS_API_KEY nexus -- uvx --from "git+https://github.com/nexus-core-jp/Nexus-sphere#subdirectory=cli" nexus-sphere-mcp
26
+ ```
27
+
28
+ **Cursor**(`.cursor/mcp.json` またはグローバルの `~/.cursor/mcp.json`)
29
+
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "nexus": {
34
+ "command": "uvx",
35
+ "args": ["--from","git+https://github.com/nexus-core-jp/Nexus-sphere#subdirectory=cli","nexus-sphere-mcp"],
36
+ "env": { "NEXUS_API_KEY": "${env:NEXUS_API_KEY}" }
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ **Codex CLI**(`~/.codex/config.toml`)
43
+
44
+ ```toml
45
+ [mcp_servers.nexus]
46
+ command = "uvx"
47
+ args = ["--from","git+https://github.com/nexus-core-jp/Nexus-sphere#subdirectory=cli","nexus-sphere-mcp"]
48
+ env_vars = ["NEXUS_API_KEY"]
49
+ # 合議は 1〜3 分かかる。既定の 60 秒だと途中で切られる
50
+ tool_timeout_sec = 300
51
+ ```
52
+
53
+ 3. **頼む** — 例: 「この修正案を Nexus の second_opinion にかけて、反対意見があれば教えて」
54
+
55
+ `nexus mcp-config` が同じ設定を出す(`--installed` でインストール済みの `nexus` を使う形)。
56
+
57
+ ## 道具 / Tools
58
+
59
+ | 道具 | 何をするか |
60
+ |:--|:--|
61
+ | `second_opinion` | **エージェント自身の答え・計画・修正案**を複数の AI に批評させる。誤り・危険な前提・代替案と、各 AI の採否(そのまま採用 / 条件付き / 採用すべきでない) |
62
+ | `deliberate` | 判断を仰ぐ問いを AI会議にかける(設計の選択、トレードオフ、事実確認が要る問い) |
63
+ | `review_diff` | 送る前の差分レビュー。危険度、2社以上が一致した「直せ」、1社だけの異論、見ていない範囲 |
64
+ | `get_result` | 待ちきれなかった合議の結果を trace_id で受け取る(新しい合議は始めない・無料) |
65
+
66
+ 共通の引数: `context`(背景・コード片)、`participants`(優先する AI。例
67
+ `["claude","openai","gemini"]`)、`web_search`(`auto` / `on` / `off`)、
68
+ `mode`(`quick` / `balanced` / `deep`)、`language`(`ja` / `en`)。
69
+
70
+ ## 送るもの / What is sent
71
+
72
+ **道具の引数に渡した文字列だけ。** ファイルは読まない。例外は `review_diff` の
73
+ `source: "git"` で、利用者がそれを頼んだときだけ今のリポジトリの `git diff` を送る。
74
+ 入力には上限がある(問い 4,000 字、背景 20,000 字、提案 12,000 字、差分 400,000 字)。
75
+ 上限を越えたものは切らずに断る。
76
+
77
+ ## 料金 / Pricing
78
+
79
+ 1 回の `deliberate` / `second_opinion` / `review_diff` は、あなたのプランの
80
+ **AI会議 1 回**として数える(組織の月の枠・支出上限に掛かる)。`get_result` は
81
+ 数えない。API キー 1 本あたり 1 時間 30 回の上限もある(漏れた鍵で月の枠を
82
+ 焼き切らないため)。
83
+
84
+ ## 時間 / Timing
85
+
86
+ 合議は 1〜3 分かかる。サーバーは最大 240 秒待ち、クライアントが `progressToken`
87
+ を付けていれば進捗を通知する。それを越えたら trace_id を返すので、`get_result`
88
+ で受け取る(**同じ問いを送り直すと二重に課金される**)。
89
+
90
+ - Claude Code: 道具の締切は `MCP_TOOL_TIMEOUT`(ミリ秒)。短く設定している場合は
91
+ `MCP_TOOL_TIMEOUT=300000` 以上に
92
+ - Codex: `tool_timeout_sec = 300`(上の設定例に入れてある。既定は 60 秒)
93
+ - 待つ秒数は `NEXUS_MCP_MAX_WAIT`(または `nexus-sphere-mcp --max-wait 50`)で変えられる。
94
+ クライアントの締切より短くしておくと、切られる前に trace_id を返せる
95
+
96
+ ## 環境変数 / Environment
97
+
98
+ | 変数 | 既定 | 意味 |
99
+ |:--|:--|:--|
100
+ | `NEXUS_API_KEY` | — | API キー(必須。`nexus login` で保存したものでも可) |
101
+ | `NEXUS_API_URL` | `https://nexus-sphere-api.onrender.com` | API の場所 |
102
+ | `NEXUS_MCP_MAX_WAIT` | `240` | 1 回の呼び出しで結果を待つ秒数 |
103
+ | `NEXUS_APP_URL` | `https://nexus-sphere-two.vercel.app` | 案内に出す画面の URL |
104
+
105
+ ## CLI
106
+
107
+ 同じパッケージに `nexus` コマンドも入る(`uv tool install nexus-sphere-mcp` か
108
+ `pipx install nexus-sphere-mcp`)。
109
+
110
+ ```
111
+ nexus login # 設定 → API キー で発行したキーを貼る
112
+ nexus review # ブランチの差分(PR と同じ範囲)を合議にかける
113
+ nexus review --working-tree # コミット前の変更全体を合議にかける
114
+ nexus pr # 合議 → 確認 → gh で PR 作成(判定を本文に付ける)
115
+ nexus outcome merged # Webhook が無い配備で、顛末を手で返す
116
+ nexus stats # 予測と顛末の突き合わせ
117
+ nexus backtest --limit 100 # 過去の PR で判定を採点する
118
+ ```
119
+
120
+ ### 判定の読み方
121
+
122
+ - **危険度** low / medium / high。1社でも確信を持って high と言えば high。
123
+ 2社以上が独立に「マージ前に直せ」と言った指摘があれば、誰も high と言って
124
+ いなくても high。
125
+ - **一致した指摘 / 異論** は分けて出る。合議の価値は異論の側にある。
126
+ - **合議が見た範囲** は必ず出る。大きな差分は全部は見られない。
127
+ - `nexus review` の終了コードは、high のとき 2。CI やフックで止められる。
128
+
129
+ ### 顛末が返る仕組み
130
+
131
+ `nexus pr` は PR 本文の末尾に `<!-- nexus-review: <id> -->` を埋める。設定 → API キー
132
+ の画面にある GitHub Webhook をリポジトリに登録すると、マージ・CI の失敗・Revert が
133
+ 自動で同じ記録に積まれる。Webhook を置けない環境では `nexus outcome <status>`。
134
+
135
+ ### 設定
136
+
137
+ `~/.config/nexus-sphere/config.json`(0600)。環境変数 `NEXUS_API_URL` /
138
+ `NEXUS_API_KEY` が優先。`NEXUS_CONFIG_DIR` で置き場所を変えられる。
139
+
140
+ ## 開発 / Development
141
+
142
+ ```bash
143
+ cd cli
144
+ PYTHONPATH=. python -m pytest tests -q -o addopts=""
145
+ ```
146
+
147
+ 配布の手順は `docs/MCP_PUBLISHING.md`。
@@ -0,0 +1,3 @@
1
+ """Nexus Sphere CLI — AI会議(合議)をコードの変更に、送る前に掛ける。"""
2
+
3
+ __version__ = "0.2.0"
@@ -0,0 +1,3 @@
1
+ from .main import main
2
+
3
+ raise SystemExit(main())