Commit 898336e
authored
Support MCP servers for third-party harnesses. (#10341)
## Description
<!-- Please remember to add your design buddy onto the PR for review, if
it contains any UI changes! -->
This PR adds support for MCP servers for third-party harnesses with
cloud agents.
When setting up the driver for a third-party task, we add a new step
`resolve_mcp_specs_to_json`, which converts MCP server config data from
the task into a JSON format by applying any secret values to the
templated MCP.
We thread this list of `JSONMCPServer`s into each harness's environment
setup, where:
- Claude writes them to a temp file, which we pass a path to via
`--mcp-config` flag
- Codex writes them to a section of `config.toml`
In this PR, I also remove `prepare_environment_config` from the
`ThirdPartyHarness` trait and move its implementation into
`build_runner`. Across Claude Code and Codex we started to do different
parts of the environment setup process in each place (e.g. Codex would
seed the system prompt in `prepare_environment_config`, while CC needed
to do it in `build_runner` so we could hold onto the temp file), which
resulted in adding the params to both functions that each harness would
ignore in one place and user in the other. We always call
`prepare_environment_config`, and `build_runner` back to back; now we
fold `prepare_environment_config` responsibilities within
`build_runner`.
## Testing
<!--
How did you test this change? What automated tests did you add? If you
didn't add any new tests, what's your justification for not adding any?
Manual testing is required for changes that can be manually tested, and
almost all changes can be manually tested. If your change can be
manually tested, please include screenshots or a screen recording that
show it working end to end.
You can run the app locally using `./script/run` - see WARP.md for more
details on how to get set up.
-->
Tested locally for both `codex` and `claude` with `./script/oz-local`,
Loom available in Slack.
- [x] Just Linear (single MCP, stdio)
- [x] Linear and Sentry (multiple MCP servers, stdio)
- [x] Context7 (single MCP, http)
## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode1 parent 10e2bae commit 898336e
10 files changed
Lines changed: 606 additions & 107 deletions
File tree
- app/src
- ai/agent_sdk
- driver/harness
- claude_code
- pane_group/pane
- specs/REMOTE-1345
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
790 | 790 | | |
791 | 791 | | |
792 | 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 | + | |
793 | 831 | | |
794 | 832 | | |
795 | 833 | | |
| |||
1451 | 1489 | | |
1452 | 1490 | | |
1453 | 1491 | | |
1454 | | - | |
1455 | | - | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
1456 | 1499 | | |
1457 | 1500 | | |
1458 | 1501 | | |
| |||
1514 | 1557 | | |
1515 | 1558 | | |
1516 | 1559 | | |
| 1560 | + | |
1517 | 1561 | | |
1518 | 1562 | | |
1519 | 1563 | | |
| |||
1570 | 1614 | | |
1571 | 1615 | | |
1572 | 1616 | | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1576 | 1636 | | |
1577 | 1637 | | |
1578 | 1638 | | |
1579 | 1639 | | |
1580 | | - | |
1581 | | - | |
1582 | | - | |
1583 | | - | |
1584 | | - | |
1585 | 1640 | | |
1586 | 1641 | | |
1587 | 1642 | | |
| |||
1597 | 1652 | | |
1598 | 1653 | | |
1599 | 1654 | | |
| 1655 | + | |
| 1656 | + | |
1600 | 1657 | | |
1601 | 1658 | | |
1602 | 1659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 74 | | |
88 | 75 | | |
89 | 76 | | |
| |||
114 | 101 | | |
115 | 102 | | |
116 | 103 | | |
| 104 | + | |
| 105 | + | |
117 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
| |||
132 | 129 | | |
133 | 130 | | |
134 | 131 | | |
| 132 | + | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
| |||
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| |||
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| 187 | + | |
| 188 | + | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| |||
208 | 212 | | |
209 | 213 | | |
210 | 214 | | |
| 215 | + | |
211 | 216 | | |
212 | 217 | | |
213 | 218 | | |
214 | | - | |
| 219 | + | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
249 | | - | |
| 254 | + | |
250 | 255 | | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
254 | 271 | | |
255 | 272 | | |
256 | 273 | | |
| |||
263 | 280 | | |
264 | 281 | | |
265 | 282 | | |
| 283 | + | |
266 | 284 | | |
267 | 285 | | |
268 | 286 | | |
269 | 287 | | |
270 | 288 | | |
| 289 | + | |
271 | 290 | | |
272 | 291 | | |
273 | 292 | | |
| |||
541 | 560 | | |
542 | 561 | | |
543 | 562 | | |
544 | | - | |
| 563 | + | |
545 | 564 | | |
546 | 565 | | |
547 | 566 | | |
| |||
679 | 698 | | |
680 | 699 | | |
681 | 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 | + | |
682 | 769 | | |
683 | 770 | | |
684 | 771 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
0 commit comments