diff --git a/README.md b/README.md index 69218c6..d278225 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,10 @@ This package handles: ```bash composer require php-mcp/laravel ``` -2. The `LaravelMcpServiceProvider` will be automatically discovered and registered by Laravel. +2. The `McpServiceProvider` will be automatically discovered and registered by Laravel. 3. Publish the configuration file: ```bash - php artisan vendor:publish --provider="PhpMcp\Laravel\Server\LaravelMcpServiceProvider" --tag="mcp-config" + php artisan vendor:publish --provider="PhpMcp\Laravel\Server\McpServiceProvider" --tag="mcp-config" ``` This will create a `config/mcp.php` file where you can customize the server's behavior. @@ -64,7 +64,7 @@ The primary way to configure the MCP server in Laravel is through the `config/mc ### Defining MCP Elements -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.). +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]`). Place these classes in a directory included in the `discovery.directories` config array (e.g., `app/Mcp/MyTools.php`). @@ -98,8 +98,8 @@ class MyTools } ``` -* **Dependency Injection:** Your classes' constructors will be resolved using Laravel's service container, so you can inject any application dependencies (like the `LoggerInterface` above). -* **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. +* **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). +* **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. ### Automatic Discovery (Development) vs. Manual Discovery (Production) @@ -249,4 +249,4 @@ The MIT License (MIT). Please see [License File](LICENSE) for more information. ## Support & Feedback -Please open an issue on the [GitHub repository](https://github.com/php-mcp/laravel) for bugs, questions, or feedback. \ No newline at end of file +Please open an issue on the [GitHub repository](https://github.com/php-mcp/laravel) for bugs, questions, or feedback. diff --git a/src/Commands/ListCommand.php b/src/Commands/ListCommand.php index cacba79..45b7daf 100644 --- a/src/Commands/ListCommand.php +++ b/src/Commands/ListCommand.php @@ -33,7 +33,7 @@ class ListCommand extends Command */ public function handle(Registry $registry): int { - $registry->loadElements(); // Ensure elements are loaded + $registry->loadElementsFromCache(); // Ensure elements are loaded $type = $this->argument('type'); $outputJson = $this->option('json');