BinarCode/laravel-restify

Laravel API for Ai Agents and humans.

What it solves

Laravel Restify provides a unified way to build APIs that serve both human developers and AI agents simultaneously. It eliminates the need to write separate implementations for standard REST APIs and AI-specific interfaces, ensuring that authentication, authorization, and validation rules remain consistent across all consumers.

How it works

The package turns Eloquent models into API endpoints by using a repository-based definition. By defining a repository class with specific fields and rules, the system automatically generates:

  • JSON:API Endpoints: Fully compliant REST endpoints for traditional applications.
  • MCP Servers: Model Context Protocol (MCP) servers that provide tool definitions and capabilities for AI agents to interact with the data.
  • GraphQL Schemas: Auto-generated schemas for flexible data querying.

Who it’s for

Laravel developers who want to expose their application data to AI agents via the Model Context Protocol (MCP) without sacrificing standard REST API functionality.

Highlights

  • Unified Codebase: One repository definition serves as the source of truth for REST, MCP, and GraphQL.
  • Automatic Tool Generation: AI agents receive structured tool definitions automatically based on the model fields.
  • Consistent Security: Integrates with Laravel Sanctum and Laravel policies to apply the same security rules to both humans and AI.
  • Powerful Querying: Built-in support for search, filtering, and pagination across all interfaces.

Related

  • Project
  • Project
  • Project
  • Project
  • Project