@@ -22,6 +22,7 @@ Just put this one line code in your `main` method:
22
22
``` java
23
23
// You can use this annotation to specify the base package
24
24
// to scan for MCP resources, prompts, tools, but it's optional.
25
+ // If not specified, it will scan the package where the main method is located.
25
26
@McpComponentScan (basePackage = " com.github.codeboyzhou.mcp.examples" )
26
27
public class MyMcpServer {
27
28
@@ -42,7 +43,7 @@ No need to care about the low-level details of native MCP Java SDK and how to cr
42
43
public class MyMcpResources {
43
44
44
45
// This method defines a MCP resource to expose the OS env variables
45
- @McpResource (uri = " env://variables" , name = " env " , description = " OS env variables" )
46
+ @McpResource (uri = " env://variables" , description = " OS env variables" )
46
47
public String getSystemEnv () {
47
48
// Just put your logic code here, forget about the MCP SDK details.
48
49
return System . getenv(). toString();
@@ -57,7 +58,7 @@ public class MyMcpResources {
57
58
public class MyMcpTools {
58
59
59
60
// This method defines a MCP tool to read a file
60
- @McpTool (name = " read_file " , description = " Read complete file contents with UTF-8 encoding" )
61
+ @McpTool (description = " Read complete file contents with UTF-8 encoding" )
61
62
public String readFile (
62
63
@McpToolParam (name = " path" , description = " filepath" , required = true ) String path ) {
63
64
// Just put your logic code here, forget about the MCP SDK details.
0 commit comments