Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
asyrafhussin avatar

Laravel Mcp

  • 177 installs
  • 60 repo stars
  • Updated May 16, 2026
  • asyrafhussin/agent-skills

laravel-mcp is a skill for building MCP (Model Context Protocol) servers with Laravel that expose tools, prompts, and resources to AI clients.

About

This skill guides building MCP (Model Context Protocol) servers with Laravel to expose tools, prompts, and resources to AI clients. It contains 7 rules across 5 categories covering server creation, tools, prompts, resources, authentication, and testing. Developers use it when building MCP servers or tools for AI client integration, including protecting them with OAuth or Sanctum.

  • Build MCP (Model Context Protocol) servers with Laravel
  • 7 rules across 5 categories: servers, tools, prompts/resources, auth, testing
  • Covers exposing tools, prompts, and resources to AI clients with OAuth/Sanctum

Laravel Mcp by the numbers

  • 177 all-time installs (skills.sh)
  • Ranked #3,076 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
At a glance

laravel-mcp capabilities & compatibility

Capabilities
mcp server building · agent building · api development
Use cases
api development · orchestration
Runs
Local or remote
Pricing
Free
From the docs

What laravel-mcp says it does

Comprehensive guide for building MCP (Model Context Protocol) servers with Laravel. Contains 7 rules across 5 categories for exposing tools, prompts, and resources to AI clients.
SKILL.md
Protect servers with OAuth 2.1, Sanctum, or custom auth
SKILL.md
npx skills add https://github.com/asyrafhussin/agent-skills --skill laravel-mcp

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs177
repo stars60
Last updatedMay 16, 2026
Repositoryasyrafhussin/agent-skills

What it does

Build a Laravel MCP server exposing tools, prompts, and resources to AI clients, with auth and MCP Inspector testing.

Who is it for?

Laravel developers building MCP servers and tools for AI clients

Skip if: Non-Laravel MCP implementations or non-MCP APIs

When should I use this skill?

Building MCP servers, tools, prompts, or resources for AI client integration in Laravel

What you get

A Laravel MCP server exposes well-schemaed tools, prompts, and resources with proper auth and tests.

  • Laravel MCP server
  • MCP tools with schemas
  • auth-protected endpoints

By the numbers

  • 7 rules across 5 categories
  • 5 rule categories by priority

Files

SKILL.mdMarkdownGitHub ↗

Laravel MCP

Comprehensive guide for building MCP (Model Context Protocol) servers with Laravel. Contains 7 rules across 5 categories for exposing tools, prompts, and resources to AI clients.

When to Apply

Reference these guidelines when:

  • Creating MCP servers (web or local)
  • Building tools that AI clients can call
  • Defining prompts for reusable AI interactions
  • Exposing resources for AI context
  • Protecting MCP servers with OAuth or Sanctum
  • Testing MCP servers, tools, prompts, and resources

Rule Categories by Priority

PriorityCategoryImpactPrefix
1ServersCRITICALserver-
2ToolsHIGHtool-
3Prompts & ResourcesMEDIUMprompt-, resource-
4AuthenticationHIGHauth-
5TestingHIGHtest-

Quick Reference

1. Servers (CRITICAL)

  • server-create-register - Create and register web or local MCP servers

2. Tools (HIGH)

  • tool-create - Create tools with input/output schemas, DI, and annotations
  • tool-responses - Text, error, structured, streaming, and multi-content responses

3. Prompts & Resources (MEDIUM)

  • prompt-create - Create prompts with arguments, validation, and responses
  • resource-create - Create resources and resource templates with URI patterns

4. Authentication (HIGH)

  • auth-protect - Protect servers with OAuth 2.1, Sanctum, or custom auth

5. Testing (HIGH)

  • test-unit - Test with MCP Inspector and unit tests

Essential Patterns

Creating an MCP Server

<?php

namespace App\Mcp\Servers;

use Laravel\Mcp\Server;
use Laravel\Mcp\Server\Attributes\Instructions;
use Laravel\Mcp\Server\Attributes\Name;
use Laravel\Mcp\Server\Attributes\Version;

#[Name('Weather Server')]
#[Version('1.0.0')]
#[Instructions('This server provides weather information.')]
class WeatherServer extends Server
{
    protected array $tools = [
        CurrentWeatherTool::class,
    ];

    protected array $resources = [];

    protected array $prompts = [];
}

Registering in routes/ai.php

use App\Mcp\Servers\WeatherServer;
use Laravel\Mcp\Facades\Mcp;

Mcp::web('/mcp/weather', WeatherServer::class);
Mcp::local('weather', WeatherServer::class);

Creating a Tool

<?php

namespace App\Mcp\Tools;

use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Mcp\Request;
use Laravel\Mcp\Response;
use Laravel\Mcp\Server\Attributes\Description;
use Laravel\Mcp\Server\Tool;

#[Description('Fetches the current weather for a location.')]
class CurrentWeatherTool extends Tool
{
    public function handle(Request $request): Response
    {
        $location = $request->get('location');

        return Response::text("The weather in {$location} is sunny, 72°F.");
    }

    public function schema(JsonSchema $schema): array
    {
        return [
            'location' => $schema->string()
                ->description('The location to get the weather for.')
                ->required(),
        ];
    }
}

How to Use

Read individual rule files for detailed explanations and code examples.

Each rule file contains:

  • YAML frontmatter with metadata (title, impact, tags)
  • Brief explanation of why it matters
  • Bad Example with explanation
  • Good Example with explanation
  • Laravel 13 and PHP 8.3 specific context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Related skills

FAQ

How is an MCP server registered?

In routes/ai.php with Mcp::web('/mcp/weather', WeatherServer::class) or Mcp::local('weather', WeatherServer::class).

How are servers protected?

With OAuth 2.1, Sanctum, or custom auth via the auth-protect rule.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.