MCP for Laravel
@settledco
关于 MCP for Laravel
概览
What is MCP for Laravel?
MCP for Laravel is a PHP package for Laravel 11 that provides a framework for building intelligent AI agents using the Model Context Protocol (MCP). It is designed for developers who want to integrate LLM-powered agents with tool calling, memory, and RAG capabilities into Laravel applications.
How to use MCP for Laravel?
Install the package via Composer with composer require settled/mcp-laravel. Then create an agent by extending the Settled\MCP\Agent class, configure an LLM provider (e.g., Anthropic, Ollama, OpenAI, Mistral, Deepseek), and define instructions using the SystemPrompt class. Send prompts to the agent with $agent->run(new UserMessage(...)). Connect MCP servers by using the McpConnector component inside the agent’s tools array.
Key features of MCP for Laravel
- Pre-built Agent class with automatic memory and tool management
- MCP server connector to import external tools via McpConnector
- Support for multiple LLM providers (Anthropic, Ollama, OpenAI, Mistral, Deepseek)
- SystemPrompt helper for consistent instruction building
- RAG (Retrieval-Augmented Generation) support with vector stores and embeddings
Use cases of MCP for Laravel
- Creating a YouTube video summarizer agent with transcription tools
- Building an SEO analysis agent that uses MCP server tools
- Implementing a RAG chatbot that queries a vector database
FAQ from MCP for Laravel
What LLM providers does MCP for Laravel support?
It supports Anthropic, Ollama, OpenAI, Mistral, and Deepseek. Switching providers requires only a single line of code.
How do I connect an MCP server to my agent?
Use the McpConnector class inside the agent’s tools() method, providing the command and arguments for the MCP server (e.g., 'npx -y @modelcontextprotocol/server-everything'). The connector automatically exposes the server’s tools.
What are the system requirements for MCP for Laravel?
PHP ^8.0 and Laravel ^11.0 are required.
Does the agent have built-in memory?
Yes, the Agent class automatically retains conversation history, as shown in the sample where the agent remembers the user’s name from a previous message.
Can I build a RAG system with this package?
Yes, by extending the RAG class and attaching an embeddings provider (e.g., VoyageEmbeddingProvider) and a vector store (e.g., PineconeVectoreStore).
其他 分类下的更多 MCP 客户端
mcp-oi-wiki
shwstone🌟 Wiki of OI / ICPC for LLMs. (面向大模型的某大型游戏线上攻略,内含炫酷算术魔法)
tinyagents
albertvillanovaTiny Agents: LLM + MCP Tools
Llama MCP Streamlit
nikunj2003AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).

Firme360
firme360.roFirme360 is an MCP client available at https://firme360.ro.
Roamzy
roamzy-ioAgent-native global eSIM over MCP — an AI agent buys one eSIM for 193 countries, anonymously, per-MB in USDT/USDC crypto, and earns 20% referral forever. Claude/Cursor/Continue + any MCP client.
评论