mcp-botnex
MCP (Model Context Protocol) server for BotNEX — exposes VAPT scans,
reports, and CVE intelligence to AI clients such as Cursor and the NEXA
platform. It is a thin, secure bridge to the existing botnex-backend REST
API and authenticates with a user-scoped API token (no JWT).
Full documentation: docs/BOTNEX_MCP_SERVER.md
NEXA integration context: ../botnex-backend/docs/NEXA_INTEGRATION.md
Features
- 8 tools for scan lifecycle, reports, and CVE lookup
- 6 resources (
botnex://…) for@-mentionable context in Cursor - Dual transport: stdio (Cursor / Claude Desktop) and HTTP (NEXA / Docker)
- API-token auth mapped per-user on the backend — RBAC enforced server-side
- AI-friendly formatters (severity-first findings, normalized CVE output)
Installation
pip install mcp-botnex
Authentication
- Log in to the BotNEX UI.
- Create an API token: API Tokens → Create (calls
POST /api/v1/users/api-tokens/). - Copy the raw token once and provide it to the MCP server via
BOTNEX_API_KEY.
The token is sent as Authorization: Bearer <token> on every backend request.
The backend resolves it to your user account and enforces all authorization
and per-user data scoping.
If Claude or Cursor shows “process exiting early” and the log contains
anyio.create_memory_object_stream / TypeError: 'function' object is not subscriptable,
the API token is not the problem. The official mcp SDK needs AnyIO 4.5+.
Upgrade in the same Python that owns mcp-botnex:
python -m pip install -U "anyio>=4.5" "mcp>=1.9,<2"
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
BOTNEX_BACKEND_URL |
Yes | – | Backend origin, e.g. https://botnex.example.com (no /api/v1) |
BOTNEX_API_KEY |
Yes | – | User API token |
BOTNEX_MCP_SERVER_PORT |
No | 8001 |
HTTP mode port |
BOTNEX_LOG_LEVEL |
No | INFO |
Log level |
BOTNEX_BACKEND_TIMEOUT |
No | 60.0 |
Backend HTTP timeout (s) |
BOTNEX_FINDINGS_PAGE_SIZE |
No | 50 |
Default findings page size |
BOTNEX_SCAN_PAGE_SIZE |
No | 25 |
Default page size for scan list resources |
BOTNEX_CVE_PAGE_SIZE |
No | 20 |
Default page size for botnex://cve/latest |
See .env.example for the full list.
Usage — Cursor (stdio)
Add to your Cursor MCP config:
{
"mcpServers": {
"botnex": {
"command": "mcp-botnex",
"env": {
"BOTNEX_BACKEND_URL": "https://botnex.example.com",
"BOTNEX_API_KEY": "your-api-token"
}
}
}
}
Usage — HTTP (NEXA / Docker)
mcp-botnex-http
# or
uvicorn botnex_mcp.http_server:app --host 0.0.0.0 --port 8001
Endpoints: GET /mcp/tools, POST /mcp/tools/call, GET /mcp/resources,
POST /mcp/resources/read, GET /health.
Tools
| Tool | Description |
|---|---|
list_scans |
List the user's scans and statuses |
trigger_scan |
Start a security or asset-discovery scan |
get_scan_findings |
Paginated, severity-ordered findings for a scan |
get_scan_summary |
Aggregated dashboard summary |
list_scheduled_scans |
Upcoming scheduled scans |
generate_report |
Generate a PDF/CSV/DOCX report |
search_cves |
Full-text CVE search |
get_cve_by_id |
CVE detail by id |
Resources
All list resources are paginated and field-slimmed to keep responses small
and the LLM context cheap. Pagination is controlled with ?page= and
?size= query parameters; size is capped at 100.
| URI | Paginated | Description |
|---|---|---|
botnex://scans/all |
Yes | Slim list of the user's scans |
botnex://scans/summary |
– | Aggregated severity counts and risk metrics |
botnex://scans/scheduled |
Yes | Upcoming scheduled scans |
botnex://scan/{scan_id}/findings |
Yes | Severity-ordered findings for a scan |
botnex://cve/{cve_id} |
– | Compact CVE summary |
botnex://cve/latest |
Yes | Most recently published CVEs |
Examples:
botnex://scans/all?page=2&size=20botnex://scan/<scan_id>/findings?page=2&size=25botnex://cve/latest?page=1&size=10
Paginated resources return:
{"items": [...], "page": 2, "size": 20, "total": 47, "pages": 3, "has_more": true}
Development
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for mcp-botnex 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_botnex-0.1.5.tar.gz | 33.1 kB | Without provenance | Details for mcp_botnex-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_botnex-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for mcp_botnex-0.1.5-py3-none-any.whl |
Total release size: 67.4 kB
Release files / mcp_botnex-0.1.5.tar.gz
| Download URL | mcp_botnex-0.1.5.tar.gz |
|---|---|
| Size | 33.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1075d12d8c49a99439a82c220e150d6245689033b384856932947e8a33f33aec
|
|
BLAKE2b-256 checksum How to use checksums |
fce8ca7f239dac0be1177503769a2916c8941b9fc7b254adf0eb66050ebac0e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / mcp_botnex-0.1.5-py3-none-any.whl
| Download URL | mcp_botnex-0.1.5-py3-none-any.whl |
|---|---|
| Size | 34.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0fb5666b20dd07744e61d027f531a2a035dd4989f2c49d3070234c0cb37b9dc
|
|
BLAKE2b-256 checksum How to use checksums |
cc21aeb980d96f67aa07efe06abee8540de62a2e892708c2633b2322d52d0567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for mcp-botnex 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.