
# Swift: FoundationModel With MCP

A demo of connecting to MCP servers and using MCP Tools with FoundationModels.

Specifically, this repository includes
1. Connect to remote MCP Servers 
2. List the tools available
3. Convert the MCP tools to Foundation Models Tools by Creating dynamic generation schema based on JSON schema on the runtime
3. Call tools on MCP Server based on the arguments generated

For more details, please refer to my article [Swift: Power Foundation Models With MCP Servers (Tools)](https://medium.com/@itsuki.enjoy/swift-power-foundation-models-with-mcp-servers-tools-0acc969aceb8)


![](./demo.gif)
