Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Local development example only. Never commit real API keys or bearer tokens.
MAP_PANELS_JSON=[{"id":"panel-one","name":"Example Panel One","base_url":"https://panel-one.example.net","client_api_key":"REPLACE_WITH_CLIENT_API_KEY","application_api_key":"REPLACE_WITH_APPLICATION_API_KEY","admin_api_key":"REPLACE_WITH_ROOT_ADMIN_CLIENT_API_KEY"},{"id":"panel-two","name":"Example Panel Two","base_url":"https://panel-two.example.net","client_api_key":"REPLACE_WITH_CLIENT_API_KEY","application_api_key":"","admin_api_key":""}]
# Local development example only. Never commit real API keys, passwords, or bearer tokens.
# AMP uses username/password session login (not an API key); use HTTPS and a least-privilege account.
MAP_PANELS_JSON=[{"id":"legacy-ptero","name":"Pterodactyl 1.x example","provider":"pterodactyl","panel_version":"1.x","base_url":"https://ptero.example.net","client_api_key":"REPLACE_WITH_CLIENT_API_KEY","application_api_key":"REPLACE_WITH_APPLICATION_API_KEY"},{"id":"calagopus","name":"Calagopus example","provider":"calagopus","base_url":"https://calagopus.example.net","api_base_path":"/api","api_key":"REPLACE_WITH_CALAGOPUS_API_KEY","auth_type":"bearer"},{"id":"mcsm","name":"MCSManager 10 example","provider":"mcsmanager","panel_version":"10.x","base_url":"https://mcsm.example.net","api_base_path":"/api","api_key":"REPLACE_WITH_MCSMANAGER_API_KEY","auth_type":"query","auth_query_param":"apikey"},{"id":"amp","name":"CubeCoders AMP example","provider":"amp","base_url":"https://amp.example.net","api_base_path":"/API","auth_type":"amp_session","auth_username":"REPLACE_WITH_AMP_SERVICE_USER","auth_password":"REPLACE_WITH_AMP_PASSWORD"},{"id":"custom-rest","name":"Custom REST panel example","provider":"generic_rest","base_url":"https://api.example.net","api_base_path":"/api/v2","api_key":"REPLACE_WITH_PANEL_TOKEN","auth_type":"bearer"}]

MAP_TRANSPORT=http
MAP_SERVER_NAME=Model Access Panel (MAP)
Expand All @@ -16,7 +17,7 @@ MAP_MAX_INLINE_FILE_BYTES=6000000
MAP_TRUSTED_WINGS_HOSTS=
MAP_LOG_LEVEL=info

# Legacy single-panel compatibility (used only if multi-panel variables are empty):
# Legacy single-panel compatibility (used only if multi-panel variables are empty; supports Pterodactyl/Pelican):
# PANEL_NAME=Example Panel
# PANEL_BASE_URL=https://panel.example.net
# PANEL_CLIENT_API_KEY=REPLACE_WITH_CLIENT_API_KEY
Expand Down
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 8
ignore:
- dependency-name: "mcp"
update-types: ["version-update:semver-major"]
- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Check out source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
Expand All @@ -49,11 +49,11 @@ jobs:
contents: read
steps:
- name: Check out full history
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.1
with:
go-version: "1.25.x"
- name: Install Gitleaks CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
security-events: write
steps:
- name: Check out source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
contents: write
steps:
- name: Check out tag
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
Expand All @@ -30,6 +30,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[dev]'
- name: Verify tag matches package version
run: |
python -c "import os, tomllib; v=tomllib.load(open('pyproject.toml','rb'))['project']['version']; t=os.environ['GITHUB_REF_NAME'].removeprefix('v'); print('release tag version:',t,'package version:',v); raise SystemExit(t!=v)"
- name: Validate release
run: |
ruff check src tests deploy
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ MAP is currently in beta.

## Unreleased

- Preserve Pterodactyl 1.x Client/Application compatibility and gate the 2.x-only Admin API when the host version is configured.
- Add provider-aware native REST adapters for Calagopus, MCSManager, Crafty Controller, PufferPanel, and configurable custom REST APIs.
- Add MCSManager-native instance listing, actions, command, and output-log tools plus PufferPanel OAuth2 client-credentials refresh.
- Add CubeCoders AMP session login with cached SESSIONID injection, and HTTP Basic authentication for custom REST panels.
- Add provider-specific auth configuration and tests for legacy routing, custom paths, query/header auth, and token caching.

- Split runtime into configuration, panel-client, transport-security, and MCP tool modules.
- Add stdio alongside Streamable HTTP.
- Expand configuration, architecture, deployment, security, and troubleshooting docs.
Expand Down
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Model Access Panel (MAP)

<p align="center">
<strong>One MCP gateway. Multiple Pterodactyl panels. Broad API control.</strong><br>
<strong>One MCP gateway. Multiple game-server panels. Broad API control.</strong><br>
A self-hosted, open-source administration gateway from RealmsNetwork.
</p>

Expand All @@ -12,18 +12,18 @@
<img src="https://img.shields.io/badge/MCP-Streamable%20HTTP%20%7C%20stdio-8b5cf6.svg" alt="MCP transports">
</p>

MAP is a self-hosted [Model Context Protocol](https://modelcontextprotocol.io/) server for administering one or many [Pterodactyl](https://pterodactyl.io/) panels from MCP-compatible clients. Configure each host once, choose it by ID in a tool call, and use dedicated server tools or the generic API gateway.
MAP is a self-hosted [Model Context Protocol](https://modelcontextprotocol.io/) gateway for administering multiple game-server and hosting panels. It preserves the familiar Pterodactyl API workflow for older 1.x and newer 2.x installations, and adds provider adapters for panels with different API conventions. Configure each host once, select it by ID, and use dedicated tools where a provider is supported or the native API gateway elsewhere. No universal adapter can infer vendor-specific endpoints or permissions automatically.

**Heads up:** MAP is an administrative integration, not a read-only dashboard. Depending on configured API keys and panel permissions, it can stop servers, execute console commands, alter files, delete backups, and call destructive panel-wide endpoints. Only install it for systems you administer.

## Features

- **Multiple panels/hosts:** distinct IDs, labels, HTTPS origins, and credentials.
- **Broad API access:** generic Client, Application, and Admin request tool supporting GET, POST, PUT, PATCH, and DELETE.
- **Server operations:** list servers, inspect resources, start/stop/restart/kill, and send console commands.
- **Multiple providers:** each panel has its own ID, origin, provider type, endpoint prefix, and credentials.
- **Broad API access:** namespaced Client/Application/Admin requests for compatible panels and a generic native REST request tool supporting GET, POST, PUT, PATCH, and DELETE.
- **Server operations:** Pterodactyl/Pelican server power/resources/console/file/backup tools; native MCSManager instance list, power, console-command, and output-log tools; AMP session-based native calls.
- **Files and backups:** browse/read/write, create directories, rename/delete files, manage backups, and transfer bounded binary files through trusted Wings hosts.
- **Two MCP transports:** Streamable HTTP for hosted deployments and stdio for local MCP clients.
- **Customization:** configure the MCP display name, request/response limits, panel routing, timeout, and trusted Wings hosts.
- **Customization:** configure the MCP display name, request/response limits, native API prefix, auth scheme/header/query parameter, optional custom headers, panel routing, timeout, and trusted Wings hosts.
- **Deployment options:** Docker, systemd, and interactive panel configuration.
- **Maintainer automation:** Python test matrix, static checks, package build, secret scanning, CodeQL, dependency updates, and issue templates.

Expand Down Expand Up @@ -78,11 +78,27 @@ Set `MAP_PANELS_JSON` to a JSON array. Each panel uses a unique `id`; pass that

These are placeholders, not working credentials. Each host has its own base URL and keys. MAP will not reuse keys from another configured panel. For production, use the interactive configurator or a secret store. See [Configuration](docs/configuration.md).

## Supported panel providers

| Provider | API mode | Support level |
| --- | --- | --- |
| [Pterodactyl](https://docs.pterodactyl.io/v1/api) 1.x | `client` / `application` | Dedicated server tools and generic API; Client server listing uses the older `GET /api/client` route. Admin API is unavailable in 1.x. |
| [Pterodactyl](https://docs.pterodactyl.io/v2/api) 2.x | `client` / `application` / `admin` | Dedicated server tools plus the 2.x Admin namespace when configured. |
| [Pelican Panel](https://pelican.dev/docs/panel/advanced/api-docs/) | `client` / `application` | Pterodactyl-compatible Client/Application APIs. |
| [Calagopus](https://calagopus.com/docs/) | `native` | Generic/native REST adapter with default prefix `/api`; its API and keys are not compatible with Pterodactyl. The native API reference is available on each Calagopus panel at `/api`. |
| [MCSManager](https://docs.mcsmanager.com/apis/api_instance.html) 10.x | `native` | Dedicated instance list, start/stop/restart/kill, command, and output-log tools; native REST access for other endpoints. MCSManager 9.x has API differences, so verify endpoints against your installed version. |
| [Crafty Controller](https://docs.craftycontrol.com/pages/developer-guide/api-reference/v2/) API v2 | `native` | Generic REST adapter, default prefix `/api/v2`, configurable auth header/scheme or other supported auth mode. |
| [PufferPanel](https://docs.pufferpanel.com/en/2.x/guides/common-problems.html) 2.x | `native` | Generic REST adapter with OAuth2 client-credentials token refresh, or a directly supplied bearer token. |
| [CubeCoders AMP](https://github-wiki-see.page/m/CubeCoders/AMP/wiki/Developers%3A-How-do-I-start-working-with-AMP%27s-API%3F) | `native` | Session-based native API: MAP logs in and caches SESSIONID for POST JSON calls. Requires a least-privilege AMP account; no API key is assumed. |
| Other HTTPS REST panels | `native` | Generic adapter with configurable API prefix and `bearer`, `header`, `query`, `basic`, `oauth2_client_credentials`, or `none` auth plus optional custom headers. Provider-specific actions need an adapter and tests before MAP claims native tool support. |

Use `api="native"` for MCSManager, Crafty, PufferPanel, Calagopus, AMP, and generic REST requests. For Pterodactyl/Pelican, use the corresponding API namespace. Calagopus uses its own native API and its keys must be regenerated after migration. AMP uses session authentication, and generic REST profiles also support HTTP Basic authentication. See [provider configuration](docs/configuration.md) and [tool reference](docs/tools.md).

## Deployment and security

MAP binds to loopback by default. Never expose plaintext HTTP directly to the Internet. For remote access, use HTTPS termination, a strong random bearer token, firewall restrictions, and any additional access control required by your environment. Docker Compose binds to host loopback and requires a bearer token.

MAP is **not** an SSH server and does not grant root access to its host or Wings nodes. Its authority is limited to configured Pterodactyl API credentials and permissions.
MAP is **not** an SSH server and does not grant root access to its host or Wings nodes. Its authority is limited to the configured provider's API credentials and permissions.

- [Security model](docs/security.md)
- [Docker and systemd deployment](docs/deployment.md)
Expand All @@ -96,7 +112,9 @@ MAP is **not** an SSH server and does not grant root access to its host or Wings

## API compatibility

Pterodactyl 1.x documents Client and Application APIs. Pterodactyl 2.x documents Client, Application, and Admin APIs, with different key requirements. MAP does not invent missing endpoints: consult docs for your installed panel version and use supported namespaces. See official [1.x API docs](https://docs.pterodactyl.io/v1/api) and [2.x API docs](https://docs.pterodactyl.io/v2/api).
MAP intentionally keeps Pterodactyl 1.x support. Both 1.x and 2.x expose Client and Application APIs; Admin is a 2.x API. Configure `panel_version: "1.x"` to reject Admin calls locally, or `auto` when the version is unknown. The generic API tool does not invent endpoints: check the documentation for the exact panel and version.

Official references: [AMP API guide](https://github-wiki-see.page/m/CubeCoders/AMP/wiki/Developers%3A-How-do-I-start-working-with-AMP%27s-API%3F), [Calagopus migration notes](https://calagopus.com/docs/additional/migrations/pterodactyl/standalone), [Pterodactyl 1.x](https://docs.pterodactyl.io/v1/api), [Pterodactyl 2.x](https://docs.pterodactyl.io/v2/api), [MCSManager API](https://docs.mcsmanager.com/apis/api_instance.html), [Crafty API v2](https://docs.craftycontrol.com/pages/developer-guide/api-reference/v2/), and [PufferPanel OAuth2 guidance](https://docs.pufferpanel.com/en/2.x/guides/common-problems.html).

## Development

Expand Down
Loading
Loading