Order Status Server

Order Status Server

Laravel MCP server that provides a tool to look up order status by order ID from a MySQL database.

Category
访问服务器

README

Laravel MCP Server

Why Choose a Laravel-Based MCP Server?

  • If your application is built on Laravel, developing a MCP Server directly within your existing codebase is often more efficient and secure than maintaining a separate Python microservice.
  • By using Laravel as your MCP host, you create a seamless translation layer that exposes your data, business logic, and internal functions directly to AI agents like Antigravity or Claude Code

Key Advantages

  • Native Access to Business Logic: Skip the overhead of building and securing custom REST APIs. Your AI tools can interact directly with your database, Eloquent models, relationships, and internal services using code you already have.
  • Enterprise-Grade Security: Leverage Laravel’s mature security ecosystem. You can utilize built-in features like Laravel Sanctum for authentication and standard middleware for rate-limiting, ensuring your AI integrations are protected by the same rigorous standards as your web app.
  • Robust, Familiar Architecture: Benefit from built-in Artisan scaffolding to generate tools quickly, keep AI-specific logic organized in a dedicated app/Mcp directory, and offload resource-intensive tasks to your existing Laravel Queue infrastructure for better performance.

Requirements

  • PHP: 8.3 or Higher
  • Laravel: 13.8 or Higher
  • MySql: 9.3.0 or Higher

How to run

  1. Clone this repository
git clone 
  1. Create .env file
copy .env.example .env
  1. Update .env file with MySQL connection settings
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mcp-db
DB_USERNAME=root
DB_PASSWORD='Password' 
  1. Set GEMINI key, or what ever AI provider
GEMINI_API_KEY=<some-key>
or
ANTHROPIC_API_KEY=<some-key>
or
OPENAI_API_KEY=<some-key>
  1. Generate encryption key for App
php artisan key generate
  1. run migration
php artisan migrate
  1. run db-seed
php artisan db:seed
  1. run the app
php artisan server

Design

  1. Database Model
Model App\Models\OrderStatus
Table order_status
Fields order_id(integer),product,status
  1. Database seed
  • Database\Seeders\OrderStatusSeeder
  • contains some entries for order status
order_id product status \
1 Noodles PENDING
2 Sauce PROCESSING
  1. MCP Tool
  • App\Mcp\Tools\OrderStatusFinderTool
  • name : order-status-finder
  • what it do : Find and return status of order in structured format
  1. MCP Server
  • App\Mcp\Servers\OrderStatusServer
  • name : Order Status Server
  • contains : One tool (OrderStatusFinderTool), no resources, no prompts

How to test

  • make sure MCP Server is running
  • execute php artisan serve at terminal to run MCP Server

Via Postman

  1. File -> New -> MCP
  2. Request Type : Change from STDIO to HTTP
  3. URL : http://127.0.0.1:8000/mcp/order-status
  4. Press Connect
  5. Now Click Tools::Order Status Finder Tool
  6. Enter Order Id as 1 or 2 and Press run
  7. Click response at Bottom to View Output

Via Antigravity CLI

  1. Config Open ~/.gemini/config/mcp_config.json Add:
{
    "mcpServers": {
        "order-status": {
            "serverUrl": "http://127.0.0.1:8000/mcp/order-status/",
            "headers": {
                "Accept": "application/json, text/event-stream",
                "Content-Type": "application/json"
            }
        }
    }
}
  1. Launch Antigravity CLI
agy

Prompt: What is the status of order id 2

Via ADK 2.0 Agent

# mcp_client.py
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams


# Configure connection parameters for the remote HTTP server
connection_params = StreamableHTTPConnectionParams(
    url="http://127.0.0.1:8000/mcp/order-status",
    headers={
        "Accept": "application/json, text/event-stream",
        "Content-Type":"application/json"
    
    } 
)

# Instantiate the toolset
mcp_tools = McpToolset(connection_params=connection_params)

root_agent = LlmAgent(
    model="gemini-2.5-flash-lite",
    name="order_status_agent",
    instruction="""
    You are a helpful assistant who has insight about github accounts
    """,
    tools=[mcp_tools],
)

Prompt: What is the status of order id 2

Laravel MCP Documentation

Visit: https://laravel.com/docs/13.x/mcp

GIT REPO URL

https://github.com/10xroadmap/laravel-mcp-server-tool-demo

License or Terms of Use

This project is open-source. However, no part of the source code may be republished, modified, or distributed for commercial or public purposes without giving appropriate credit to the original author.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选