Files
ClaudeCode-Roblox-Studio-MCP/roblox-plugin/TestConnection.lua
Admin a66533206f Add FPS game example, auto-connect plugin, and Python injection tools
- Updated RobloxMCPPlugin with HTTP polling (auto-enables HttpService)
- Added 20-weapon FPS game example (CoD-style)
- Added Python studio-inject.py for command bar injection via Win32 API
- Added auto-connect setup scripts (VBS + PowerShell)
- Updated MCP server with all FPS game tools

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 16:57:35 +04:00

90 lines
2.4 KiB
Lua

-- Simple Roblox MCP Connection Test
-- Put this in ServerScriptService and Press Play
local HttpService = game:GetService("HttpService")
print("=" .. string.rep("=", 50))
print("ROBLOX MCP CONNECTION TEST")
print("=" .. string.rep("=", 50))
-- Test 1: Check HTTP Service
print("\n[TEST 1] Checking HttpService...")
local success = pcall(function()
HttpService:GetAsync("http://127.0.0.1:37423/health")
end)
if success then
print("✓ HTTP requests are WORKING!")
else
print("✗ HTTP requests are BLOCKED")
print("\nFIX: Go to File → Game Settings → Security")
print(" Enable BOTH HTTP options!")
warn("Cannot connect without HTTP enabled!")
end
-- Test 2: Try to connect to MCP server
print("\n[TEST 2] Connecting to MCP Server...")
local response = pcall(function()
local result = HttpService:RequestAsync({
Url = "http://127.0.0.1:37423/health",
Method = "GET",
})
print("✓ MCP Server is RESPONDING!")
print(" Response: " .. result.Body)
return true
end)
if not response then
print("✗ MCP Server is NOT responding")
print(" Make sure 'npm start' is running!")
end
-- Test 3: Test polling
print("\n[TEST 3] Testing command polling...")
local pollResult = pcall(function()
local result = HttpService:RequestAsync({
Url = "http://127.0.0.1:37423/poll?last=0",
Method = "GET",
})
local data = HttpService:JSONDecode(result.Body)
print("✓ Polling is WORKING!")
print(" Commands waiting: " .. #data.commands)
return true
end)
if not pollResult then
print("✗ Polling FAILED")
end
print("\n" .. string.rep("=", 51))
print("CONNECTION TEST COMPLETE")
print(string.rep("=", 51))
-- Status indicator
local status = Instance.new("ScreenGui")
status.Parent = game:GetService("CoreGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 300, 0, 100)
frame.Position = UDim2.new(0.5, -150, 0, 10)
frame.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
frame.Parent = status
local text = Instance.new("TextLabel")
text.Size = UDim2.new(1, 0, 1, 0)
text.BackgroundTransparency = 1
text.Text = "Roblox MCP Test\nRunning..."
text.TextColor3 = Color3.new(1, 1, 0)
text.TextScaled = true
text.Parent = frame
if success and response then
text.Text = "MCP CONNECTED!\nReady for commands!"
text.TextColor3 = Color3.new(0, 1, 0)
else
text.Text = "MCP NOT CONNECTED\nCheck Output window"
text.TextColor3 = Color3.new(1, 0, 0)
end
game:GetService("Debris"):AddItem(status, 10)