loading…
Search for a command to run...
loading…
A Laravel-based AI-powered chat interface for business management operations, enabling users to execute tasks like creating customers and updating task statuses
A Laravel-based AI-powered chat interface for business management operations, enabling users to execute tasks like creating customers and updating task statuses through natural language conversations.
A Laravel-based AI-powered chat interface for business management operations using natural language processing and tool calling.
The MCP AI Chat Server enables users to interact with business data through natural language conversations. It leverages OpenAI's function calling capabilities to:
| Tool | Description | Parameters |
|---|---|---|
create_customer |
Create new customer records | name, email, phone |
get_user |
Retrieve user by email | |
search_tasks |
Find tasks by status/user | status, assigned_to |
update_task_status |
Change task status | task_id, status |
get_overdue_customers |
Find inactive customers | days |
Clone and install dependencies:
git clone <repository-url>
cd mcp-server
composer install
npm install
Environment setup:
cp .env.example .env
php artisan key:generate
Configure environment variables:
# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mcp_chat
DB_USERNAME=your_username
DB_PASSWORD=your_password
# AI Providers
AI_PROVIDER=openai # or 'openrouter'
OPENAI_API_KEY=your-openai-api-key
OPENROUTER_API_KEY=your-openrouter-api-key
# MCP Authentication
MCP_VALID_KEYS=your-secret-key-here
Database setup:
php artisan migrate
php artisan db:seed # Optional: seed sample data
Build assets:
npm run build
Start the server:
php artisan serve
Access the application:
Visit /chat to use the interactive chat interface with example message buttons.
curl -X POST "http://localhost:8000/api/mcp/chat" \
-H "Content-Type: application/json" \
-H "X-MCP-Key: your-mcp-key" \
-d '{
"message": "Buatkan customer baru dengan nama John Doe, email [email protected]",
"session_id": "optional-session-id"
}'
{
"reply": "Customer 'John Doe' berhasil dibuat dengan ID 1.",
"executed_tool": "create_customer",
"arguments": {
"name": "John Doe",
"email": "[email protected]"
},
"result": {
"id": 1,
"name": "John Doe",
"email": "[email protected]"
},
"status": "success"
}
Creating a customer:
User: Buatkan user baru dengan nama Andi, email [email protected]
AI: Customer 'Andi' berhasil dibuat dengan ID 5.
Updating task status:
User: Update status task nomor 1 menjadi completed
AI: Status task ID 1 berhasil diubah menjadi 'completed'.
Finding overdue customers:
User: Tampilkan customer yang belum dihubungi lebih dari 30 hari
AI: Ditemukan 3 customer yang belum dihubungi lebih dari 30 hari.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/mcp/chat |
Send chat message |
| GET | /api/mcp/chat/history |
Get conversation history |
| DELETE | /api/mcp/chat/history |
Clear conversation history |
All API endpoints require the X-MCP-Key header with a valid key from MCP_VALID_KEYS.
Choose between OpenAI and OpenRouter by setting AI_PROVIDER:
| Variable | Description | Default |
|---|---|---|
AI_PROVIDER |
AI service provider | openai |
OPENAI_API_KEY |
OpenAI API key | - |
OPENROUTER_API_KEY |
OpenRouter API key | - |
MCP_VALID_KEYS |
Comma-separated API keys | - |
DB_CONNECTION |
Database connection | mysql |
All interactions are logged in the mcp_command_logs table including:
Run the test suite:
php artisan test
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
storage/logs/laravel.logmcp_command_logs table for interaction detailsВыполни в терминале:
claude mcp add mcp-ai-chat-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.