kodegen_tools_github 0.2.2

KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
# kodegen_github

GitHub API operations via Octocrab with MCP tool wrappers for AI agents.

## Features

- **Async-first**: Built on tokio for efficient async operations
- **Clean API**: Wraps octocrab with ergonomic interfaces
- **MCP Tools**: 12 GitHub tools for AI agent integration (7 issue + 5 pull request tools)
- **Type-safe**: Full Rust type safety throughout
- **Streaming**: Efficient streaming for large result sets

## MCP Tools

### Issue Operations

#### create_issue

Create a new issue in a GitHub repository.

**Arguments:**
- `owner` (string): Repository owner (user or organization)
- `repo` (string): Repository name
- `title` (string): Issue title
- `body` (string, optional): Issue description (Markdown supported)
- `labels` (array<string>, optional): Labels to apply
- `assignees` (array<string>, optional): Users to assign

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "title": "Bug: Login fails",
  "body": "When I try to login, the form doesn't submit...",
  "labels": ["bug", "priority-high"],
  "assignees": ["octocat"]
}
```

**Requirements:**
- GITHUB_TOKEN environment variable must be set
- Token needs 'repo' scope for private repos, 'public_repo' for public
- User must have write access to the repository
- Labels must already exist in the repository
- Assignees must be collaborators on the repository

---

#### get_issue

Fetch a single issue by number.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `issue_number` (number): Issue number

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "issue_number": 42
}
```

**Returns:**
- `number`: Issue number
- `title`: Issue title
- `body`: Issue description
- `state`: "open" or "closed"
- `labels`: Array of label objects
- `assignees`: Array of assigned users
- `created_at`: Creation timestamp
- `updated_at`: Last update timestamp
- `comments`: Number of comments
- `html_url`: Link to issue on GitHub

**Note:** `issue_number` is the issue number (e.g., #42), NOT the internal ID. Works for both issues and pull requests.

---

#### list_issues

List and filter repository issues.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `state` (string, optional): "open" (default), "closed", or "all"
- `labels` (array<string>, optional): Filter by labels (AND logic)
- `assignee` (string, optional): Filter by assignee username
- `page` (number, optional): Page number for pagination
- `per_page` (number, optional): Results per page (max 100, default 30)

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "state": "open",
  "labels": ["bug"],
  "per_page": 50
}
```

**Filter behavior:**
- Multiple labels match issues with ALL labels (AND logic, not OR)
- State defaults to "open" if not specified
- Returns issues in most recent order

---

#### update_issue

Update an existing issue.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `issue_number` (number): Issue number
- `title` (string, optional): New title
- `body` (string, optional): New body
- `state` (string, optional): "open" or "closed"
- `labels` (array<string>, optional): Replace labels
- `assignees` (array<string>, optional): Replace assignees

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "issue_number": 42,
  "state": "closed",
  "labels": ["bug", "resolved"]
}
```

**Important notes:**
- All fields are optional - only specified fields are updated
- `labels` and `assignees` REPLACE existing values (not additive)
- To clear labels or assignees, pass empty array: []
- Set `state` to "closed" to close an issue, "open" to reopen

---

#### search_issues

Search issues across GitHub using GitHub's search syntax.

**Arguments:**
- `query` (string): GitHub search query (supports complex syntax)
- `sort` (string, optional): "comments", "reactions", "created", "updated"
- `order` (string, optional): "asc" or "desc"
- `page` (number, optional): Page number
- `per_page` (number, optional): Results per page (max 100)

**Search Query Syntax:**
- `repo:owner/repo` - Search in specific repository
- `is:open` / `is:closed` - Filter by state
- `label:bug` - Filter by label
- `assignee:username` - Filter by assignee
- `author:username` - Filter by author
- `involves:username` - User is author, assignee, or mentioned
- `created:>=2024-01-01` - Created after date
- `created:2024-01-01..2024-12-31` - Date range
- Text without prefix searches title and body

**Example:**
```json
{
  "query": "repo:octocat/hello-world is:open label:bug created:>=2024-01-01",
  "sort": "created",
  "order": "desc",
  "per_page": 20
}
```

**Combined filters example:**
```
repo:octocat/hello-world is:open label:bug assignee:alice created:>=2024-01-01
```

**Important notes:**
- Search API has stricter rate limits (30 requests/minute authenticated)
- Results are relevance-ranked by default
- Use quotes for multi-word searches: "bug report"
- Date format: YYYY-MM-DD

---

#### add_issue_comment

Add a comment to an existing issue.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `issue_number` (number): Issue number
- `body` (string): Comment text (Markdown supported)

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "issue_number": 42,
  "body": "This has been fixed in the latest release."
}
```

**Markdown features:**
- Full Markdown support (headings, code blocks, lists, etc.)
- @mention users to notify them
- Reference other issues/PRs with #number
- Link commits with SHA hashes
- Add emojis with :emoji_name:

**Important notes:**
- This tool CREATES a new comment each time (not idempotent)
- Cannot edit existing comments (separate tool needed)
- Works for both issues and pull requests

---

#### get_issue_comments

Fetch all comments for an issue.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `issue_number` (number): Issue number

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "issue_number": 42
}
```

**Returns:**
Array of comment objects with:
- `id`: Comment ID
- `body`: Comment text (Markdown)
- `user`: Author information (login, avatar_url, etc.)
- `created_at`: When comment was created
- `updated_at`: When comment was last edited
- `html_url`: Link to comment on GitHub
- `author_association`: Relationship to repo (OWNER, CONTRIBUTOR, etc.)

**Comment ordering:**
- Comments are returned in chronological order (oldest first)
- Use `created_at` timestamp to determine comment age
- Check `author_association` to see if author is repo owner/maintainer
- `updated_at` differs from `created_at` if comment was edited

---

### Pull Request Operations

#### create_pull_request

Create a new pull request in a GitHub repository.

**Arguments:**
- `owner` (string): Repository owner (user or organization)
- `repo` (string): Repository name
- `title` (string): Pull request title
- `body` (string, optional): Pull request description (Markdown supported)
- `head` (string): Name of the branch where changes are implemented (head branch)
- `base` (string): Name of the branch to merge into (base branch)
- `draft` (boolean, optional): Create as draft PR (default: false)
- `maintainer_can_modify` (boolean, optional): Allow maintainer edits (default: true)

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "title": "Add new feature",
  "body": "This PR adds...\n\nCloses #123",
  "head": "feature-branch",
  "base": "main",
  "draft": false
}
```

**Cross-fork PRs:**
For PRs from a fork, use format: `fork-owner:branch-name` for head:
```json
{
  "owner": "upstream-owner",
  "repo": "project",
  "title": "Fix authentication bug",
  "head": "fork-owner:fix-auth-bug",
  "base": "main"
}
```

**Requirements:**
- GITHUB_TOKEN with appropriate permissions
- Head branch must exist
- Base branch must exist
- User must have push access to head repository
- User needs write access for non-fork PRs

---

#### update_pull_request

Update an existing pull request.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pr_number` (number): Pull request number
- `title` (string, optional): New title
- `body` (string, optional): New description
- `state` (string, optional): "open" or "closed"
- `base` (string, optional): New base branch
- `maintainer_can_modify` (boolean, optional): Allow maintainer edits

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pr_number": 42,
  "title": "Updated: Add new feature",
  "state": "open"
}
```

**Important notes:**
- All fields are optional except owner, repo, and pr_number
- Only specified fields are updated
- Changing base branch retargets the PR
- Set state to "closed" to close without merging

---

#### merge_pull_request

Merge a pull request in a GitHub repository.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pr_number` (number): Pull request number
- `commit_title` (string, optional): Merge commit title
- `commit_message` (string, optional): Merge commit message
- `merge_method` (string, optional): "merge", "squash", or "rebase"
- `sha` (string, optional): SHA of PR head for safety check

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pr_number": 42,
  "merge_method": "squash",
  "commit_title": "Add authentication feature"
}
```

**Merge methods:**
- `merge`: Creates merge commit, preserves all commits
- `squash`: Combines all commits into one
- `rebase`: Rebases commits onto base branch

**Safety:**
Use `sha` parameter to ensure PR hasn't changed:
```json
{
  "pr_number": 42,
  "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
```

**Requirements:**
- PR must be in mergeable state
- All required checks must pass
- Sufficient review approvals
- No merge conflicts
- User must have write access

**Warning:** This is a destructive operation that modifies the base branch.

---

#### get_pull_request_status

Get detailed status information about a pull request.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pr_number` (number): Pull request number

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pr_number": 42
}
```

**Returns comprehensive status:**
- Basic info: number, title, state, author
- Merge status: mergeable, merge conflicts
- Base/head branches and SHAs
- CI/CD check status and results
- Review state (approved, changes requested, pending)
- Labels and assignees
- Draft status
- Mergeable state (clean, dirty, blocked, unstable, etc.)

**Use cases:**
- Pre-merge validation
- CI/CD monitoring
- Review requirement checks
- Conflict detection
- Workflow automation
- Status dashboards

**Important fields:**
- `mergeable`: true/false/null (null = still calculating)
- `mergeable_state`: "clean", "dirty", "blocked", "unstable"
- `draft`: true if still in draft mode
- `merged`: true if already merged

---

#### get_pull_request_files

Get all files changed in a pull request with diff stats.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pr_number` (number): Pull request number

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pr_number": 42
}
```

**Returns for each file:**
- `filename`: Path to the file
- `status`: "added", "modified", "removed", "renamed", "copied"
- `additions`: Lines added
- `deletions`: Lines deleted
- `changes`: Total changes (additions + deletions)
- `patch`: Actual diff content
- `blob_url`: URL to view file
- `raw_url`: URL to download raw file
- `previous_filename`: Original name (for renamed files)

**Response format:**
```json
{
  "files": [
    {
      "filename": "src/main.rs",
      "status": "modified",
      "additions": 15,
      "deletions": 3,
      "changes": 18,
      "patch": "@@ -10,7 +10,19 @@..."
    }
  ],
  "count": 5
}
```

**Use cases:**
- Code review preparation
- Impact analysis and scope assessment
- Automated PR checks
- Test coverage verification
- Documentation update checks
- File type filtering
- Change size metrics

---

### Pull Request Review Operations

#### get_pull_request_reviews

Get all reviews for a pull request.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pull_number` (number): PR number

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42
}
```

**Returns:** Array of reviews with:
- `id`: Review ID
- `user`: Reviewer username and profile
- `body`: Review comment text
- `state`: "APPROVED", "CHANGES_REQUESTED", "COMMENTED", "DISMISSED", "PENDING"
- `submitted_at`: When review was submitted
- `commit_id`: SHA the review is associated with

**Use cases:**
- Check approval status before merging
- See who has reviewed and their feedback
- Understand what changes were requested
- Track review history over time

---

#### create_pull_request_review

Create a review on a pull request (approve, request changes, or comment).

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pull_number` (number): PR number
- `event` (string): "APPROVE", "REQUEST_CHANGES", or "COMMENT"
- `body` (string, optional): Review comment
- `commit_id` (string, optional): Specific commit to review

**Example (approve):**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42,
  "event": "APPROVE",
  "body": "Looks good to me!"
}
```

**Example (request changes):**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42,
  "event": "REQUEST_CHANGES",
  "body": "Please address the comments before merging."
}
```

**Event types:**
- `APPROVE`: Approve the PR (allows merging if required reviews are met)
- `REQUEST_CHANGES`: Block PR until changes are made
- `COMMENT`: Leave review comments without approval/blocking

**Note:** This creates a REVIEW, not individual line comments. Use add_pull_request_review_comment for inline comments.

---

#### add_pull_request_review_comment

Add an inline review comment to a PR (comment on specific lines of code).

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pull_number` (number): PR number
- `body` (string): Comment text
- `commit_id` (string, optional): Commit SHA
- `path` (string, optional): File path
- `line` (number, optional): Line number in diff
- `side` (string, optional): "LEFT" or "RIGHT"
- `start_line` (number, optional): For multi-line comments
- `start_side` (string, optional): Side of start line
- `subject_type` (string, optional): Subject type
- `in_reply_to` (number, optional): Comment ID to reply to

**Example (inline comment):**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42,
  "body": "Consider using const here",
  "commit_id": "abc123",
  "path": "src/main.rs",
  "line": 45,
  "side": "RIGHT"
}
```

**Example (multi-line comment):**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42,
  "body": "This entire function could be simplified",
  "commit_id": "abc123",
  "path": "src/utils.rs",
  "start_line": 20,
  "line": 25,
  "side": "RIGHT"
}
```

**Example (reply to comment):**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42,
  "body": "Good point, will fix",
  "in_reply_to": 123456789
}
```

**Comment types:**
1. **New inline comment**: Requires commit_id, path, line, and optionally side
2. **Multi-line comment**: Requires commit_id, path, start_line, line, and optionally sides
3. **Threaded reply**: Only requires in_reply_to (inherits position from parent)

**Tips:**
- Use RIGHT side for commenting on new/changed code (most common)
- Use LEFT side for commenting on old code being removed
- Multi-line comments span from start_line to line (inclusive)
- Thread replies create conversations on specific code sections

---

#### request_copilot_review

Request GitHub Copilot to review a pull request (experimental).

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `pull_number` (number): PR number

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "pull_number": 42
}
```

**What Copilot reviews:**
- Code quality and best practices
- Potential bugs and issues
- Security vulnerabilities
- Performance improvements
- Code style and conventions

**Important notes:**
- This is an **EXPERIMENTAL** feature that may change
- Requires GitHub Copilot access on the repository
- The request triggers the review but doesn't return the review content
- Check PR comments after a short delay to see Copilot's feedback
- Not all repositories have Copilot review enabled

**Example workflow:**
1. Create or update a pull request
2. Request Copilot review: `request_copilot_review({...})`
3. Wait a few moments for Copilot to analyze
4. Check PR comments: `get_pull_request_reviews({...})`
5. Review Copilot's suggestions and feedback

---

### Repository Operations

#### create_repository

Create a new repository under the authenticated user's account.

**Arguments:**
- `name` (string): Repository name
- `description` (string, optional): Repository description
- `private` (boolean, optional): Make private
- `auto_init` (boolean, optional): Initialize with README

**Example:**
```json
{
  "name": "my-project",
  "description": "My awesome project",
  "private": false,
  "auto_init": true
}
```

---

#### fork_repository

Fork a repository.

**Arguments:**
- `owner` (string): Repository owner to fork from
- `repo` (string): Repository name
- `organization` (string, optional): Fork to organization

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world"
}
```

---

#### list_branches

List branches in a repository.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `page` (number, optional): Page number
- `per_page` (number, optional): Results per page

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "per_page": 50
}
```

---

#### create_branch

Create a new branch from a commit SHA.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `branch_name` (string): New branch name
- `sha` (string): Commit SHA to branch from

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "branch_name": "feature/new-feature",
  "sha": "abc123def456"
}
```

---

#### list_commits

List commits in a repository with filtering options.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `sha` (string, optional): Branch or SHA to start from
- `path` (string, optional): Only commits affecting this path
- `author` (string, optional): Filter by author
- `since` (string, optional): Only after this date (ISO 8601)
- `until` (string, optional): Only before this date (ISO 8601)
- `page` (number, optional): Page number
- `per_page` (number, optional): Results per page

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "sha": "main",
  "author": "octocat",
  "since": "2024-01-01T00:00:00Z",
  "per_page": 25
}
```

---

#### get_commit

Get detailed information about a specific commit.

**Arguments:**
- `owner` (string): Repository owner
- `repo` (string): Repository name
- `commit_sha` (string): Commit SHA
- `page` (number, optional): Page for files list
- `per_page` (number, optional): Results per page

**Example:**
```json
{
  "owner": "octocat",
  "repo": "hello-world",
  "commit_sha": "abc123def456"
}
```

---

### Search Operations

#### search_code

Search code across GitHub repositories.

**Arguments:**
- `query` (string): Search query (GitHub code search syntax)
- `sort` (string, optional): Sort by "indexed"
- `order` (string, optional): "asc" or "desc"
- `page` (number, optional): Page number
- `per_page` (number, optional): Results per page

**Query Syntax:**
- `repo:owner/repo` - Search in repository
- `language:rust` - Filter by language
- `path:src/` - Search in path
- `extension:rs` - Filter by extension
- Text without prefix searches code content

**Example:**
```json
{
  "query": "repo:octocat/hello-world async fn language:rust",
  "per_page": 20
}
```

---

#### search_repositories

Search GitHub repositories.

**Arguments:**
- `query` (string): Search query (GitHub repository search syntax)
- `sort` (string, optional): "stars", "forks", or "updated"
- `order` (string, optional): "asc" or "desc"
- `page` (number, optional): Page number
- `per_page` (number, optional): Results per page

**Query Syntax:**
- `language:rust` - Filter by language
- `stars:>1000` - Star count filter
- `forks:>100` - Fork count filter
- `topic:async` - Filter by topic
- `user:octocat` - By user
- `org:github` - By organization

**Example:**
```json
{
  "query": "language:rust stars:>100 topic:async",
  "sort": "stars",
  "order": "desc",
  "per_page": 10
}
```

---

#### search_users

Search GitHub users.

**Arguments:**
- `query` (string): Search query
- `sort` (string, optional): "followers", "repositories", or "joined"
- `order` (string, optional): "asc" or "desc"
- `page` (number, optional): Page number
- `per_page` (number, optional): Results per page

**Example:**
```json
{
  "query": "location:\"San Francisco\" language:rust",
  "sort": "followers",
  "order": "desc"
}
```

---

## Environment Variables

All tools require:
- `GITHUB_TOKEN`: Personal access token or app token

**Token scopes:**
- Public repos: `public_repo` scope
- Private repos: `repo` scope

## Usage in Rust

```rust
use kodegen_github::GitHubClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = GitHubClient::with_token("ghp_...")?;
    
    let issue = client.get_issue("octocat", "hello-world", 42).await?;
    println!("Issue: {:?}", issue);
    
    Ok(())
}
```

## MCP Integration

These tools are automatically available when the `github` feature is enabled in the kodegen server:

```bash
# Enable GitHub tools
kodegen --tool github

# List available categories
kodegen --list-categories
```

## License

MIT