File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff 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" )
2727public 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}
You can’t perform that action at this time.
0 commit comments