cleaniquecoders/laravel-mcp-kit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cleaniquecoders/laravel-mcp-kit

Composer 安装命令:

composer require cleaniquecoders/laravel-mcp-kit

包简介

A Laravel MCP starter kit: a task-management MCP server distilled from production patterns, with token and OAuth 2.1 auth.

README 文档

README

Latest Version Tests License Total Downloads PHP Version

A reusable starter package for adding a Model Context Protocol (MCP) server to your Laravel projects, built on the official laravel/mcp package. It ships a small task-management domain as a working reference and gives you, ready to copy or extend, the patterns a production MCP server needs.

Features

  • Tools (read + write), Resources (read-by-URI context), and Prompts (reusable templates)
  • A generic ops toolboxwhoami/abilities, system_health, logs (tail/search/export), failed-jobs + queue + scheduler, and — when the packages are present — audits, MCP token management, RBAC, and activity. See the catalogue.
  • Opt-in by presence — Tier-2 tools auto-register only when their backing package (and table) exist
  • Per-tool authorization via Gate abilities — MCP is a third UI, never a back door
  • uuid-only inputs/outputs — the internal auto-increment id never leaks to the agent
  • Write tools funnel through Action classes — the agent, web UI, and CLI share one rule set
  • STDIO (local) and Streamable HTTP (remote) transports
  • Two HTTP auth methods — Sanctum personal access tokens and OAuth 2.1 (Passport) — on one endpoint
  • Honest annotations (#[IsReadOnly]) so clients know which tools change state and gate them
  • A runtime on/off toggle, a mcp-kit:doctor wiring check, and gate-first generators (mcp-kit:make-tool / make-resource / make-prompt)

Preview

A publishable MCP settings & operations page (#16) — flip the runtime toggle and review system health, the effective config, mcp-kit:doctor results, and the live tool registry, all gated on manage-mcp. Publish it with php artisan mcp-kit:install --ui (Livewire + Flux), or preview it build-free in the workbench (composer serve/mcp, see Workbench).

MCP settings — runtime toggle and system health

Requirements

  • PHP 8.4+
  • Laravel 11, 12, or 13
  • laravel/mcp ^0.8

Installation

composer require cleaniquecoders/laravel-mcp-kit
php artisan mcp-kit:install   # publishes config + migration (add --oauth to wire OAuth 2.1)
php artisan migrate

Abilities

Every tool checks a Gate ability. The kit ships the ability names (in config('mcp-kit.abilities')); your app decides who holds each, mapping them onto its permission system (Gate::define, a Policy, or spatie/laravel-permission) — see Installation. whoami and list_my_abilities need only an authenticated user.

MCP Kit abilities — the gate each tool checks

Quick Start

php artisan mcp-kit:demo                          # seed demo tasks
claude mcp add mcp-kit -- php artisan mcp:start mcp-kit   # connect over STDIO

Set MCP_KIT_LOCAL_USER to the email the local transport should act as. See Quick Start for HTTP and OAuth.

Documentation

Full documentation lives in docs/:

Section Contents
Getting Started Installation, gates, first call
Architecture What the server exposes and the conventions
Authentication Connecting clients; Sanctum and OAuth 2.1
Configuration config/mcp-kit.php and MCP_KIT_* reference
Development Testbench Workbench and testing
Deployment Running the OAuth transport in production

Testing

composer test

Changelog

See CHANGELOG.md for recent changes.

License

MIT. © Nasrul Hazim / CleaniqueCoders. See LICENSE.md.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-17