mcp-swift-example-server

mcp-swift-example-server

0

The MCP Swift Example Server demonstrates a simple way to create and run an MCP server using the Swift SDK. It is designed to interface with applications like Claude Desktop, highlighting how to set up servers and client communication using the Model Context Protocol.

MCP Swift Example Server

Basic Stdio Example

A simple server using Model Context Protocol and Swift SDK, compatible with applications like Claude Desktop.

Features

  • Basic MCP server setup
  • Custom tool registration (swift_echo)
  • ListTools and CallTool requests
  • StdioTransport for communication
  • Detailed logging

Getting Started

  • Clone and build the server
  • Configure Claude Desktop to use as a tool provider
  • Example client implementation available in Examples directory

Requirements

  • macOS 13 or later
  • Swift 5.9 or later

Project Structure

  • main.swift: Server entry point
  • MCPServer: MCP protocol implementation
  • EchoToolbox: Echo tool implementation