Skip to content

Commit 202b95d

Browse files
docs: Update README.md to clarify MCP element definition and usage of invokable classes
1 parent d125181 commit 202b95d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The primary way to configure the MCP server in Laravel is through the `config/mc
6464

6565
### Defining MCP Elements
6666

67-
Define your MCP Tools, Resources, and Prompts as methods within PHP classes, decorated with attributes from the `php-mcp/server` package (`#[McpTool]`, `#[McpResource]`, `#[McpPrompt]`, etc.).
67+
Define your MCP Tools, Resources, and Prompts by decorating methods **or invokable classes** with attributes from the `php-mcp/server` package (`#[McpTool]`, `#[McpResource]`, `#[McpPrompt]`, `#[McpResourceTemplate]`).
6868

6969
Place these classes in a directory included in the `discovery.directories` config array (e.g., `app/Mcp/MyTools.php`).
7070

@@ -98,8 +98,8 @@ class MyTools
9898
}
9999
```
100100

101-
* **Dependency Injection:** Your classes' constructors will be resolved using Laravel's service container, so you can inject any application dependencies (like the `LoggerInterface` above).
102-
* **Attribute Usage:** Refer to the [`php-mcp/server` README](https://github.com/php-mcp/server/blob/main/README.md#defining-mcp-elements-with-attributes) for detailed information on defining elements and formatting return values.
101+
* **Dependency Injection:** Your classes' constructors (or invokable classes) will be resolved using Laravel's service container, so you can inject any application dependencies (like the `LoggerInterface` above).
102+
* **Attribute Usage:** Refer to the [`php-mcp/server` README](https://github.com/php-mcp/server/blob/main/README.md#attributes-for-discovery) for detailed information on defining elements (both on methods and invokable classes) and formatting return values.
103103

104104
### Automatic Discovery (Development) vs. Manual Discovery (Production)
105105

0 commit comments

Comments
 (0)