SwiftMCP

@compiler-inc Claim

Basic information

Runtime
swift
Category
License
Not specified
Author
compiler-inc
Submitted by
Community
Quality
40
Stars
30

About SwiftMCP

# SwiftMCP\n\nA Swift Package that implements an MCP (Model Context Protocol) client for iOS and macOS, enabling native API integration through a JSON-RPC interface. The package also includes an OpenAI-compatible function calling bridge.\n\n## Features\n\n- Open source function definitions for Apple's native APIs like HealthKit\n- JSON-RPC 2.0 compliant interface\n- Some test coverage\n\n## Requirements\n\n- iOS 15.0+ / macOS 12.0+\n- Swift 6.0+\n- Xcode 15.0+\n\n## Installation\n\n### Swift Package Manager\n\nAdd the following dependency to your `Package.swift` file:\n\n```swift\ndependenc...

SwiftMCP is a MCP client in the Agent Framework category listed in the AddMCP.net directory, published by compiler-inc. Runtime: swift. The repository has 30 GitHub stars. Source code is hosted on github.com.

SwiftMCP config

No standard config provided

This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.

Repository

SwiftMCP tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is SwiftMCP?

SwiftMCP is a Swift Package that implements an MCP (Model Context Protocol) client for iOS and macOS, enabling native API integration through a JSON‑RPC interface. It also includes an OpenAI‑compatible function calling bridge, allowing LLMs to invoke Apple’s native APIs (e.g., HealthKit) directly from Swift applications.

How to use SwiftMCP?

Install the package via Swift Package Manager with the dependency https://github.com/compiler-inc/SwiftMCP.git from version 1.0.0. Create a ToolRegistry and MCPClient, register tools (like HealthKitTool), and send JSON‑RPC requests. For OpenAI integration, use OpenAIToolRegistry to convert MCP tools into OpenAI function definitions. For on‑device usage, use MLXToolRegistry together with an MLX model loaded via MLXModelFactory.

Key features of SwiftMCP

  • Open source function definitions for Apple’s native APIs such as HealthKit
  • JSON‑RPC 2.0 compliant interface
  • OpenAI‑compatible function calling bridge
  • On‑device MLX function calling (supports Mistral, Llama, and Phi models)
  • Custom tool creation with the MCPTool protocol
  • Some test coverage

Use cases of SwiftMCP

  • Integrate HealthKit step count and workout data into LLM‑powered conversational agents
  • Enable an on‑device AI assistant to query health metrics without sending data to external APIs
  • Build custom MCP tools that expose any iOS/macOS native capability to a language model
  • Combine multiple LLM backends (OpenAI and local MLX) within a single app

Frequently asked questions

1 What platforms and Swift versions does SwiftMCP support?

SwiftMCP requires iOS 15.0+ / macOS 12.0+, Swift 6.0+, and Xcode 15.0+.

2 Does SwiftMCP include an actual MCP server?

No, SwiftMCP is a client library. It provides the MCPClient, tool registry, and bridges to connect to LLMs (via OpenAI or local MLX). The package does not include a server implementation.

3 Which MCP servers are supported?

The README does not list specific external MCP servers. The package is designed to handle JSON‑RPC requests from any compatible source (e.g., an OpenAI‑powered chat loop or a local MLX model). It does not yet detail integration with other MCP server implementations.

4 Is SwiftMCP free and open source?

Yes, the project is licensed under the MIT License and the code is publicly available on GitHub.

5 What are the current limitations of SwiftMCP?

The README notes that only “some test coverage” is present, and the goal is to add as many iOS APIs as possible. Currently only HealthKit tools are documented; other Apple APIs are not yet implemented.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬