Skip to main content
Glama

MCP on My SAMP

Scope: local servers or servers you own/are authorized for. Not a tool for public-server automation.


What can it do?

MCP on My SAMP lets AI agents test game servers with repeatable workflows:

  • start / stop / check open.mp status;

  • start / stop / check headless RakClient status;

  • wait for the client to actually be Spawned;

  • send allowed slash commands;

  • read client output history;

  • verify the server response was received by the client;

  • discover commands from the Pawn gamemode source;

  • reject commands outside the allowlist.

It does not provide flood, spam, lag injection, arbitrary RCON, or automation of public servers.

Workflow

flowchart LR
    A[AI Agent] -->|MCP stdio| B[MCP on My SAMP]
    B --> C[open.mp Server]
    B --> D[Headless RakClient]
    D -->|UDP localhost| C
    C -->|server response| D
    D --> B
    B -->|assertion| A

Valid round-trip proof:

command dikirim
→ server callback menerima command
→ gamemode mengirim response
→ client menerima response
→ MCP assertion berhasil

Spawned alone is not proof a command succeeded.


Installation

1. Set up Python

Python 3.10 or newer is required.

2. Install the project

Run from the repository root:

Windows

py -3 -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install ".[dev]"

Linux / macOS

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install ".[dev]"

3. Verify

pytest -q

Expected output:

35 passed

The open.mp and RakClient binaries are only needed for live tests. Python unit tests can still run without those binaries.


Configuration

Create a local config file from the template:

Windows

copy config.example.json local-server.json

Linux / macOS

cp config.example.json local-server.json

Fill in the file:

{
  "executable": "vendor/openmp/Server/omp-server.exe",
  "working_dir": "vendor/openmp/Server",
  "args": ["--config-path", "config.json"],
  "ready_text": "Legacy Network started on port",
  "startup_timeout": 30
}

Change executable and working_dir to match the open.mp location on your machine. local-server.json is not committed to Git because paths differ per machine.


Running the MCP server

Server only

mcp-gta-samp --config local-server.json

With headless RakClient

Windows

mcp-gta-samp ^
  --config local-server.json ^
  --client-executable vendor/rakclient-bin/rakclient.exe ^
  --client-arg --server ^
  --client-arg 127.0.0.1:7777 ^
  --client-arg --nick ^
  --client-arg MCPBot ^
  --client-arg --scripts-dir ^
  --client-arg vendor/rakclient-bin/scripts ^
  --gamemode-source vendor/openmp/Server/gamemodes/mcp_test.pwn

Linux / macOS

mcp-gta-samp \
  --config local-server.json \
  --client-executable vendor/rakclient-bin/rakclient \
  --client-arg --server \
  --client-arg 127.0.0.1:7777 \
  --client-arg --nick \
  --client-arg MCPBot \
  --client-arg --scripts-dir \
  --client-arg vendor/rakclient-bin/scripts \
  --gamemode-source vendor/openmp/Server/gamemodes/mcp_test.pwn

The MCP transport uses stdio.


MCP tools

Tool

Function

server_start

Starts the server and waits for readiness.

server_status

Checks server status and PID.

server_stop

Stops the server.

client_start

Starts the headless RakClient.

client_status

Checks client status.

client_stop

Stops the client.

client_send_chat

Sends an allowed slash command after Spawned.

client_get_history

Retrieves buffered client output.

client_assert_output

Ensures specific output was received by the client.

server_list_commands

Lists commands from the Pawn source.

server_assert_command

Validates a command against the allowlist.

The last two tools are available when --gamemode-source is used.


Workflow for AI agents

1. server_status
2. server_start jika belum berjalan
3. client_start
4. tunggu state Spawned
5. server_list_commands
6. server_assert_command("/help")
7. client_send_chat("/help")
8. client_assert_output("MCP Test Commands:")
9. client_get_history bila perlu diagnosis
10. client_stop
11. server_stop

Important instructions for the agent:

  • do not access public servers;

  • do not treat boot, join, or Spawned as a command round-trip;

  • on failure, classify the boundary: boot, connection, spawn, queue, outbound packet, server callback, server response, client parser, or MCP assertion;

  • always stop processes after a test;

  • make sure UDP port 7777 is free again.


Live test example

A test gamemode is available at:

vendor/openmp/Server/gamemodes/mcp_test.pwn

Available commands:

/help
/status

If the Pawn source is changed, recompile the .amx from the server folder:

qawno\pawncc.exe -i.\qawno\include -o.\gamemodes\mcp_test .\gamemodes\mcp_test.pwn

Live workflow:

server_start
→ client_start
→ client mencapai Spawned
→ client_send_chat("/help")
→ client_assert_output("MCP Test Commands:")
→ client_assert_output("/status - show a test response")
→ client_stop
→ server_stop

The headless RakClient proves protocol, state, and commands. It does not produce screenshots. Visual testing requires a separate rendered GTA client.


Development

Running tests:

pytest -q

Building a wheel:

python -m pip wheel . --no-deps -w dist

Installing the wheel:

python -m pip install dist/mcp_gta_samp-0.1.0-py3-none-any.whl

Core structure:

mcp_gta_samp/       package Python dan MCP facade
tests/              unit, contract, dan bridge tests
config.example.json template konfigurasi
vendor/             binary dan fixture live test

Security

This MCP restricts usage to local/owned servers. Do not include credentials, proxy pools, private configs, private logs, or server test data in public repositories.

If you run a server from the internet, add your own authentication and network isolation. This package is not designed as a public game-control API.

License

MIT License. See LICENSE.

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Connect AI agents to Flato's editable canvas runtime through a hosted MCP server.

View all MCP Connectors

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/marhenrik635-oss/mcponmysamp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server