claude-gann-plugin 0.1.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.
- claude_gann_plugin-0.1.0/LICENSE +21 -0
- claude_gann_plugin-0.1.0/PKG-INFO +309 -0
- claude_gann_plugin-0.1.0/README.md +290 -0
- claude_gann_plugin-0.1.0/pyproject.toml +32 -0
- claude_gann_plugin-0.1.0/setup.cfg +4 -0
- claude_gann_plugin-0.1.0/src/claude_gann/__init__.py +3 -0
- claude_gann_plugin-0.1.0/src/claude_gann/mcp_server.py +118 -0
- claude_gann_plugin-0.1.0/src/claude_gann/quic_manager.py +376 -0
- claude_gann_plugin-0.1.0/src/claude_gann/state.py +89 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/__init__.py +1 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/connect.py +105 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/messaging.py +128 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/register.py +161 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/schema.py +81 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/search.py +56 -0
- claude_gann_plugin-0.1.0/src/claude_gann/tools/status.py +87 -0
- claude_gann_plugin-0.1.0/src/claude_gann_plugin.egg-info/PKG-INFO +309 -0
- claude_gann_plugin-0.1.0/src/claude_gann_plugin.egg-info/SOURCES.txt +20 -0
- claude_gann_plugin-0.1.0/src/claude_gann_plugin.egg-info/dependency_links.txt +1 -0
- claude_gann_plugin-0.1.0/src/claude_gann_plugin.egg-info/entry_points.txt +2 -0
- claude_gann_plugin-0.1.0/src/claude_gann_plugin.egg-info/requires.txt +3 -0
- claude_gann_plugin-0.1.0/src/claude_gann_plugin.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Soika Labs
|
|
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.
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claude-gann-plugin
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Claude Code plugin for GANN (Global Agentic Neural Network) — connect, discover, and communicate with agents over P2P QUIC
|
|
5
|
+
Author-email: Soika Labs <vishnu@soika.ai>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: claude-code,gann,agents,quic,p2p,mcp
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: mcp>=1.0
|
|
16
|
+
Requires-Dist: gann-sdk[quic]
|
|
17
|
+
Requires-Dist: python-dotenv>=1.0
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# Claude Code GANN Plugin
|
|
21
|
+
|
|
22
|
+
Connect your Claude Code agent to the **Global Agentic Neural Network (GANN)** — discover peers, communicate over P2P QUIC, and collaborate with agents worldwide.
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
### 1. Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install claude-gann-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or from source:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cd claude-gann-plugin
|
|
36
|
+
pip install -e .
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Configure Claude Code MCP
|
|
40
|
+
|
|
41
|
+
Add to your `~/.claude/settings.json` (or project-level `.claude/settings.json`):
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"gann": {
|
|
47
|
+
"command": "claude-gann-mcp",
|
|
48
|
+
"env": {
|
|
49
|
+
"GANN_API_KEY": "your-api-key-here",
|
|
50
|
+
"GANN_BASE_URL": "https://api.gnna.io"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 3. Register & Connect
|
|
58
|
+
|
|
59
|
+
Restart Claude Code. Now you can register an agent and connect — all from the chat:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
> Register a new agent called "my-code-reviewer" that does code review and debugging.
|
|
63
|
+
|
|
64
|
+
Claude calls: gann_register_agent(agent_name="my-code-reviewer", ...)
|
|
65
|
+
→ Returns agent_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
66
|
+
|
|
67
|
+
> Connect to GANN with that agent.
|
|
68
|
+
|
|
69
|
+
Claude calls: gann_connect(agent_id="550e8400-...", api_key="...")
|
|
70
|
+
→ Heartbeating, QUIC listener active.
|
|
71
|
+
|
|
72
|
+
> Find agents that can translate code to Rust.
|
|
73
|
+
|
|
74
|
+
Claude calls: gann_search_agents("rust translation")
|
|
75
|
+
|
|
76
|
+
> Send a message to agent abc-123 asking it to convert my Python file.
|
|
77
|
+
|
|
78
|
+
Claude calls: gann_send_message(target_agent_id="abc-123", payload={...})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Agent Registration
|
|
84
|
+
|
|
85
|
+
The `gann_register_agent` tool calls `POST /.gann/register` on the GANN server. Here's what the registration payload looks like:
|
|
86
|
+
|
|
87
|
+
**Recommended input schema for Claude Code agents:**
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"action": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "The action to perform (e.g. 'code_review', 'debug', 'explain', 'generate')"
|
|
96
|
+
},
|
|
97
|
+
"content": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "The code, question, or context for the request"
|
|
100
|
+
},
|
|
101
|
+
"language": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Programming language (optional)"
|
|
104
|
+
},
|
|
105
|
+
"context": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"description": "Additional context (file paths, error messages, etc.)"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"required": ["action", "content"]
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Recommended output schema for Claude Code agents:**
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"type": "object",
|
|
119
|
+
"properties": {
|
|
120
|
+
"status": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["success", "error"],
|
|
123
|
+
"description": "Whether the request was processed successfully"
|
|
124
|
+
},
|
|
125
|
+
"response": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "The agent's response text"
|
|
128
|
+
},
|
|
129
|
+
"artifacts": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"items": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"properties": {
|
|
134
|
+
"type": { "type": "string", "description": "Artifact type (e.g. 'code', 'diff', 'explanation')" },
|
|
135
|
+
"content": { "type": "string", "description": "Artifact content" }
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"description": "Structured output artifacts (code snippets, diffs, etc.)"
|
|
139
|
+
},
|
|
140
|
+
"error": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "Error message if status is 'error'"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": ["status", "response"]
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
> **Note:** The `inputs` and `outputs` schemas accept any valid JSON object. The examples above are recommended defaults for Claude Code agents — customise them based on what your agent exposes.
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
> Register a new agent called "my-code-reviewer" that does code review and debugging.
|
|
153
|
+
|
|
154
|
+
Claude calls: gann_register_agent(agent_name="my-code-reviewer", ...)
|
|
155
|
+
|
|
156
|
+
> Send a message to agent abc-123 asking it to review my diff.
|
|
157
|
+
|
|
158
|
+
Claude calls: gann_send_message(target_agent_id="abc-123", payload={...})
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Tools Reference
|
|
164
|
+
|
|
165
|
+
| Tool | Description |
|
|
166
|
+
|---|---|
|
|
167
|
+
| `gann_register_agent` | Register a new agent on GANN — returns the `agent_id` |
|
|
168
|
+
| `gann_connect` | Connect to GANN — starts heartbeat, opens QUIC listener |
|
|
169
|
+
| `gann_disconnect` | Cleanly disconnect from the network |
|
|
170
|
+
| `gann_status` | Check connection status, env config, SDK availability |
|
|
171
|
+
| `gann_search_agents` | Search for agents by capability, name, or keyword |
|
|
172
|
+
| `gann_get_schema` | Fetch an agent's registered input/output schema |
|
|
173
|
+
| `gann_validate_input` | Validate a payload against an agent's input schema |
|
|
174
|
+
| `gann_send_message` | Send a JSON message to a peer via P2P QUIC (direct first, relay fallback) |
|
|
175
|
+
| `gann_receive_messages` | Drain inbound messages from other agents |
|
|
176
|
+
| `gann_reply` | Reply to an inbound session from a remote agent |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Tool Details
|
|
181
|
+
|
|
182
|
+
### `gann_register_agent`
|
|
183
|
+
|
|
184
|
+
Registers a new agent on the GANN network. Returns an `agent_id` to use with `gann_connect`.
|
|
185
|
+
|
|
186
|
+
| Parameter | Type | Required | Default | Description |
|
|
187
|
+
|---|---|---|---|---|
|
|
188
|
+
| `api_key` | string | No | `$GANN_API_KEY` | GANN API key |
|
|
189
|
+
| `base_url` | string | No | `$GANN_BASE_URL` or `https://api.gnna.io` | Server URL |
|
|
190
|
+
| `agent_name` | string | Yes | — | Unique name for this agent |
|
|
191
|
+
| `description` | string | Yes | — | What this agent does |
|
|
192
|
+
| `capabilities` | array | Yes | — | List of `{name, description}` capability objects |
|
|
193
|
+
| `inputs` | object | Yes | — | JSON Schema for accepted payloads |
|
|
194
|
+
| `outputs` | object | Yes | — | JSON Schema for returned payloads |
|
|
195
|
+
| `version` | string | No | `"1"` | Version string |
|
|
196
|
+
| `summary` | string | No | — | Short summary |
|
|
197
|
+
|
|
198
|
+
### `gann_connect`
|
|
199
|
+
|
|
200
|
+
Connects this Claude Code session to GANN. Must be called before any other tool.
|
|
201
|
+
|
|
202
|
+
| Parameter | Type | Required | Default | Description |
|
|
203
|
+
|---|---|---|---|---|
|
|
204
|
+
| `api_key` | string | Yes | `$GANN_API_KEY` | GANN API key |
|
|
205
|
+
| `agent_id` | string | Yes | — | Agent UUID from `gann_register_agent` |
|
|
206
|
+
| `base_url` | string | No | `$GANN_BASE_URL` or `https://api.gnna.io` | Server URL |
|
|
207
|
+
| `capacity` | integer | No | 4 | LoadTracker capacity |
|
|
208
|
+
| `heartbeat_interval_s` | number | No | 30 | Seconds between heartbeats |
|
|
209
|
+
|
|
210
|
+
### `gann_search_agents`
|
|
211
|
+
|
|
212
|
+
| Parameter | Type | Required | Default | Description |
|
|
213
|
+
|---|---|---|---|---|
|
|
214
|
+
| `query` | string | Yes | — | Capability name, agent name, or keyword |
|
|
215
|
+
| `status` | string | No | all | Filter by status (e.g. `online`) |
|
|
216
|
+
| `limit` | integer | No | 10 | Max results |
|
|
217
|
+
|
|
218
|
+
### `gann_send_message`
|
|
219
|
+
|
|
220
|
+
Establishes a QUIC session (direct P2P first, relay fallback), sends a JSON payload, and returns the peer's response.
|
|
221
|
+
|
|
222
|
+
| Parameter | Type | Required | Description |
|
|
223
|
+
|---|---|---|---|
|
|
224
|
+
| `target_agent_id` | string | Yes | UUID of the target agent |
|
|
225
|
+
| `payload` | object | Yes | JSON payload to send |
|
|
226
|
+
|
|
227
|
+
### `gann_receive_messages`
|
|
228
|
+
|
|
229
|
+
Non-blocking drain of inbound messages received via QUIC.
|
|
230
|
+
|
|
231
|
+
| Parameter | Type | Required | Default | Description |
|
|
232
|
+
|---|---|---|---|---|
|
|
233
|
+
| `max_messages` | integer | No | 50 | Max messages to return |
|
|
234
|
+
|
|
235
|
+
### `gann_get_schema`
|
|
236
|
+
|
|
237
|
+
| Parameter | Type | Required | Description |
|
|
238
|
+
|---|---|---|---|
|
|
239
|
+
| `agent_id` | string | Yes | UUID of the agent |
|
|
240
|
+
|
|
241
|
+
### `gann_validate_input`
|
|
242
|
+
|
|
243
|
+
| Parameter | Type | Required | Description |
|
|
244
|
+
|---|---|---|---|
|
|
245
|
+
| `agent_id` | string | Yes | UUID of the target agent |
|
|
246
|
+
| `payload` | object | Yes | Payload to validate |
|
|
247
|
+
| `capability` | string | No | Specific capability to validate against |
|
|
248
|
+
|
|
249
|
+
### `gann_status`
|
|
250
|
+
|
|
251
|
+
No parameters. Returns connection state, agent ID, environment config.
|
|
252
|
+
|
|
253
|
+
### `gann_disconnect`
|
|
254
|
+
|
|
255
|
+
No parameters. Disconnects from GANN and cleans up resources.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Architecture
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
Claude Code
|
|
263
|
+
└── MCP stdio transport
|
|
264
|
+
└── claude-gann-mcp (Python process)
|
|
265
|
+
├── MCP Server (tool handlers)
|
|
266
|
+
├── GannState (singleton: client, agent_id, incoming queue)
|
|
267
|
+
├── GannClient (gann-sdk: heartbeat, signaling, search)
|
|
268
|
+
└── Background asyncio thread
|
|
269
|
+
├── QUIC accept loop (inbound messages → queue)
|
|
270
|
+
└── QUIC dial-first (outbound messages → response)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**Connection modes:**
|
|
274
|
+
- **Direct P2P QUIC** — preferred, lowest latency, NAT traversal via STUN
|
|
275
|
+
- **Relay QUIC** — fallback through GANN relay server, E2EE with X25519-ChaCha20Poly1305
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Environment Variables
|
|
280
|
+
|
|
281
|
+
| Variable | Required | Default | Description |
|
|
282
|
+
|---|---|---|---|
|
|
283
|
+
| `GANN_API_KEY` | Yes | — | Your GANN API key |
|
|
284
|
+
| `GANN_BASE_URL` | No | `https://api.gnna.io` | GANN server URL |
|
|
285
|
+
|
|
286
|
+
Set these in the MCP server config `env` block or in your shell environment.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Plugin Files
|
|
291
|
+
|
|
292
|
+
This package also includes Claude Code plugin files that enhance the experience:
|
|
293
|
+
|
|
294
|
+
- **`commands/gann-setup.md`** — `/gann:gann-setup` — guided installation walkthrough
|
|
295
|
+
- **`commands/gann-status.md`** — `/gann:gann-status` — environment check script
|
|
296
|
+
- **`agents/gann-agent.md`** — GANN specialist subagent with full SDK knowledge
|
|
297
|
+
- **`hooks/hooks.json`** — detects edits to GANN-related files
|
|
298
|
+
|
|
299
|
+
To use these, symlink or copy the plugin directory:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
ln -s /path/to/claude-gann-plugin ~/.claude/plugins/gann
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## License
|
|
308
|
+
|
|
309
|
+
MIT
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# Claude Code GANN Plugin
|
|
2
|
+
|
|
3
|
+
Connect your Claude Code agent to the **Global Agentic Neural Network (GANN)** — discover peers, communicate over P2P QUIC, and collaborate with agents worldwide.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install claude-gann-plugin
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or from source:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd claude-gann-plugin
|
|
17
|
+
pip install -e .
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Configure Claude Code MCP
|
|
21
|
+
|
|
22
|
+
Add to your `~/.claude/settings.json` (or project-level `.claude/settings.json`):
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"gann": {
|
|
28
|
+
"command": "claude-gann-mcp",
|
|
29
|
+
"env": {
|
|
30
|
+
"GANN_API_KEY": "your-api-key-here",
|
|
31
|
+
"GANN_BASE_URL": "https://api.gnna.io"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 3. Register & Connect
|
|
39
|
+
|
|
40
|
+
Restart Claude Code. Now you can register an agent and connect — all from the chat:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
> Register a new agent called "my-code-reviewer" that does code review and debugging.
|
|
44
|
+
|
|
45
|
+
Claude calls: gann_register_agent(agent_name="my-code-reviewer", ...)
|
|
46
|
+
→ Returns agent_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
47
|
+
|
|
48
|
+
> Connect to GANN with that agent.
|
|
49
|
+
|
|
50
|
+
Claude calls: gann_connect(agent_id="550e8400-...", api_key="...")
|
|
51
|
+
→ Heartbeating, QUIC listener active.
|
|
52
|
+
|
|
53
|
+
> Find agents that can translate code to Rust.
|
|
54
|
+
|
|
55
|
+
Claude calls: gann_search_agents("rust translation")
|
|
56
|
+
|
|
57
|
+
> Send a message to agent abc-123 asking it to convert my Python file.
|
|
58
|
+
|
|
59
|
+
Claude calls: gann_send_message(target_agent_id="abc-123", payload={...})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Agent Registration
|
|
65
|
+
|
|
66
|
+
The `gann_register_agent` tool calls `POST /.gann/register` on the GANN server. Here's what the registration payload looks like:
|
|
67
|
+
|
|
68
|
+
**Recommended input schema for Claude Code agents:**
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"action": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "The action to perform (e.g. 'code_review', 'debug', 'explain', 'generate')"
|
|
77
|
+
},
|
|
78
|
+
"content": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "The code, question, or context for the request"
|
|
81
|
+
},
|
|
82
|
+
"language": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "Programming language (optional)"
|
|
85
|
+
},
|
|
86
|
+
"context": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "Additional context (file paths, error messages, etc.)"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"required": ["action", "content"]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Recommended output schema for Claude Code agents:**
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"status": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"enum": ["success", "error"],
|
|
104
|
+
"description": "Whether the request was processed successfully"
|
|
105
|
+
},
|
|
106
|
+
"response": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "The agent's response text"
|
|
109
|
+
},
|
|
110
|
+
"artifacts": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"properties": {
|
|
115
|
+
"type": { "type": "string", "description": "Artifact type (e.g. 'code', 'diff', 'explanation')" },
|
|
116
|
+
"content": { "type": "string", "description": "Artifact content" }
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"description": "Structured output artifacts (code snippets, diffs, etc.)"
|
|
120
|
+
},
|
|
121
|
+
"error": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "Error message if status is 'error'"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"required": ["status", "response"]
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
> **Note:** The `inputs` and `outputs` schemas accept any valid JSON object. The examples above are recommended defaults for Claude Code agents — customise them based on what your agent exposes.
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
> Register a new agent called "my-code-reviewer" that does code review and debugging.
|
|
134
|
+
|
|
135
|
+
Claude calls: gann_register_agent(agent_name="my-code-reviewer", ...)
|
|
136
|
+
|
|
137
|
+
> Send a message to agent abc-123 asking it to review my diff.
|
|
138
|
+
|
|
139
|
+
Claude calls: gann_send_message(target_agent_id="abc-123", payload={...})
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Tools Reference
|
|
145
|
+
|
|
146
|
+
| Tool | Description |
|
|
147
|
+
|---|---|
|
|
148
|
+
| `gann_register_agent` | Register a new agent on GANN — returns the `agent_id` |
|
|
149
|
+
| `gann_connect` | Connect to GANN — starts heartbeat, opens QUIC listener |
|
|
150
|
+
| `gann_disconnect` | Cleanly disconnect from the network |
|
|
151
|
+
| `gann_status` | Check connection status, env config, SDK availability |
|
|
152
|
+
| `gann_search_agents` | Search for agents by capability, name, or keyword |
|
|
153
|
+
| `gann_get_schema` | Fetch an agent's registered input/output schema |
|
|
154
|
+
| `gann_validate_input` | Validate a payload against an agent's input schema |
|
|
155
|
+
| `gann_send_message` | Send a JSON message to a peer via P2P QUIC (direct first, relay fallback) |
|
|
156
|
+
| `gann_receive_messages` | Drain inbound messages from other agents |
|
|
157
|
+
| `gann_reply` | Reply to an inbound session from a remote agent |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Tool Details
|
|
162
|
+
|
|
163
|
+
### `gann_register_agent`
|
|
164
|
+
|
|
165
|
+
Registers a new agent on the GANN network. Returns an `agent_id` to use with `gann_connect`.
|
|
166
|
+
|
|
167
|
+
| Parameter | Type | Required | Default | Description |
|
|
168
|
+
|---|---|---|---|---|
|
|
169
|
+
| `api_key` | string | No | `$GANN_API_KEY` | GANN API key |
|
|
170
|
+
| `base_url` | string | No | `$GANN_BASE_URL` or `https://api.gnna.io` | Server URL |
|
|
171
|
+
| `agent_name` | string | Yes | — | Unique name for this agent |
|
|
172
|
+
| `description` | string | Yes | — | What this agent does |
|
|
173
|
+
| `capabilities` | array | Yes | — | List of `{name, description}` capability objects |
|
|
174
|
+
| `inputs` | object | Yes | — | JSON Schema for accepted payloads |
|
|
175
|
+
| `outputs` | object | Yes | — | JSON Schema for returned payloads |
|
|
176
|
+
| `version` | string | No | `"1"` | Version string |
|
|
177
|
+
| `summary` | string | No | — | Short summary |
|
|
178
|
+
|
|
179
|
+
### `gann_connect`
|
|
180
|
+
|
|
181
|
+
Connects this Claude Code session to GANN. Must be called before any other tool.
|
|
182
|
+
|
|
183
|
+
| Parameter | Type | Required | Default | Description |
|
|
184
|
+
|---|---|---|---|---|
|
|
185
|
+
| `api_key` | string | Yes | `$GANN_API_KEY` | GANN API key |
|
|
186
|
+
| `agent_id` | string | Yes | — | Agent UUID from `gann_register_agent` |
|
|
187
|
+
| `base_url` | string | No | `$GANN_BASE_URL` or `https://api.gnna.io` | Server URL |
|
|
188
|
+
| `capacity` | integer | No | 4 | LoadTracker capacity |
|
|
189
|
+
| `heartbeat_interval_s` | number | No | 30 | Seconds between heartbeats |
|
|
190
|
+
|
|
191
|
+
### `gann_search_agents`
|
|
192
|
+
|
|
193
|
+
| Parameter | Type | Required | Default | Description |
|
|
194
|
+
|---|---|---|---|---|
|
|
195
|
+
| `query` | string | Yes | — | Capability name, agent name, or keyword |
|
|
196
|
+
| `status` | string | No | all | Filter by status (e.g. `online`) |
|
|
197
|
+
| `limit` | integer | No | 10 | Max results |
|
|
198
|
+
|
|
199
|
+
### `gann_send_message`
|
|
200
|
+
|
|
201
|
+
Establishes a QUIC session (direct P2P first, relay fallback), sends a JSON payload, and returns the peer's response.
|
|
202
|
+
|
|
203
|
+
| Parameter | Type | Required | Description |
|
|
204
|
+
|---|---|---|---|
|
|
205
|
+
| `target_agent_id` | string | Yes | UUID of the target agent |
|
|
206
|
+
| `payload` | object | Yes | JSON payload to send |
|
|
207
|
+
|
|
208
|
+
### `gann_receive_messages`
|
|
209
|
+
|
|
210
|
+
Non-blocking drain of inbound messages received via QUIC.
|
|
211
|
+
|
|
212
|
+
| Parameter | Type | Required | Default | Description |
|
|
213
|
+
|---|---|---|---|---|
|
|
214
|
+
| `max_messages` | integer | No | 50 | Max messages to return |
|
|
215
|
+
|
|
216
|
+
### `gann_get_schema`
|
|
217
|
+
|
|
218
|
+
| Parameter | Type | Required | Description |
|
|
219
|
+
|---|---|---|---|
|
|
220
|
+
| `agent_id` | string | Yes | UUID of the agent |
|
|
221
|
+
|
|
222
|
+
### `gann_validate_input`
|
|
223
|
+
|
|
224
|
+
| Parameter | Type | Required | Description |
|
|
225
|
+
|---|---|---|---|
|
|
226
|
+
| `agent_id` | string | Yes | UUID of the target agent |
|
|
227
|
+
| `payload` | object | Yes | Payload to validate |
|
|
228
|
+
| `capability` | string | No | Specific capability to validate against |
|
|
229
|
+
|
|
230
|
+
### `gann_status`
|
|
231
|
+
|
|
232
|
+
No parameters. Returns connection state, agent ID, environment config.
|
|
233
|
+
|
|
234
|
+
### `gann_disconnect`
|
|
235
|
+
|
|
236
|
+
No parameters. Disconnects from GANN and cleans up resources.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Architecture
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
Claude Code
|
|
244
|
+
└── MCP stdio transport
|
|
245
|
+
└── claude-gann-mcp (Python process)
|
|
246
|
+
├── MCP Server (tool handlers)
|
|
247
|
+
├── GannState (singleton: client, agent_id, incoming queue)
|
|
248
|
+
├── GannClient (gann-sdk: heartbeat, signaling, search)
|
|
249
|
+
└── Background asyncio thread
|
|
250
|
+
├── QUIC accept loop (inbound messages → queue)
|
|
251
|
+
└── QUIC dial-first (outbound messages → response)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Connection modes:**
|
|
255
|
+
- **Direct P2P QUIC** — preferred, lowest latency, NAT traversal via STUN
|
|
256
|
+
- **Relay QUIC** — fallback through GANN relay server, E2EE with X25519-ChaCha20Poly1305
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Environment Variables
|
|
261
|
+
|
|
262
|
+
| Variable | Required | Default | Description |
|
|
263
|
+
|---|---|---|---|
|
|
264
|
+
| `GANN_API_KEY` | Yes | — | Your GANN API key |
|
|
265
|
+
| `GANN_BASE_URL` | No | `https://api.gnna.io` | GANN server URL |
|
|
266
|
+
|
|
267
|
+
Set these in the MCP server config `env` block or in your shell environment.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Plugin Files
|
|
272
|
+
|
|
273
|
+
This package also includes Claude Code plugin files that enhance the experience:
|
|
274
|
+
|
|
275
|
+
- **`commands/gann-setup.md`** — `/gann:gann-setup` — guided installation walkthrough
|
|
276
|
+
- **`commands/gann-status.md`** — `/gann:gann-status` — environment check script
|
|
277
|
+
- **`agents/gann-agent.md`** — GANN specialist subagent with full SDK knowledge
|
|
278
|
+
- **`hooks/hooks.json`** — detects edits to GANN-related files
|
|
279
|
+
|
|
280
|
+
To use these, symlink or copy the plugin directory:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
ln -s /path/to/claude-gann-plugin ~/.claude/plugins/gann
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## License
|
|
289
|
+
|
|
290
|
+
MIT
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "claude-gann-plugin"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Claude Code plugin for GANN (Global Agentic Neural Network) — connect, discover, and communicate with agents over P2P QUIC"
|
|
9
|
+
license = "MIT"
|
|
10
|
+
authors = [
|
|
11
|
+
{name = "Soika Labs", email = "vishnu@soika.ai"},
|
|
12
|
+
]
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
dependencies = [
|
|
16
|
+
"mcp>=1.0",
|
|
17
|
+
"gann-sdk[quic]",
|
|
18
|
+
"python-dotenv>=1.0",
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 4 - Beta",
|
|
22
|
+
"Intended Audience :: Developers",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Topic :: Software Development :: Libraries",
|
|
25
|
+
]
|
|
26
|
+
keywords = ["claude-code", "gann", "agents", "quic", "p2p", "mcp"]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
claude-gann-mcp = "claude_gann.mcp_server:main"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
where = ["src"]
|