MCP AI Chat Server
Provides AI-powered natural language understanding using OpenAI's GPT models for processing business queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP AI Chat ServerUpdate status task nomor 1 menjadi completed"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP AI Chat Server
A Laravel-based AI-powered chat interface for business management operations using natural language processing and tool calling.
๐ฏ Overview
The MCP AI Chat Server enables users to interact with business data through natural language conversations. It leverages OpenAI's function calling capabilities to:
Analyze user intent from natural language input
Extract parameters automatically
Execute appropriate business operations via MCP tools
Return human-friendly responses
โจ Features
Natural Language Processing: Understands Indonesian and English business queries
AI-Powered Tool Calling: Uses OpenAI GPT models for intelligent function selection
Rule-Based Fallback: Graceful degradation when AI services are unavailable
Real-time Chat Interface: Web-based chat UI with session management
Comprehensive Logging: Tracks all interactions and tool executions
RESTful API: Programmatic access to chat functionality
Multi-Provider Support: OpenAI and OpenRouter integration
๐ ๏ธ Available Tools
Tool | Description | Parameters |
| Create new customer records | name, email, phone |
| Retrieve user by email | |
| Find tasks by status/user | status, assigned_to |
| Change task status | task_id, status |
| Find inactive customers | days |
๐ Quick Start
Prerequisites
PHP 8.1+
Composer
Node.js & npm (for frontend assets)
Database (MySQL/PostgreSQL/SQLite)
Installation
Clone and install dependencies:
git clone <repository-url> cd mcp-server composer install npm installEnvironment setup:
cp .env.example .env php artisan key:generateConfigure 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-hereDatabase setup:
php artisan migrate php artisan db:seed # Optional: seed sample dataBuild assets:
npm run buildStart the server:
php artisan serveAccess the application:
Chat Interface: http://localhost:8000/chat
API Documentation: http://localhost:8000/api/documentation
๐ฌ Usage Examples
Web Interface
Visit /chat to use the interactive chat interface with example message buttons.
API Usage
Send Chat Message
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 john@example.com",
"session_id": "optional-session-id"
}'Response
{
"reply": "Customer 'John Doe' berhasil dibuat dengan ID 1.",
"executed_tool": "create_customer",
"arguments": {
"name": "John Doe",
"email": "john@example.com"
},
"result": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
"status": "success"
}Example Conversations
Creating a customer:
User: Buatkan user baru dengan nama Andi, email andi@gmail.com
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.๐ก API Endpoints
Method | Endpoint | Description |
POST |
| Send chat message |
GET |
| Get conversation history |
DELETE |
| Clear conversation history |
Authentication
All API endpoints require the X-MCP-Key header with a valid key from MCP_VALID_KEYS.
๐ง Configuration
AI Providers
Choose between OpenAI and OpenRouter by setting AI_PROVIDER:
OpenAI: More reliable, requires API key
OpenRouter: Alternative provider, supports multiple models
Environment Variables
Variable | Description | Default |
| AI service provider |
|
| OpenAI API key | - |
| OpenRouter API key | - |
| Comma-separated API keys | - |
| Database connection |
|
๐๏ธ Architecture
Core Components
AgentService: Main AI processing logic
ToolRegistry: Manages available MCP tools
MCP Tools: Individual business operation handlers
ChatController: Web interface and API endpoints
Logging: Comprehensive interaction tracking
Data Flow
User sends message via API or web interface
AgentService analyzes intent using AI or rule-based logic
Appropriate tool is selected and executed
Results are formatted into human-readable response
Interaction is logged for analytics
๐ Security
API key authentication for all endpoints
Input validation and sanitization
Rate limiting on chat endpoints
Comprehensive error handling
No sensitive data exposure in responses
๐ Monitoring
All interactions are logged in the mcp_command_logs table including:
User messages and AI responses
Executed tools and parameters
Success/failure status
Session tracking
IP addresses and metadata
๐งช Testing
Run the test suite:
php artisan test๐ค Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
For issues and questions:
Check the logs in
storage/logs/laravel.logReview
mcp_command_logstable for interaction detailsEnsure API keys are properly configured
๐ Additional Resources
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fawazbayureksa/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server