MCP.so
登录

MCP Swift Example Server

@devyhan

基本信息

分类

其他

许可证

MIT license

传输方式

stdio

作者

devyhan

关于 MCP Swift Example Server

Example MCP(Model Context Protocol) Server Impl

#mcp#swift#example-server

MCP Swift Example Server 配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

MCP Swift Example Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Swift Example Server?

A basic example server demonstrating how to create a simple Model Context Protocol (MCP) server using the Swift MCP SDK. It communicates over standard input/output (stdio) and is compatible with applications like Claude Desktop.

How to use MCP Swift Example Server?

Clone the repository, build with swift build -c release, then add the absolute path to the compiled executable to your claude_desktop_config.json under mcpServers. An optional client example is available in the Examples directory.

Key features of MCP Swift Example Server

  • Sets up a basic MCP server using the Swift SDK
  • Defines and registers a custom tool (swift_echo)
  • Handles ListTools and CallTool requests
  • Uses StdioTransport for communication
  • Detailed logging to stderr

Use cases of MCP Swift Example Server

  • Learning how to build an MCP server in Swift
  • Testing the MCP protocol with a simple echo tool
  • Integrating custom tools into Claude Desktop
  • Experimenting with the Swift MCP SDK

常见问题

1

What are the runtime requirements?

macOS 13 or later and Swift 5.9 or later are required.

2

How does the server communicate?

It communicates over standard input/output (stdio) using the `StdioTransport`.

3

What tool does this server provide?

It provides a single tool named `swift_echo`, which echoes input back to the caller.

4

How do I configure Claude Desktop to use this server?

Add an entry to your `claude_desktop_config.json` with the server name and the absolute path to the compiled executable as the command.

5

Where is the source code located?

The project structure includes `main.swift` (entry point), `MCPServer` (protocol implementation), and `EchoToolbox` (tool provider).

评论

其他 分类下的更多 MCP 服务器