Skip to content

Commit 6146ab4

Browse files
committed
update docs
1 parent f662472 commit 6146ab4

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Laravel MCP
1+
# 🤖 Laravel MCP
22

33
## Introduction
4-
Laravel MCP gives you everything you need to build Laravel-powered MCP servers and let AI talk to your app.
4+
Laravel MCP gives you everything you need to build Laravel-powered MCP servers and let AI talk to your apps.
55

66
## Installation
77

@@ -21,21 +21,21 @@ The package will automatically register MCP server defined in this file.
2121

2222
## Quickstart
2323

24-
First, create a new server class using the `mcp:server` Artisan command:
24+
First, create a new MCP server using the `mcp:server` Artisan command:
2525

2626
```bash
2727
php artisan mcp:server DemoServer
2828
```
2929

30-
Next, create a "hello" tool:
30+
Next, create a tool for the MCP server:
3131

3232
```bash
3333
php artisan mcp:tool HelloTool
3434
```
3535

3636
This will create two files: `app/Mcp/Servers/DemoServer.php` and `app/Mcp/Tools/HelloTool.php`.
3737

38-
Open `app/Mcp/Tools/HelloTool.php` and replace its contents with the following code to create a simple tool that greets a user:
38+
Open `app/Mcp/Tools/HelloTool.php` and replace its contents with the following code to create a simple tool that greets the user:
3939

4040
```php
4141
<?php
@@ -60,14 +60,17 @@ class HelloTool extends Tool
6060

6161
public function schema(ToolInputSchema $schema): ToolInputSchema
6262
{
63-
$schema->string('name')->description('The name to greet.');
63+
$schema
64+
->string('name')
65+
->description('The name to greet.')
66+
->required();
6467

6568
return $schema;
6669
}
6770

6871
public function handle(array $arguments): ToolResult
6972
{
70-
$name = $arguments['name'] ?? 'World';
73+
$name = $arguments['name'];
7174

7275
return ToolResult::text("Hello, {$name}!");
7376
}
@@ -101,7 +104,7 @@ use Laravel\Mcp\Facades\Mcp;
101104
Mcp::local('demo', DemoServer::class);
102105
```
103106

104-
Finally, you can run your server and explore it with the MCP Inspector:
107+
Finally, you can run your server and explore it with the MCP Inspector tool:
105108

106109
```bash
107110
php artisan mcp:inspector demo

0 commit comments

Comments
 (0)