diff --git a/resources/views/docs/documentation.blade.php b/resources/views/docs/documentation.blade.php index ad0a549..c286b9d 100644 --- a/resources/views/docs/documentation.blade.php +++ b/resources/views/docs/documentation.blade.php @@ -3,455 +3,530 @@ @section('title', 'Full Documentation - FiveM MCP Server') @section('content') -
- A comprehensive Model Context Protocol (MCP) server for FiveM (GTA5) development, built with Laravel MCP. - This server provides AI assistants with powerful tools to help you develop FiveM resources more efficiently. -
++ A comprehensive Model Context Protocol (MCP) server for FiveM (GTA5) development, built with Laravel MCP. + This server provides AI assistants with powerful tools to help you develop FiveM resources more efficiently. +
- -Choose how you want to connect to the FiveM MCP server:
+ +Choose how you want to connect to the FiveM MCP server:
- -- Easy setup! Connect to a hosted MCP server. This is the easiest option and works from anywhere without any local setup. -
+ ++ Easy setup! Connect to a hosted MCP server. This is the easiest option and works from anywhere without any local setup. +
-Edit your configuration file:
-~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonEdit your configuration file:
+~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonAdd this configuration (replace with your actual server URL):
-{
- "mcpServers": {
- "fivem": {
- "url": "https://your-domain.com/fivem"
- }
- }
-}
+ Add this configuration (replace with your actual server URL):
+{
+ "mcpServers": {
+ "fivem": {
+ "url": "https://your-domain.com/fivem"
+ }
+ }
+ }
+ If using VSCode with the Cline extension, edit your settings:
+settings.json{
+ "mcp": {
+ "servers": {
+ "fivem": {
+ "url": "https://your-domain.com/fivem"
+ }
+ }
+ }
+ }
+ If using VSCode with the Cline extension, edit your settings:
-settings.json- 💡 Tip: After configuring Claude Desktop, completely quit and restart the application for changes to take effect. -
-Search FiveM and QBCore documentation for specific topics.
- -Search FiveM documentation for specific topics.
+query (required): Search query (e.g., "events",
+ "natives", "manifest")category (optional): Filter by category (all,
+ scripting, natives, networking, resources, qbcore)query (required): Search query (e.g., "events", "natives", "manifest")category (optional): Filter by category (all, scripting, natives, networking, resources)Search for QBCore callbacks and exports
+ Search FiveM docs for "network events"
- Look up GTA5/FiveM native functions.
- -Look up GTA5/FiveM native functions.
+function_name (required): Native function name
+ (e.g., "GetPlayerPed", "SetEntityCoords")language (optional): Code example language (lua
+ or js)function_name (required): Native function name (e.g., "GetPlayerPed", "SetEntityCoords")language (optional): Code example language (lua or js)GetPlayerPed, SetEntityCoords, GetEntityCoordsRegisterNetEvent, TriggerServerEvent, TriggerClientEventESX.GetPlayerFromIdQBCore.Functions.GetPlayerGetPlayerPed, SetEntityCoords, GetEntityCoordsRegisterNetEvent, TriggerServerEvent, TriggerClientEventESX.GetPlayerFromIdQBCore.Functions.GetPlayerGenerate a fxmanifest.lua file.
- -Generate a fxmanifest.lua file.
+resource_name (required): Resource nameauthor (optional): Author namedescription (optional): Resource descriptionversion (optional): Version number (default:
+ "1.0.0")script_type (optional): lua or js (default: lua)
+ include_client (optional): Include client scripts
+ (default: true)include_server (optional): Include server scripts
+ (default: true)framework (optional): standalone, esx, or qbcore
+ (default: standalone)resource_name (required): Resource nameauthor (optional): Author namedescription (optional): Resource descriptionversion (optional): Version number (default: "1.0.0")script_type (optional): lua or js (default: lua)include_client (optional): Include client scripts (default: true)include_server (optional): Include server scripts (default: true)framework (optional): standalone, esx, or qbcore (default: standalone)Generate a manifest for an ESX resource called "my-shop"
+ Generate a manifest for an ESX resource called "my-shop"
- Get information about FiveM, ESX, and QBCore events.
- -Get information about FiveM events.
+event_name (optional): Specific event name to
+ look upevent_type (optional): Filter by type (all, core,
+ esx, qbcore)language (optional): Code example language (lua
+ or js)event_name (optional): Specific event name to look upevent_type (optional): Filter by type (all, core, esx, qbcore)language (optional): Code example language (lua or js)Show me all core FiveM events
+ Look up the QBCore:Client:OnPlayerLoaded event
+ List all ESX events
+ Show me all core FiveM events
- Look up the playerConnecting event
- List all ESX events
- Generate complete resource boilerplate code.
- -Generate complete resource boilerplate code.
+resource_name (required): Resource nameframework (optional): standalone, esx, or qbcore
+ (default: standalone)script_type (optional): lua or js (default: lua)
+ include_nui (optional): Include NUI files
+ (default: false)resource_name (required): Resource nameframework (optional): standalone, esx, or qbcore (default: standalone)script_type (optional): lua or js (default: lua)include_nui (optional): Include NUI files (default: false)Generate boilerplate for a QBCore resource with NUI called "admin-panel"
+ Generate boilerplate for a QBCore resource with NUI called "admin-panel"
- Get information about QBCore framework events.
- -MCP Resources provide read-only reference documentation that AI assistants can access:
+event_name (optional): Specific event name to
+ look upevent_category (optional): Filter by category
+ (all, player, job, inventory, vehicle, money)language (optional): Code example language (lua
+ or js)Common FiveM code patterns and snippets for quick reference.
-URI: fivem://snippets/common
Includes patterns for distance checks, event handlers, threads with cleanup, database queries, and NUI callbacks in both Lua and JavaScript.
-What's the QBCore:Client:OnPlayerLoaded event?
+ Show me all QBCore player events
+ List all QBCore inventory events
+ FiveM development best practices and optimization tips.
-URI: fivem://guides/best-practices
Covers performance optimization, security best practices, code organization, resource management, testing, and common pitfalls.
-Look up QBCore functions and exports.
- -Comparison of FiveM frameworks: Standalone, ESX, and QBCore.
-URI: fivem://guides/framework-comparison
Complete comparison with pros/cons, code examples, common functions, and migration guides.
-function_name (required): QBCore function name
+ (e.g., "QBCore.Functions.GetPlayer", "AddMoney")language (optional): Code example language (lua
+ or js)MCP Prompts are pre-built prompt templates for common tasks:
+QBCore.Functions.GetPlayer, QBCore.Functions.GetPlayerDataAddItem, RemoveItem, GetItemByNameAddMoney, RemoveMoney, GetMoneySetJob, GetJobAddVehicle, DeleteVehicleCreate a new FiveM resource with framework and language selection.
-Parameters: resource_name, framework (standalone/esx/qbcore), language (lua/js)
-How do I use the AddMoney function in QBCore?
+ Debug common FiveM issues and errors with detailed analysis.
-Parameters: issue (description), error_message (from console)
-MCP Resources provide read-only reference documentation that AI assistants can access:
- -Optimize FiveM script performance with detailed suggestions.
-Parameters: code (script to optimize), script_type (client/server/shared)
-Common FiveM code patterns and snippets for quick reference.
+URI: fivem://snippets/common
Includes patterns for distance checks, event handlers, threads with cleanup, database queries, and NUI callbacks in both Lua and JavaScript.
+Convert code between Lua and JavaScript with proper syntax.
-Parameters: code, from (lua/js), to (lua/js)
-FiveM development best practices and optimization tips.
+URI: fivem://guides/best-practices
Covers performance optimization, security best practices, code organization, resource management, testing, and common pitfalls.
+Add ESX or QBCore framework integration to existing resource.
-Parameters: code (current resource), current_framework, target_framework (esx/qbcore)
-Comparison of FiveM frameworks: Standalone, ESX, and QBCore.
+URI: fivem://guides/framework-comparison
Complete comparison with pros/cons, code examples, common functions, and migration guides.
+You can test the MCP server locally using the inspector:
-php artisan mcp:inspector fivem
- This will open the MCP Inspector in your browser where you can test all the tools interactively.
-MCP Prompts are pre-built prompt templates for common tasks:
- -Create a new FiveM resource with framework and language selection.
+Parameters: resource_name, framework (standalone/esx/qbcore), language (lua/js)
+1. Create a new tool class in app/Mcp/Tools/:
Debug common FiveM issues and errors with detailed analysis.
+Parameters: issue (description), error_message (from console)
+<?php
+
+
+ 3. Optimize Performance
+ Optimize FiveM script performance with detailed suggestions.
+ Parameters: code (script to optimize), script_type (client/server/shared)
+
-namespace App\Mcp\Tools;
+
+
+ 4. Convert Language
+ Convert code between Lua and JavaScript with proper syntax.
+ Parameters: code, from (lua/js), to (lua/js)
+
-use Illuminate\Contracts\JsonSchema\JsonSchema;
-use Laravel\Mcp\Request;
-use Laravel\Mcp\Response;
-use Laravel\Mcp\Server\Attributes\Description;
-use Laravel\Mcp\Server\Tool;
+
+
+ 5. Add Framework Integration
+ Add ESX or QBCore framework integration to existing resource.
+ Parameters: code (current resource), current_framework, target_framework (esx/qbcore)
+
+ You can test the MCP server locally using the inspector:
+php artisan mcp:inspector fivem
+ This will open the MCP Inspector in your browser where you can test all the tools interactively.
+1. Create a new tool class in app/Mcp/Tools/:
<?php
+
+ namespace App\Mcp\Tools;
+
+ use Illuminate\Contracts\JsonSchema\JsonSchema;
+ use Laravel\Mcp\Request;
+ use Laravel\Mcp\Response;
+ use Laravel\Mcp\Server\Attributes\Description;
+ use Laravel\Mcp\Server\Tool;
+
+ #[Description('Your tool description')]
+ class YourTool extends Tool
{
- // Tool logic here
- return Response::text('Result');
- }
+ public function handle(Request $request): Response
+ {
+ // Tool logic here
+ return Response::text('Result');
+ }
- public function schema(JsonSchema $schema): array
- {
- return [
- 'param' => $schema->string()->required(),
- ];
- }
-}
+ public function schema(JsonSchema $schema): array
+ {
+ return [
+ 'param' => $schema->string()->required(),
+ ];
+ }
+ }
- 2. Register the tool in app/Mcp/Servers/FiveMServer.php:
2. Register the tool in app/Mcp/Servers/FiveMServer.php:
protected array $tools = [
- // ... existing tools
- \App\Mcp\Tools\YourTool::class,
-];
+ protected array $tools = [
+ // ... existing tools
+ \App\Mcp\Tools\YourTool::class,
+ ];
- Format code with Laravel Pint:
-vendor/bin/pint
- Format code with Laravel Pint:
+vendor/bin/pint
+ Both Lua and JavaScript are fully supported across all tools and generators.
-Both Lua and JavaScript are fully supported across all tools and generators.
+Contributions are welcome! Areas for expansion:
-Contributions are welcome! Areas for expansion:
+MIT License
-MIT License
+