Skip to content

Commit d4b62ae

Browse files
committed
Fix the errors in the Readme
Update the Readme to reflect the correct usage of the `@MCPServer` macro. * Change the instruction to attach the `@MCPServer` macro to a reference type like class or actor. * Update the example to show attaching the `@MCPServer` macro to a class. * Remove the incorrect instruction to "Create a class conforming to `MCPServer`". --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Cocoanetics/SwiftMCP?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent eaafbbc commit d4b62ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ The `--openapi` option enables OpenAPI endpoints for AI plugin integration. When
5959

6060
To implement your own MCP server:
6161

62-
1. Create a class conforming to `MCPServer`
62+
1. Attach the `@MCPServer` macro to a reference type like class or actor
6363
2. Define your tools using `@MCPTool` attribute
6464
3. Choose and configure a transport
6565

6666
Example:
6767

6868
```swift
69-
class MyServer: MCPServer {
69+
@MCPServer
70+
class MyServer {
7071
@MCPTool
7172
func add(a: Int, b: Int) -> Int {
7273
return a + b

0 commit comments

Comments
 (0)