MCP on My SAMP
MCP on My SAMP
Область применения: локальные серверы или серверы, которыми вы владеете/на которые у вас есть разрешение. Это не инструмент для автоматизации публичных серверов.
Что умеет?
MCP on My SAMP позволяет AI-агенту тестировать игровые серверы с помощью воспроизводимых рабочих процессов:
запуск / остановка / проверка статуса open.mp;
запуск / остановка / проверка статуса headless RakClient;
ожидание фактического перехода клиента в состояние
Spawned;отправка разрешённых slash-команд;
чтение истории вывода клиента;
проверка того, что ответ сервера получен клиентом;
поиск команд в исходном коде Pawn-гаммода;
отклонение команд, не входящих в allowlist.
Не предоставляет flood, спам, инъекцию задержек, произвольный RCON или автоматизацию публичных серверов.
Related MCP server: Brainstorm
Рабочий процесс
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Доказательство корректного round-trip:
command dikirim
→ server callback menerima command
→ gamemode mengirim response
→ client menerima response
→ MCP assertion berhasilСостояние Spawned само по себе не является доказательством успешного выполнения команды.
Установка
1. Подготовьте Python
Требуется Python 3.10 или новее.
2. Установите проект
Выполните из корня репозитория:
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. Проверка
pytest -qОжидаемый вывод:
35 passedБинарные файлы open.mp и RakClient требуются только для live-тестов. Модульные тесты Python можно запускать и без этих бинарных файлов.
Конфигурация
Создайте локальный файл конфигурации из шаблона:
Windows
copy config.example.json local-server.jsonLinux / macOS
cp config.example.json local-server.jsonЗаполните файл:
{
"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
}Измените executable и working_dir в соответствии с расположением open.mp на вашем компьютере. local-server.json не попадает в Git, поскольку пути на каждом компьютере разные.
Запуск MCP-сервера
Только сервер
mcp-gta-samp --config local-server.jsonС 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.pwnLinux / 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Транспорт MCP использует stdio.
MCP-инструменты
Tool | Функция |
| Запускает сервер и ожидает готовности. |
| Проверяет статус сервера и PID. |
| Останавливает сервер. |
| Запускает headless RakClient. |
| Проверяет статус клиента. |
| Останавливает клиент. |
| Отправляет разрешённую slash-команду после |
| Получает буферизованный вывод клиента. |
| Проверяет, что определённый вывод получен клиентом. |
| Показывает команды из исходного кода Pawn. |
| Проверяет команду на соответствие allowlist. |
Последние два инструмента доступны, если используется --gamemode-source.
Рабочий процесс для AI-агента
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Важные инструкции для агента:
не обращаться к публичным серверам;
не считать boot, join или
Spawnedподтверждением round-trip команды;при сбое классифицировать границу: boot, соединение, спавн, очередь, исходящий пакет, серверный callback, ответ сервера, клиентский парсер или assertion MCP;
всегда останавливать процессы после теста;
убедиться, что UDP-порт
7777снова свободен.
Пример live-теста
Тестовый гаммод доступен по адресу:
vendor/openmp/Server/gamemodes/mcp_test.pwnДоступные команды:
/help
/statusЕсли исходный код Pawn изменён, перекомпилируйте .amx из папки сервера:
qawno\pawncc.exe -i.\qawno\include -o.\gamemodes\mcp_test .\gamemodes\mcp_test.pwnLive-рабочий процесс:
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_stopHeadless RakClient доказывает протокол, состояние и команды. Он не создаёт скриншоты. Для визуального тестирования требуется отдельный отрендеренный GTA-клиент.
Разработка
Запуск тестов:
pytest -qСоздание wheel:
python -m pip wheel . --no-deps -w distУстановка wheel:
python -m pip install dist/mcp_gta_samp-0.1.0-py3-none-any.whlОсновная структура:
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Безопасность
Этот MCP ограничивает использование локальными/принадлежащими вам серверами. Не помещайте учётные данные, прокси-пулы, приватные конфиги, приватные логи или данные тестовых серверов в публичный репозиторий.
Если вы запускаете сервер из интернета, добавьте собственную аутентификацию и сетевую изоляцию. Этот пакет не предназначен для использования в качестве публичного API управления играми.
Лицензия
Лицензия MIT. См. LICENSE.
Ссылки
Репозиторий: marhenrik635-oss/mcponmysamp
Issues: сообщить о проблеме
Available Tools
3 toolsserver_startAIdempotent
Start the configured local open.mp test server and wait for readiness.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover idempotency (idempotentHint=true), read-only status (readOnlyHint=false), and destructiveness (destructiveHint=false). The description adds the 'wait for readiness' behavior, which is beyond what annotations provide, giving the agent a clear expectation of the tool's runtime behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. Every word contributes meaning: 'start', 'configured local open.mp test server', and 'wait for readiness' are all necessary and sufficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a simple tool with no parameters, an output schema, and annotations covering idempotency and safety. The description fully covers the intended action and readiness behavior, leaving no critical gaps for an agent to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so there are no parameter semantics to document. Per the baseline for 0 params, a score of 4 is appropriate; the description doesn't need to compensate for schema gaps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Start') and resource ('configured local open.mp test server') and adds 'wait for readiness' as a behavioral outcome. This clearly distinguishes it from siblings server_stop and server_status through action and intent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The start action and readiness wait make the context obvious: this is for bringing the server up. It does not explicitly name alternatives or when-not conditions, but the sibling names and the verb provide clear contextual guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
server_statusARead-only
Return local open.mp test server process status.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already declare readOnlyHint=true and destructiveHint=false, so the safe read-only nature is covered. The description adds the 'local' and 'process status' scope, but does not provide additional behavioral detail such as what exactly the status output contains or whether it might throw errors if no server is running. With the output schema present, the agent can likely infer return structure, so the description adds minimal but acceptable value.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence delivers the essential meaning with no filler. It names the resource and the type of operation without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-parameter, read-only status tool with an output schema present, the description is complete enough to guide correct invocation. There are no prerequisites, options, or alternatives that need clarifying beyond what the summary already provides.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, so the description has no parameter meaning to add. The baseline for no-parameter tools is 4, and there is no relevant gap to compensate for.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Return') and a clear resource ('local open.mp test server process status'), making the tool's function immediately obvious. It also differentiates itself from siblings server_start and server_stop by describing a read-only status check rather than a state-changing operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly implies the tool is for checking status rather than starting or stopping the server, which are the sibling operations. It does not explicitly state 'use this when you need to check status and not start/stop', but the context and naming make the intended use clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
server_stopADestructive
Stop the configured local open.mp test server.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds no behavioral context beyond the verb 'Stop'. It does not clarify consequences such as terminating active sessions or clearing server state. There is no contradiction with annotations, but the description relies entirely on structured metadata.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. It names the action and the target directly, and every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter destructive action with annotations covering safety and an output schema present, the description is sufficient for basic invocation. It is slightly thin on operational context such as behavior when the server is already stopped, but that is not necessary for calling the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool accepts zero parameters and schema description coverage is 100%, so there are no parameter semantics to document. The baseline of 4 applies because the description cannot add meaning beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a precise action ('Stop') and the exact target ('configured local open.mp test server'). This clearly distinguishes it from sibling tools server_start and server_status, which have complementary purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus server_start or server_status. The description only states the action and target, leaving the agent to infer usage from the tool name and siblings rather than from explicit instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
server_start - First observed
server_status - First observed
server_stop
TDQS
Scored across 3 tools
Each tool has a single, clear responsibility: start, stop, or check status. There is no overlap or ambiguity between them.
All tools follow the identical pattern of 'server_' followed by a simple verb (start, stop, status). This is perfectly consistent and predictable.
Three tools is exactly right for the narrow scope of managing a local server. Each tool is essential and earns its place without unnecessary bloat.
The tool set covers the core lifecycle (start, stop, status) but lacks a restart operation, which is a common need. However, agents can still accomplish restart via stop+start, so this is a minor gap.
Maintenance
Related MCP Connectors
Create guides as MCP servers to instruct coding agents to use your software (library, API, etc).
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceConnects AI agents to Minecraft servers via RCON to execute commands, monitor logs, and perform read-only SQLite database queries. It is specifically designed to facilitate AI-assisted plugin development, live debugging, and automated testing workflows.611MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to communicate, coordinate, and collaborate on complex tasks through a local MCP server.2 npm8ISC
- FlicenseNot gradedqualityCmaintenanceTurns your local machine into an MCP server with a GUI, allowing agents to execute file operations, run commands (including admin), manage background processes, and query databases, with optional ngrok exposure.-
- AlicenseAqualityBmaintenanceEnables AI agents to execute Lua code, inspect scripts, spy on remotes, and interact with a running Roblox game client through an MCP interface.722279 npm1MIT