mcp-swift-example-server

mcp-swift-example-server

3.2

If you are the rightful owner of mcp-swift-example-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This is a basic example demonstrating how to create a simple server that communicates over standard input/output (stdio) using the Model Context Protocol Swift SDK.

The MCP Swift Example Server is a simple server setup that uses the Model Context Protocol (MCP) Swift SDK to communicate over standard input/output (stdio). It is designed to be compatible with applications like Claude Desktop. The server demonstrates the setup of a basic MCP server, the definition and registration of a custom tool, and the handling of `ListTools` and `CallTool` requests. It uses `StdioTransport` for communication and provides detailed logging to stderr. The server can be integrated with Claude Desktop by configuring the `claude_desktop_config.json` file to include the server as a tool provider. The project requires macOS 13 or later and Swift 5.9 or later.

Features

  • Setting up a basic MCP server
  • Defining and registering a custom tool (`swift_echo`)
  • Handling `ListTools` and `CallTool` requests
  • Using `StdioTransport` for communication
  • Detailed logging to stderr