Skip to content

Commit 3159389

Browse files
committed
docs(server): Update README.md with new server configuration examples
1 parent 2f166d2 commit 3159389

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ Just put this one line code in your `main` method:
2323
// You can use this annotation to specify the base package
2424
// to scan for MCP resources, prompts, tools, but it's optional.
2525
// If not specified, it will scan the package where the main method is located.
26-
@McpComponentScan(basePackage = "com.github.codeboyzhou.mcp.examples")
26+
@McpComponentScan(basePackage = "com.github.codeboyzhou.mcp.server.examples")
2727
public class MyMcpServer {
2828

2929
public static void main(String[] args) {
3030
// Start a STDIO MCP server
31-
McpServers.run(MyMcpServer.class, args).startSyncStdioServer("mcp-server", "1.0.0");
31+
McpServers.run(MyMcpServer.class, args).startSyncStdioServer(
32+
McpServerInfo.builder().name("mcp-server").version("1.0.0").build()
33+
);
3234
// or a HTTP SSE MCP server
33-
McpServers.run(MyMcpServer.class, args).startSyncSseServer("mcp-server", "1.0.0");
35+
McpServers.run(MyMcpServer.class, args).startSyncSseServer(
36+
McpSseServerInfo.builder().name("mcp-server").version("1.0.0").port(8080).build()
37+
);
3438
}
3539

3640
}

0 commit comments

Comments
 (0)