MCP Swift Example Server

MCP Swift Example Server

mcp-swift-example-server•bydevyhan

A basic example MCP server written in Swift that communicates over stdio and registers a custom echo tool.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Sets up a basic MCP server using the Model Context Protocol Swift SDK.
  • •Defines and registers a custom tool named swift_echo.
  • •Handles ListTools and CallTool requests.
  • •Uses StdioTransport for communication and logs to stderr.

BEST FOR

  • •Developers learning how to build a minimal MCP server in Swift.
  • •Using a simple MCP echo tool with MCP-compatible applications such as Claude Desktop.

ABOUT MCP-SWIFT-EXAMPLE-SERVER

MCP Swift Example Server is cataloged as an MCP server attributed to devyhan. A basic example MCP server written in Swift that communicates over stdio and registers a custom echo tool. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Swift Example Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What tool does this example server provide?

It defines and registers a custom tool called swift_echo.

How does the server communicate?

It communicates over standard input/output using StdioTransport.

Upstream README

View this exact version on GitHub

README.md · c7396717a011 · Fetched 2026-11-13 11:55:28 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MCP Swift Example Server

Basic Stdio Example

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. This setup is compatible with applications like Claude Desktop.

Features

This simple server demonstrates:

  • 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

Getting Started

Running the Echo Server

  1. Clone this repository:
git clone https://github.com/devyhan/mcp-swift-example-server.git
cd mcp-swift-example-server
  1. Build the server:
swift build -c release

This will create the executable at .build/release/macros-mcp-example-server. Note the full path to this executable.

Configure Claude Desktop

To make this server available as a tool provider in Claude Desktop, you need to add it to your Claude Desktop configuration file (claude_desktop_config.json). The location of this file varies by operating system.

Add an entry like the following to the mcpServers object in your claude_desktop_config.json, replacing /PATH/TO/YOUR/SERVER/ with the actual absolute path to the repository directory on your system:

{
    "mcpServers": {
        // ... other servers maybe ...
        "swift_echo_example": {
            "command": "/PATH/TO/YOUR/SERVER/mcp-swift-example-server/.build/release/macros-mcp-example-server"
        }
        // ... other servers maybe ...
    }
}
  • swift_echo_example: This is the name you'll refer to the server by within Claude Desktop (you can change this).
  • command: This must be the absolute path to the compiled executable you built in the previous step.

Client Example

The Examples directory contains a simple client implementation that demonstrates how to communicate with the MCP server:

# First start the server in one terminal:
swift run

# Then in another terminal, run the client example:
cd Examples
swift SimpleClient.swift

Requirements

  • macOS 13 or later
  • Swift 5.9 or later

Project Structure

  • main.swift: Entry point for the server application
  • MCPServer: MCP protocol server implementation
  • EchoToolbox: Toolbox providing the basic echo tool

License

MIT

References

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Swift Example Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-swift-example-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools