CTFdSAFE
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/umbra2728/ctfd-mcp/releases) [](LICENSE) [](https://www.python.org/downloads/) [](https://github.com/umbra2728/ctfd-mcp/issues)
MCP server that lets a regular CTFd user list challenges, read details, start/stop dynamic docker instances, and submit flags.
Requirements
- Python 3.13 (managed by
uv). - Environment variables (choose one auth method):
CTFD_URL(e.g. )CTFD_TOKEN(user token, not admin) orCTFD_SESSION(session cookie if tokens are disabled).CTFD_CSRF_TOKEN(optional, only if the server/plugin requires CSRF for ctfd-owl).
You can store them in a .env file in the repo root:
CTFD_URL=https://ctfd.example.com/ CTFD_USERNAME=your_username CTFD_PASSWORD=your_password # or, if you prefer to use a token: # CTFD_TOKEN=your_ctfd_api_token_here # or, if tokens are disabled: # CTFD_SESSION=your_session_token_here # and, if the owl plugin enforces CSRF: # CTFD_CSRF_TOKEN=your_csrf_token_here
Install
- From PyPI (recommended):
uvx ctfd-mcp --help - From source checkout (no install):
uvx --from . ctfd-mcp --help
Run MCP server (stdio)
# installed from PyPI uvx ctfd-mcp # from local checkout uvx --from . ctfd-mcp
Cursor and Claude MCP config example
{
"mcpServers": {
"ctfd-mcp": {
"command": "uvx",
"args": ["ctfd-mcp"],
"env": {
"CTFD_URL": "https://ctfd.example.com",
"CTFD_TOKEN": "your_user_token"
}
}
}
}Codex MCP config example
[mcp_servers.ctfd-mcp] command = "uvx" args = ["ctfd-mcp"] [mcp_servers.ctfd-mcp.
53ce7e21870cOBSERVED · 2026-10-09Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add ctfd-mcp --env CTFD_CSRF_TOKEN=${CTFD_CSRF_TOKEN} --env CTFD_PASSWORD=${CTFD_PASSWORD} --env CTFD_TOKEN=${CTFD_TOKEN} -- uvx ctfd-mcp{
"mcpServers": {
"ctfd-mcp": {
"command": "uvx",
"args": [
"ctfd-mcp"
],
"env": {
"CTFD_CSRF_TOKEN": "${CTFD_CSRF_TOKEN}",
"CTFD_PASSWORD": "${CTFD_PASSWORD}",
"CTFD_TOKEN": "${CTFD_TOKEN}"
}
}
}
}Exposed tools (3)
1 read · 2 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
list_challenges | read | client = await _get_client() |
stop_container | write | client = await _get_client() |
submit_flag | write | client = await _get_client() |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (5 observation(s))
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (1)
.pre-commit-config.yaml
Gates applied: no_behavioural_pass.
53ce7e21870cfull audit observations/trust-audit/mcp-server/umbra2728__ctfd-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-09 | 53ce7e21870c | SAFE | B | 89 | first audit |
Questions
What tools does CTFd expose?
3 in total: 1 read-only, 2 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is CTFd safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does CTFd need?
It reads CTFD_CSRF_TOKEN, CTFD_PASSWORD and CTFD_TOKEN from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How current is this page?
The grade is for one exact copy of the source (53ce7e21870c), read on 2026-10-09. The repository is watched and re-audited when it changes.