Skip to content

Commit 2c23af7

Browse files
committed
docs(README): Clarify MCP resource and tool annotations
1 parent 90ec64f commit 2c23af7

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
@@ -22,6 +22,7 @@ Just put this one line code in your `main` method:
2222
```java
2323
// You can use this annotation to specify the base package
2424
// 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.
2526
@McpComponentScan(basePackage = "com.github.codeboyzhou.mcp.examples")
2627
public class MyMcpServer {
2728

@@ -42,7 +43,7 @@ No need to care about the low-level details of native MCP Java SDK and how to cr
4243
public class MyMcpResources {
4344

4445
// 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")
4647
public String getSystemEnv() {
4748
// Just put your logic code here, forget about the MCP SDK details.
4849
return System.getenv().toString();
@@ -57,7 +58,7 @@ public class MyMcpResources {
5758
public class MyMcpTools {
5859

5960
// 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")
6162
public String readFile(
6263
@McpToolParam(name = "path", description = "filepath", required = true) String path) {
6364
// Just put your logic code here, forget about the MCP SDK details.

0 commit comments

Comments
 (0)