Skip to content

Commit faddf36

Browse files
committed
fix: docs
1 parent 0c578e6 commit faddf36

File tree

4 files changed

+121
-2374
lines changed

4 files changed

+121
-2374
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,31 @@ DELETE: http://laravel.test/api/restify/dreams/1
7777

7878
## 🤖 AI-Powered Development with MCP
7979

80-
Laravel Restify now includes **Model Context Protocol (MCP)** integration, enabling seamless AI agent interactions with your API resources. This powerful feature allows AI agents to understand, query, and manipulate your data through structured tool interfaces.
80+
Transform your existing Laravel Restify API into an **MCP-enabled powerhouse in minutes**! Laravel Restify's Model Context Protocol integration allows AI agents to interact directly with your API resources through structured tool interfaces.
8181

82-
> **🔥 New!** MCP support enables AI agents to work directly with your Laravel Restify APIs, providing intelligent data access, automated operations, and enhanced development workflows.
82+
> **🔥 Transform Your API in Minutes!** Add one trait to your Repository class and register one route - that's it! Your entire API becomes AI-agent accessible with full security and authorization intact.
8383
84-
**Key MCP Features:**
85-
- **AI Agent Integration**: Connect Claude, GPT, and other AI agents directly to your APIs
86-
- **Structured Tool Interfaces**: Automatically generated tools for CRUD operations
87-
- **Security & Authorization**: Full Laravel authorization integration maintained
88-
- **Developer MCP Server**: Dedicated server for enhanced Laravel Restify development
84+
**Quick Setup (2 steps):**
85+
86+
1. **Add the trait to your Repository:**
87+
```php
88+
use Binaryk\LaravelRestify\MCP\Concerns\HasMcpTools;
89+
90+
class PostRepository extends Repository
91+
{
92+
use HasMcpTools; // ✨ This enables MCP for this resource
93+
}
94+
```
95+
96+
2. **Register the MCP server in `routes/ai.php`:**
97+
```php
98+
use Laravel\Mcp\Facades\Mcp;
99+
use Binaryk\LaravelRestify\MCP\RestifyServer;
100+
101+
Mcp::web('restify', RestifyServer::class)->middleware(['auth:sanctum']);
102+
```
103+
104+
**That's it!** Your API is now AI-agent ready with automatic tool generation for CRUD operations, actions, and getters.
89105

90106
## MCP Server for Developers
91107

docs-v2/content/en/index.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,35 @@ This documentation is for the latest version of Laravel Restify. Please ensure y
3838

3939
## 🤖 AI-Powered Development with MCP
4040

41-
Laravel Restify now includes **Model Context Protocol (MCP)** integration, enabling seamless AI agent interactions with your API resources. This powerful feature allows AI agents to understand, query, and manipulate your data through structured tool interfaces.
41+
Transform your existing Laravel Restify API into an **MCP-enabled powerhouse in minutes**! Laravel Restify's Model Context Protocol integration allows AI agents to interact directly with your API resources through structured tool interfaces.
4242

4343
<alert type="success">
4444

45-
**🔥 New!** MCP support enables AI agents to work directly with your Laravel Restify APIs, providing intelligent data access, automated operations, and enhanced development workflows.
45+
**🔥 Transform Your API in Minutes!** Add one trait to your Repository class and register one route - that's it! Your entire API becomes AI-agent accessible with full security and authorization intact.
4646

4747
</alert>
4848

49-
**Key MCP Features:**
50-
- **AI Agent Integration**: Connect Claude, GPT, and other AI agents directly to your APIs
51-
- **Structured Tool Interfaces**: Automatically generated tools for CRUD operations
52-
- **Security & Authorization**: Full Laravel authorization integration maintained
53-
- **Developer MCP Server**: Dedicated server for enhanced Laravel Restify development
49+
**Quick Setup (2 steps):**
50+
51+
1. **Add the trait to your Repository:**
52+
```php
53+
use Binaryk\LaravelRestify\MCP\Concerns\HasMcpTools;
54+
55+
class PostRepository extends Repository
56+
{
57+
use HasMcpTools; // ✨ This enables MCP for this resource
58+
}
59+
```
60+
61+
2. **Register the MCP server in `routes/ai.php`:**
62+
```php
63+
use Laravel\Mcp\Facades\Mcp;
64+
use Binaryk\LaravelRestify\MCP\RestifyServer;
65+
66+
Mcp::web('restify', RestifyServer::class)->middleware(['auth:sanctum']);
67+
```
68+
69+
**That's it!** Your API is now AI-agent ready with automatic tool generation for CRUD operations, actions, and getters.
5470

5571
[Learn more about MCP Integration →](/mcp)
5672

docs-v2/content/en/mcp/mcp-docs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Model Context Protocol (MCP)
3+
menuTitle: MCP Docs CLI
4+
category: MCP
5+
position: 1
6+
---
7+
8+
Laravel Restify provides seamless integration with the Model Context Protocol (MCP), allowing AI agents to interact with your REST API resources through structured tool interfaces. This enables powerful AI-driven data access and manipulation while maintaining security and control.
9+
10+
## MCP Server for Laravel Restify Developers
11+
12+
In addition to MCP integration within your Laravel Restify applications, we provide a dedicated **MCP server for developers** that enhances the development experience when working with Laravel Restify APIs.
13+
14+
**Repository**: [https://github.com/BinarCode/laravel-restify-mcp](https://github.com/BinarCode/laravel-restify-mcp)
15+
16+
### Developer MCP Server Features
17+
18+
The Laravel Restify MCP server provides AI agents with powerful development tools:
19+
20+
- **📚 Documentation Access**: Query Laravel Restify documentation directly from your AI agent
21+
- **🏗️ Repository Generation**: Create new repositories with proper structure and conventions
22+
- **⚡ Action Creation**: Generate custom actions for your API resources with validation and best practices
23+
- **🔍 Getter Development**: Build custom getters for specialized data retrieval operations
24+
- **💡 Code Examples**: Get contextual code examples and implementation guidance
25+
- **🎯 Best Practices**: Receive Laravel Restify best practices and architectural guidance
26+
27+
### Installation & Setup
28+
29+
#### Install the MCP Server
30+
31+
```bash
32+
composer require --dev binarcode/laravel-restify-mcp
33+
```
34+
35+
#### Configure AI Agents
36+
37+
Configure your AI agent (Claude Desktop, Cursor, etc.) to use the MCP server:
38+
39+
```json
40+
{
41+
"mcpServers": {
42+
"laravel-restify": {
43+
"command": "laravel-restify-mcp",
44+
"args": []
45+
}
46+
}
47+
}
48+
```
49+
50+
#### Usage Examples
51+
52+
Once configured, your AI agent can help with:
53+
54+
**Creating Repositories:**
55+
```
56+
AI: Create a PostRepository with title, content, and author fields
57+
```
58+
59+
**Generating Actions:**
60+
```
61+
AI: Create a PublishPostAction that validates publish dates and notifies subscribers
62+
```
63+
64+
**Building Getters:**
65+
```
66+
AI: Generate a PostAnalyticsGetter that returns engagement metrics for date ranges
67+
```
68+
69+
**Documentation Queries:**
70+
```
71+
AI: How do I implement field validation in Laravel Restify?
72+
AI: Show me examples of custom repository authorization
73+
```

0 commit comments

Comments
 (0)