
Laravel MCP Companion
io.github.brianirish由 GitHub 账号 brianirish 发布v0.13.0更新于 Oct 24, 2026
Laravel documentation aggregator: multi-version core docs, services, packages, learning paths.
概览
Laravel 文档聚合服务器,让助手搜索、浏览并阅读多版本 Laravel 核心文档、服务文档、包文档和学习路径。
- 可以做什么
- 跨核心版本、服务、包与学习资源搜索 Laravel 文档,返回按相关度排序的章节结果并可按来源筛选
- 读取单个文档章节,列出分类,并按入门、进阶或高级难度过滤内容
- 用自然语言描述需求来查找相关文档,跟随精选学习路径并获取关联资源
- 查询精选包推荐、集成指南以及包之间的兼容性说明
- 通过更新工具刷新 Laravel 服务与社区包的文档
- 适用场景
- 适合在学习或调研 Laravel 时使用,让助手基于 Laravel 专属参考资料而非通用知识作答,包括旧版框架文档、Forge、Vapor、Nova、Envoy 文档以及常用社区包。它面向查阅与学习,而非结合项目上下文的代码生成。
- 运行要求
- 以 stdio 在本地运行,通常使用 ghcr.io 上的 Docker 镜像,需要安装 Docker。未声明账号、API 密钥或环境变量。文档随镜像一起发布,更新需拉取新镜像或启用更新选项。可选的 HTTP 模式提供主机、CORS、认证与限流参数。
安装
在 SourceWeft 中
- 打开 控制台中的 Laravel MCP Companion,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Laravel MCP Companion
formerly Laravel Docs MCP Server
[GitHub release (latest by date)] [Python Version] [GitHub Workflow Status] [codecov] [License] [Docker Image] [GitHub Stars] [GitHub Forks]
⚠️ BETA SOFTWARE - This project is in active development. Features may change and breaking changes may occur.
Laravel MCP Companion is a documentation aggregator and navigator for the Laravel ecosystem. It centralizes and organizes high-quality documentation from across the Laravel ecosystem, making it easily discoverable through your AI assistant.
How It Compares
Use Boost when writing code and you need project-aware context. Use Context7 for non-Laravel libraries. Use Companion when learning, researching, or need Laravel documentation reference.
What you get:
- Multi-version Laravel documentation (6.x through latest) with enhanced search
- Learning paths - Structured learning sequences by topic and skill level
- "I need X" finder - Describe what you need, get relevant documentation
- Difficulty filtering - Content organized by beginner/intermediate/advanced
- 15 semantic categories - Browse documentation by topic area
- Auto-discovery Laravel services - Forge, Vapor, Envoyer, Nova (117+ sections)
- Community package documentation - 42,000+ lines from Spatie, Livewire, Inertia, Filament
- Package integration guides - Installation and setup for 22 curated packages
- Cross-package compatibility - Learn which packages work well together
- Unified search across core Laravel docs, services, packages, and learning resources
- Daily updates - Automatically syncs with latest documentation
Installation
Listed in the official MCP Registry
as io.github.brianirish/laravel-mcp-companion — clients with registry
support can install it from there directly. Manual setup:
Claude Desktop
-
Open Claude Desktop Settings
- Click Claude menu → Settings → Developer → Edit Config
-
Add to your configuration file:
-
Restart Claude Desktop for changes to take effect
Config file locations:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Claude Code
Use the claude mcp add command:
The --scope project option creates a .mcp.json file in your project root that can be committed to version control.
Configuration Options
These options can be used with the Docker command. For example:
Keeping documentation current
Documentation ships inside the image, and a new image is published whenever the
documentation is refreshed, so :latest carries the most recently published
snapshot. The catch is that docker run reuses the copy you already have —
once you've pulled the image, you keep running it until you pull again. Refresh
whenever you like:
Or add --pull=always to your MCP config so every start checks for a newer image.
It costs a moment of startup time and needs a working connection, so it's opt-in
rather than the default:
You don't have to track this yourself. The server tells your assistant how old the documentation is for the Laravel version it's serving, so if you ask about something newer than that snapshot it will say so and offer to refresh instead of answering from stale pages. You can also just ask — "how current are your Laravel docs?"
To update in place without pulling a new image, --update-docs fetches fresh
documentation for the selected Laravel version during startup. Documentation for
Forge, Vapor, Nova, Envoyer and community packages refreshes separately, through the
update_external_laravel_docs tool your assistant can call.
With --rm the download is discarded when the container exits, so it repeats on
every start. A named volume keeps it — but note the trade-off:
A volume overrides the image's documentation. Once populated it masks
/app/docs, so pulling a newer image no longer updates what the server reads — the volume becomes your source of truth and--update-docsbecomes the way you refresh it. Use a volume when you want to control updates explicitly; stick to plaindocker pullif you'd rather the image stay in charge.
Transform Modes
By default the server no longer lists all of its tools. Instead it exposes a compact, search-first interface that keeps your AI client's context window lean:
search(default) — Exposessearch_tools(BM25 relevance search over the tool catalog) andcall_tool(proxy to invoke any underlying tool).search_laravel_docsstays pinned and directly callable.code(experimental) — Exposes Code Mode meta-tools (tags,search,get_schema,execute) that let the client discover tools and orchestrate them with sandboxed Python. Requires thefastmcp[code-mode]extra (included inrequirements.txt). Avoid exposing this publicly over HTTP —executeis a code execution endpoint.none— Pre-0.9 behavior: every tool listed directly. Use this if your MCP client doesn't handle the synthetic search tools well.
HTTP transport security
Authentication is off by default. Anyone who can reach the HTTP port can call every tool, so treat network exposure as granting full access to the documentation tree — or turn on bearer-token auth:
The server is a resource server: it validates tokens, it never issues them.
Issuer and audience are mandatory with --auth-jwks-uri — accepting any
issuer's tokens, or tokens minted for another service, would be authentication
theater. Unauthenticated requests get 401 with a WWW-Authenticate header
(RFC 9728), and misconfiguration fails at startup rather than at request time.
Auth applies to the HTTP transport only; stdio's access control is the process
boundary.
Defaults are conservative:
- Binds
127.0.0.1outside Docker. Inside the container it binds0.0.0.0, where the container boundary and explicit-ppublishing are the access control. - Host and Origin validation is on, which blocks DNS-rebinding and drive-by-localhost attacks from a victim's browser.
- CORS is disabled unless you pass
--cors-origin. Wildcard origins are rejected; credentials are never allowed cross-origin.
Only localhost, 127.0.0.1, and ::1 are accepted as Host values out of the box. If you bind a non-loopback interface you must add the hostname clients actually use, or every request is rejected with 421:
Requests with an unrecognized Host get 421; requests from an unlisted Origin get 403. Passing --allowed-host or --cors-origin on the command line replaces the corresponding environment variable rather than adding to it. If you expose this beyond localhost, put an authenticating reverse proxy in front of it. Avoid --transform-mode code over HTTP entirely — execute is a code execution endpoint.
Rate limiting (HTTP mode)
Off by default. --rate-limit 20 caps MCP requests — tool calls,
searches, the protocol surface — at 20/second with a single global token
bucket: a total throughput cap, not per-client fairness (without auth there
is no reliable client identity to key on). The operational endpoints
(/healthz, /metrics, /.well-known/...) are deliberately outside the
limit: throttling a load balancer's health checks marks healthy instances
down, and those handlers are trivial reads. The limit counts every MCP
request including the initialize handshake, which is why the burst default
stays at max(10, 2×RPS); keep the burst comfortably above your clients'
handshake size if you lower it. Throttled requests receive a clean MCP error
and succeed again once the bucket refills.
Operational endpoints (HTTP mode)
GET /healthz— liveness/readiness JSON, always public (load balancers can't do OAuth).okanddegradedboth return 200 — degraded means the documentation copy is stale and a newer image should be pulled; 503 means no documentation is readable and traffic should not be routed here.GET /metrics— Prometheus text format: per-tool call counters, a latency histogram, request counts, uptime, and documentation age. Public on unauthenticated deployments; requires a valid bearer token whenever auth is configured.
Features (v0.13.0)
Documentation Aggregation
- Multi-version Laravel docs - All versions from 6.x to latest
- Auto-discovery engine - Finds new docs across Forge, Vapor, Nova, Envoyer
- Community package docs - 42,000+ lines from Spatie, Livewire, Inertia, Filament
- Daily updates - Automatic sync with latest documentation
Learning & Discovery
- Learning paths - Structured sequences for any Laravel topic, offered interactively: ask without naming one and the server asks which of the ten curated paths you want
- Difficulty levels - Filter by beginner, intermediate, or advanced
- 15 categories - Browse by authentication, database, testing, etc.
- "I need X" finder - Natural language documentation discovery
- Related resources - Find connected documentation automatically
Search & Navigation
- Ranked section search - Ask in plain language ("how do I retry a failed queue job") and get the relevant sections ranked by relevance, each with a snippet, an anchor, and a source label
- Section-level reads - Fetch just the section you need. A whole documentation file can exceed 30,000 tokens; a section is typically a few hundred, so answers leave room for your actual code
- Use case mapping - Describe what you need, get relevant packages
- Package integration guides - Installation and setup for 22 curated packages
- Cross-package compatibility - Documentation for package combinations
- Unified search - One search across every corpus: core versions,
services, fetched package docs, and learning resources, with a
sourcesfilter to narrow it
MCP 2025-11-25 capabilities
- Task-capable updates - Documentation updates run as MCP tasks: submit, poll, fetch the result, instead of holding the connection for minutes
- Structured output - Tabular tools return
structuredContentwith real schemas alongside their TOON text - Elicitation - Interactive choices where they help, with plain listings as the fallback for clients without the capability
- Registry listed - Installable from the official MCP Registry,
with
server.jsonmetadata,.well-knowndiscovery in HTTP mode, and automated publishing on release tags
Production Operations (HTTP mode)
- Health & metrics -
GET /healthzfor load balancers and a PrometheusGET /metricswith per-tool counters, latency histogram, and docs age - OAuth 2.1 resource server - Optional bearer-token validation (JWKS or static dev tokens); misconfiguration fails at startup, outages fail closed
- Rate limiting - Opt-in token bucket over the MCP surface with a handshake-aware burst default
- Hardened by default - Loopback bind, Host/Origin validation, no wildcard CORS, path containment enforced identically for search, listing, and reads
Quality
- 81% product coverage with an 80% CI gate, end-to-end tests over real stdio and HTTP transports, and report-only latency benchmarks — warm search p95 is a few milliseconds against the 100ms v1.0.0 target
Upcoming
- v1.0.0: First stable release — API freeze, breaking-change policy, and an LTS commitment
For detailed roadmap information, see ROADMAP.md.
TOON Format Output
Laravel MCP Companion uses TOON (Token-Oriented Object Notation) for structured output, saving 30-60% on tokens compared to JSON/markdown.
Example Output
When you search for packages or list documentation, you get efficient structured data:
Compare to the equivalent JSON (nearly 2x the tokens):
Why TOON?
- Token efficient: LLMs understand TOON natively - no parsing overhead
- Structured data: Arrays, objects, and metadata without JSON verbosity
- AI-friendly: Designed specifically for LLM context windows
Auto-Discovery & Update Frequency
This application features an intelligent auto-discovery system that automatically finds and indexes Laravel documentation. Every day, it:
- Auto-discovers new documentation sections across Laravel services (Forge, Vapor, Nova, Envoyer)
- Retrieves the latest Laravel core documentation for all versions since 6.x
- Fetches community package documentation (Spatie, Livewire, Inertia, Filament)
- Adapts automatically to structural changes in documentation websites
- Generates new patch releases automatically when updates are found
Development
Prerequisites
- Python 3.12+
- Node.js 18+ (for MCP Inspector)
Setup
Running Tests
Manual Testing with MCP Inspector
The MCP Inspector provides a visual UI for testing MCP servers.
Use the Inspector to:
- Tools tab: Test all tools with auto-generated input forms
- Resources tab: Browse
laravel://andlaravel-external://resources - Prompts tab: Test prompt templates
Code Quality
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Acknowledgements
- Laravel for their excellent documentation
- Laravel package authors for their contributions to the ecosystem
来源:README.md,提交 80b6352
工具
0版本历史
1- v0.13.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分