EDGE FDE
IntermediateTalk to tools with MCP
Plug new tools into your Apple AI app without rewriting the chat loop.
Raw JSON-RPC MCP server and client mapped into Foundation Models Tool types.
Speak MCP in Swift. Keep LanguageModelSession as the chat loop. iOS 27 and macOS 27 only.
Lessons
Key concepts
- MCP lists and calls tools over JSON-RPC 2.0 at runtime.
- Foundation Models
Tooltypes are compile-time. Your bridge joins the two. LanguageModelSessionstays the chat loop.- On iOS 27 use an in-process Swift actor or XPC. There is no built-in Apple MCP adapter.
Takeaways
- You can plug new tools into an Apple AI app without rewriting the chat loop.
- You can speak MCP in Swift and keep
session.respond(to:)as the only chat entry point. - Your bridge is the only join between the model and the server.
Agent briefs
Related courses
Run tools in a safe box · Stop prompt attacks and leaks · Make several agents agree first · Core AI vs Core ML vs MLX