Skip to content

BinarCode/restify-demo

Repository files navigation

Laravel Restify Demo

A demonstration repository showcasing the capabilities of Laravel Restify - a unified API layer for both humans and AI agents.

About This Demo

This repository demonstrates how Laravel Restify transforms your Eloquent models into powerful APIs that serve both traditional JSON:API endpoints and MCP (Model Context Protocol) servers for AI agents - all from one codebase.

What's Included

  • User Management - Complete CRUD operations for users
  • Organization Management - Hierarchical organization structure
  • Contact Management - Contact records with relationships
  • Authentication - Laravel Sanctum integration
  • MCP Server - AI agent compatibility out of the box

Features Demonstrated

  • JSON:API Endpoints - Full specification compliance
  • MCP Server Generation - Automatic AI agent interfaces
  • Unified Authorization - Same policies for humans and AI
  • Search & Filtering - Powerful query capabilities
  • Field Validation - Consistent rules across interfaces
  • Relationships - Complex model relationships

Quick Start

  1. Clone and Install

    git clone https://github.com/BinarCode/restify-demo.git cd restify-demo composer install
  2. Setup Environment

    cp .env.example .env php artisan key:generate php artisan migrate --seed
  3. Serve the Application

    php artisan serve
  4. Explore the APIs

    • JSON:API: http://localhost:8000/api/restify/users
    • MCP Server: http://localhost:8000/mcp/restify

API Examples

For Humans (JSON:API)

# Get all users GET /api/restify/users # Create a user POST /api/restify/users Content-Type: application/vnd.api+json { "data": { "type": "users", "attributes": { "name": "John Doe", "email": "john@example.com" } } }

For AI Agents (MCP)

The same repositories automatically provide MCP tools for AI agents:

# Get available tools GET /mcp/restify # AI agents can use tools like: # - users-index-tool # - users-store-tool # - organizations-index-tool # - contacts-index-tool

Learn More

Contributing

This is a demo repository. For contributing to Laravel Restify itself, please visit the main repository.

License

This demo is open-sourced software licensed under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages