Skip to content

Conversation

@alexhancock
Copy link
Collaborator

@alexhancock alexhancock commented Sep 24, 2025

  • Fully gets rid of mcp-client and mcp-core making all our mcp tooling just use the rust-sdk
  • Removes concept of ToolCall and replaces it with the similar CallToolRequestParam from rmcp
  • Associated required code changes, compilation fixes etc

@alexhancock alexhancock requested a review from jamadeo September 24, 2025 22:05
@alexhancock alexhancock marked this pull request as draft September 24, 2025 22:05
@alexhancock alexhancock force-pushed the alexhancock/mcp-cleanup branch 6 times, most recently from ffe77df to 1b4a865 Compare September 26, 2025 01:39
@alexhancock
Copy link
Collaborator Author

@jamadeo how do you feel about the fact that this removes mcp-client but still impl McpClientTrait for McpClients

Do you think we should unwind that in a change where we remove those crates, or ok to do in a followup?

Also I realize this is a big PR so can sync on it when I've verified it's ready for review otherwise.

@alexhancock alexhancock force-pushed the alexhancock/mcp-cleanup branch 3 times, most recently from ea04549 to 2fa1ab7 Compare September 26, 2025 15:52
@alexhancock alexhancock changed the title Final Internal MCP Crate Cleanup Internal MCP Crate Cleanup Sep 26, 2025
@alexhancock alexhancock force-pushed the alexhancock/mcp-cleanup branch 4 times, most recently from 33da81d to 982a579 Compare September 26, 2025 19:10
@alexhancock alexhancock marked this pull request as ready for review September 26, 2025 19:29
Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice. I left some nitpick comments, mostly places where I think there are unnecessary clones (.to_string().clone()) and some places where there's another level of if-nesting that could be replaced with a .and_then(..)

But feel free to merge before addressing all of them, wouldn't want to be constantly fixing conflicts.

Maybe the one thing to give an extra look to is the 1 that became None in acp.rs

meta: None,
});
if let Some(args_map) = args {
if let Some(path_str) = args_map.get("path").and_then(|p| p.as_str()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could be a single if let Some(.. with a .and_then

if path.exists() && path.is_file() {
locs.push(acp::ToolCallLocation {
path: path_str.into(),
line: None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is line: Some(1) on the left but None here, is that deliberate?

tool_name: tool_call
.name
.to_string()
.clone(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to .clone() here since .to_string() should return an owned value

md.push_str("**Arguments:**\n");

match call.name.as_str() {
match call.name.to_string().as_str() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

match call.name.as_ref()


let success = tool_response.tool_result.is_ok();
let result_status = if success { "success" } else { "error" };
.unwrap_or_else(|| "tool".to_string().into());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to change this from "unknown" to "tool"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch - thank you

style(format!("{}", item)).green()
);
if let Some(args) = &call.arguments {
if let Some(Value::Array(task_parameters)) = args.get("task_parameters") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could chain these two as well

let tool_call = ToolCall::new(name, Value::Object(serde_json::Map::new()));
message = message.with_tool_request(id, Ok(tool_call));
if let Some(id) = tool_use_id {
if let Some(name) = tool_name {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could chain these to remove a nesting level

@jamadeo
Copy link
Collaborator

jamadeo commented Sep 26, 2025

@jamadeo how do you feel about the fact that this removes mcp-client but still impl McpClientTrait for McpClients

Do you think we should unwind that in a change where we remove those crates, or ok to do in a followup?

Also I realize this is a big PR so can sync on it when I've verified it's ready for review otherwise.

I think that's fine, if there's some point in the future where it makes sense to remove a layer of abstraction, we can always do that.

@alexhancock alexhancock force-pushed the alexhancock/mcp-cleanup branch 2 times, most recently from 105da2d to 0764041 Compare September 29, 2025 14:20
@alexhancock alexhancock force-pushed the alexhancock/mcp-cleanup branch from 0764041 to 440de70 Compare September 29, 2025 14:20
@alexhancock alexhancock merged commit 146cf31 into main Sep 29, 2025
11 checks passed
@alexhancock alexhancock deleted the alexhancock/mcp-cleanup branch September 29, 2025 14:39
alexhancock added a commit that referenced this pull request Sep 29, 2025
alexhancock added a commit that referenced this pull request Sep 29, 2025
zanesq added a commit that referenced this pull request Sep 30, 2025
…-unification

* 'main' of github.com:block/goose: (24 commits)
  feat(cli): add `path` & `limit` to `session list` command (#4878)
  Allow better concurrent access (#4896)
  fix: Windows prompt cursor positioning issue with ANSI escape sequences (#4464)
  Fix: LiteLLM API key field not showing in UI configuration (#4105)
  fix: path is duplicated on tool calls causing them to fail (#4658) (#4859)
  add new prompt to get all available tutorials (#4802)
  Add filtering for agentVisible: false messages on streaming providers (#4847)
  alexhancock/mcp-crate-cleanup (#4885)
  docs: rename sub-recipe to subrecipe (#4886)
  docs: new multi-model section with autopilot topic (#4864)
  make agent manager singleton (#4880)
  Cli web auth token (#4456)
  fix(token_counter): fix panic with GitHub Copilot (#4632)
  Revert "Internal MCP Crate Cleanup (#4800)" (#4883)
  remove 2 redundant comments and one that lies (#4866)
  Internal MCP Crate Cleanup (#4800)
  Fix #4612: Return non-zero exit code when CLI session ends with error (#4621)
  Dead code cleanup (#4873)
  fix: restoring test data and correcting name (#4875)
  Add .goosehints file to enforce lowercase branding in documentation (#4870)
  ...
matt-wirth added a commit to LiquidMetal-AI/goose that referenced this pull request Sep 30, 2025
* remove only-pr-labels (block#4842)

Signed-off-by: Angela Ning <aning@squareup.com>

* Docs: Add link to Plug & Play video for Reddit MCP (block#4852)

* Fix: Token count UI doesn't re-render if it's open. (block#4822)

* Update databricks flash model (block#4836)

* Session manager (block#4648)

Co-authored-by: Douwe Osinga <douwe@squareup.com>

* Add Hacktoberfest Guides (block#4830)

Co-authored-by: taniashiba <126204004+taniashiba@users.noreply.github.com>

* docs: goose x Hacktoberfest 2025 Blog (block#4855)

Co-authored-by: Tania Chakraborty <tchakraborty@block.xyz>
Co-authored-by: Angie Jones <jones.angie@gmail.com>

* fix: delete some flaky and not-useful tests (block#4861)

* can tell the system what shell it is using (block#4807)

* new subrecipe blog post banner (block#4862)

* docs: remove recipe generator link from next to extension search (block#4858)

* lowercase g in goose (block#4832)

* doc: file parameter recipe update (block#4594)

* Fiie input recipe ref doc (block#4869)

* Add .goosehints file to enforce lowercase branding in documentation (block#4870)

Co-authored-by: Angie Jones <jones.angie@gmail.com>

* fix: restoring test data and correcting name (block#4875)

* Dead code cleanup (block#4873)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Michael Neale <michael.neale@gmail.com>

* Fix block#4612: Return non-zero exit code when CLI session ends with error (block#4621)

Signed-off-by: jalateras <jima@comware.com.au>

* Internal MCP Crate Cleanup (block#4800)

* remove 2 redundant comments and one that lies (block#4866)

Co-authored-by: Douwe Osinga <douwe@squareup.com>

* Revert "Internal MCP Crate Cleanup (block#4800)" (block#4883)

* fix(token_counter): fix panic with GitHub Copilot (block#4632)

Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com>

main was broken. this seems important

* Cli web auth token (block#4456)

Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>

* make agent manager singleton (block#4880)

* docs: new multi-model section with autopilot topic (block#4864)

* docs: rename sub-recipe to subrecipe (block#4886)

* alexhancock/mcp-crate-cleanup (block#4885)

* Temporary workaround for mcp server

* Add filtering for agentVisible: false messages on streaming providers (block#4847)

* add new prompt to get all available tutorials (block#4802)

Signed-off-by: AdemolaAri <ademola.ari@gmail.com>

* Fix for auth in extension, fix for stale keychain

* fix: path is duplicated on tool calls causing them to fail (block#4658) (block#4859)

Signed-off-by: demetrio108 <demetrio108@protonmail.com>

* Fix: LiteLLM API key field not showing in UI configuration (block#4105)

Signed-off-by: jalateras <jima@comware.com.au>
Co-authored-by: Ebony Louis <55366651+EbonyLouis@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jack Amadeo <jackamadeo@squareup.com>

* fix: Windows prompt cursor positioning issue with ANSI escape sequences (block#4464)

Signed-off-by: Matt Donovan <mattddonovan@protonmail.com>
Co-authored-by: Matt Donovan <mattddonovan@protonmail.com>

* Allow better concurrent access (block#4896)

Co-authored-by: Douwe Osinga <douwe@squareup.com>

* feat(cli): add `path` & `limit` to `session list` command (block#4878)

* Added CMD+T keyboard shortcut that takes you to the Home tab (block#4541)

Signed-off-by: Guillaume Simard <2000390+GuiSim@users.noreply.github.com>

---------

Signed-off-by: Angela Ning <aning@squareup.com>
Signed-off-by: jalateras <jima@comware.com.au>
Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>
Signed-off-by: AdemolaAri <ademola.ari@gmail.com>
Signed-off-by: demetrio108 <demetrio108@protonmail.com>
Signed-off-by: Matt Donovan <mattddonovan@protonmail.com>
Signed-off-by: Guillaume Simard <2000390+GuiSim@users.noreply.github.com>
Co-authored-by: Angela Ning <32008323+angelahning@users.noreply.github.com>
Co-authored-by: Emma Youndtsmith <90283317+emma-squared@users.noreply.github.com>
Co-authored-by: David Katz <dkatz@squareup.com>
Co-authored-by: Douwe Osinga <douwe@block.xyz>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Ebony Louis <55366651+EbonyLouis@users.noreply.github.com>
Co-authored-by: taniashiba <126204004+taniashiba@users.noreply.github.com>
Co-authored-by: taniandjerry <126204004+taniandjerry@users.noreply.github.com>
Co-authored-by: Tania Chakraborty <tchakraborty@block.xyz>
Co-authored-by: Angie Jones <jones.angie@gmail.com>
Co-authored-by: Jack Amadeo <jackamadeo@block.xyz>
Co-authored-by: Michael Neale <michael.neale@gmail.com>
Co-authored-by: w. ian douglas <ian.douglas@iandouglas.com>
Co-authored-by: Alex Hancock <alexhancock@block.xyz>
Co-authored-by: Jarrod Sibbison <72240382+jsibbison-square@users.noreply.github.com>
Co-authored-by: Rizel Scarlett <rizel@squareup.com>
Co-authored-by: Jim Alateras <jima@comware.com.au>
Co-authored-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com>
Co-authored-by: Evan Feenstra <evanfeenstra@gmail.com>
Co-authored-by: Yingjie He <yingjiehe@squareup.com>
Co-authored-by: dianed-square <73617011+dianed-square@users.noreply.github.com>
Co-authored-by: Ademola Arigbabuwo <49918815+AdemolaAri@users.noreply.github.com>
Co-authored-by: Demetrio ⚡️ <35406575+demetrio108@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jack Amadeo <jackamadeo@squareup.com>
Co-authored-by: Matt Donovan <mattddonovan@proton.me>
Co-authored-by: Matt Donovan <mattddonovan@protonmail.com>
Co-authored-by: Robert Mcgregor <38837341+exitcode0@users.noreply.github.com>
Co-authored-by: Guillaume Simard <2000390+GuiSim@users.noreply.github.com>
wpfleger96 added a commit to wpfleger96/goose that referenced this pull request Oct 1, 2025
* main: (206 commits)
  Tiny: fix github casing  (block#4903)
  remove anyOf from create_task tool (block#4897)
  chore(deps): bump tracing-subscriber from 0.3.19 to 0.3.20 (block#4442)
  fix optional recipe schema zod validation (block#4900)
  Added CMD+T keyboard shortcut that takes you to the Home tab (block#4541)
  feat(cli): add `path` & `limit` to `session list` command (block#4878)
  Allow better concurrent access (block#4896)
  fix: Windows prompt cursor positioning issue with ANSI escape sequences (block#4464)
  Fix: LiteLLM API key field not showing in UI configuration (block#4105)
  fix: path is duplicated on tool calls causing them to fail (block#4658) (block#4859)
  add new prompt to get all available tutorials (block#4802)
  Add filtering for agentVisible: false messages on streaming providers (block#4847)
  alexhancock/mcp-crate-cleanup (block#4885)
  docs: rename sub-recipe to subrecipe (block#4886)
  docs: new multi-model section with autopilot topic (block#4864)
  make agent manager singleton (block#4880)
  Cli web auth token (block#4456)
  fix(token_counter): fix panic with GitHub Copilot (block#4632)
  Revert "Internal MCP Crate Cleanup (block#4800)" (block#4883)
  remove 2 redundant comments and one that lies (block#4866)
  ...
HikaruEgashira pushed a commit to HikaruEgashira/goose that referenced this pull request Oct 3, 2025
Signed-off-by: HikaruEgashira <hikaru-egashira@c-fo.com>
HikaruEgashira pushed a commit to HikaruEgashira/goose that referenced this pull request Oct 3, 2025
Signed-off-by: HikaruEgashira <hikaru-egashira@c-fo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants