Commit bac36c1
committed
fix: Add SHA to get_file_contents while preserving MCP behavior (#595)
Enhance get_file_contents to include SHA information without changing
the existing MCP server response format.
Changes:
- Add Contents API call to retrieve SHA before fetching raw content
- Include SHA in resourceURI (repo://owner/repo/sha/{SHA}/contents/path)
- Add SHA to success messages
- Update tests to verify SHA inclusion
- Maintain original behavior: text files return raw text, binaries return base64
This preserves backward compatibility while providing SHA information
for better file versioning support.
Closes #5951 parent d15026b commit bac36c1
2 files changed
+57
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
510 | 518 | | |
511 | 519 | | |
512 | 520 | | |
| |||
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
533 | 546 | | |
534 | 547 | | |
535 | 548 | | |
| |||
548 | 561 | | |
549 | 562 | | |
550 | 563 | | |
551 | | - | |
| 564 | + | |
552 | 565 | | |
553 | 566 | | |
554 | 567 | | |
555 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
556 | 574 | | |
557 | 575 | | |
558 | | - | |
| 576 | + | |
559 | 577 | | |
560 | 578 | | |
561 | 579 | | |
562 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
563 | 586 | | |
564 | 587 | | |
565 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
| |||
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
95 | | - | |
| 109 | + | |
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
| |||
107 | 121 | | |
108 | 122 | | |
109 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
110 | 138 | | |
111 | 139 | | |
112 | 140 | | |
| |||
123 | 151 | | |
124 | 152 | | |
125 | 153 | | |
126 | | - | |
| 154 | + | |
127 | 155 | | |
128 | 156 | | |
129 | 157 | | |
| |||
0 commit comments