Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Conversation

@jamesrochabrun
Copy link
Contributor

Summary

This PR adds a demos in a Chat interface using MCP.

MCPDemo.mov

Other:

This PR "bridges" MCP tools from mcp-swift-sdk in to SwiftAnthropic Tools.
This is needed as although they are similar, they are not the same object.

Decided to do a non stream demo first as handling tools with stream enabled involves more code for accumulating tools from stream. Once this is landed we can add one for stream.

@jamesrochabrun
Copy link
Contributor Author

@gsabran I added also support for OpenAI, although for some reason responses from OpenAI are considerably slower than Claude's

gsabran
gsabran previously approved these changes Mar 5, 2025
Copy link
Owner

@gsabran gsabran left a comment

Choose a reason for hiding this comment

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

LGTM, some nits

process.arguments = ["-c", "source ~/.zshrc && printenv"]
// Those are loaded for interactive login shell by zsh:
// https://www.freecodecamp.org/news/how-do-zsh-configuration-files-work/
process.arguments = ["-c", "source ~/.zshenv; source ~/.zprofile; source ~/.zshrc; source ~/.zshrc; printenv"]
Copy link
Owner

Choose a reason for hiding this comment

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

nit: below I think looking for last instead of first is more correct, in the unexpected case sourcing one of those file was also printing the PATH. ie

if let path = env?.split(separator: "\n").filter({ $0.starts(with: "PATH=") }).last {

Co-authored-by: Guillaume Sabran <sabranguillaume@gmail.com>
jamesrochabrun and others added 2 commits March 5, 2025 13:29
Co-authored-by: Guillaume Sabran <sabranguillaume@gmail.com>
@jamesrochabrun jamesrochabrun requested a review from gsabran March 5, 2025 21:34
gsabran
gsabran previously approved these changes Mar 5, 2025
Co-authored-by: Guillaume Sabran <sabranguillaume@gmail.com>
gsabran
gsabran previously approved these changes Mar 5, 2025
gsabran
gsabran previously approved these changes Mar 5, 2025
gsabran
gsabran previously approved these changes Mar 6, 2025
gsabran
gsabran previously approved these changes Mar 6, 2025
@gsabran gsabran merged commit 001947d into gsabran:main Mar 6, 2025
2 checks passed
@gsabran
Copy link
Owner

gsabran commented Mar 6, 2025

Thanks a lot @jamesrochabrun !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants