Secure MCP server for the NeuroVerify media authenticity API
Project description
neuraldefend-mcp
Secure, stdio-only MCP tools for image and video authenticity analysis through the NeuroVerify Python SDK.
Install
python -m pip install neuraldefend-mcp
The package provides both neuraldefend-mcp and python -m neuraldefend_mcp.
Required security configuration
Set both variables in the MCP server process:
NEURALDEFEND_API_KEY: the NeuralDefend API key. It is read only from the environment and is never a tool argument.NEURALDEFEND_MCP_ALLOWED_DIRS: one or more absolute directories that the server may read. Separate directories with the platform path separator:;on Windows and:on macOS/Linux.
The server refuses to start when the allowlist is missing or invalid. Filesystem roots, file paths, relative paths, empty entries, and roots containing symlinks, junctions, or reparse points are rejected. At tool invocation time, the requested file must be a regular, non-empty file below an allowed directory and must not traverse any link or reparse point.
Optional: NEURALDEFEND_MCP_MAX_CONCURRENCY is a positive integer from 1 through 32 and
defaults to 2.
Optional: NEURALDEFEND_MCP_ENVIRONMENT selects the API origin. It accepts only
production (the default) or staging; arbitrary URLs are rejected. Use staging for
non-production integration tests.
Only configure directories containing media that users have explicitly authorized for upload. Media may contain biometric and other sensitive personal data.
MCP client configuration
Windows example:
{
"mcpServers": {
"neuraldefend": {
"command": "neuraldefend-mcp",
"env": {
"NEURALDEFEND_API_KEY": "${NEURALDEFEND_API_KEY}",
"NEURALDEFEND_MCP_ALLOWED_DIRS": "D:\\Authorized Media;E:\\Review Queue"
}
}
}
}
macOS/Linux example:
{
"mcpServers": {
"neuraldefend": {
"command": "neuraldefend-mcp",
"env": {
"NEURALDEFEND_API_KEY": "${NEURALDEFEND_API_KEY}",
"NEURALDEFEND_MCP_ALLOWED_DIRS": "/srv/authorized-media:/home/user/review-queue"
}
}
}
}
If the MCP client does not expand ${NEURALDEFEND_API_KEY}, use its supported secret
injection mechanism. Do not place a real key in a committed configuration file.
Tools
detect_image_authenticity(file_path)analyzes an image containing one clearly visible face.detect_video_authenticity(file_path, max_frames=12)analyzes video and audio independently.max_framesmust be from 1 through 100.
Business rejections are normal tool results. “Could not score” means the media was unscorable, not that it was authentic, and a rejected invocation should not be retried automatically. A high risk result should be escalated for review rather than used as an automatic rejection. Low risk is not definitive proof of authenticity.
Each tool call can create a new, billable transaction, including some face-policy rejections. Agents should disclose that possibility before invoking a tool and should never repeat a call merely to obtain a different score or message.
The Python SDK owns network retry behavior; this MCP layer adds no retries. It opens each local file once, validates the open handle, and streams that same handle to the SDK without loading a video into memory. Tool output contains a bounded, versioned field allowlist and never includes local paths, filenames, media bytes, response headers, or the SDK raw payload.
Development
python -m pip install -e ".[dev]"
pytest
ruff check .
mypy
python -m build
twine check dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neuraldefend_mcp-1.0.0.tar.gz.
File metadata
- Download URL: neuraldefend_mcp-1.0.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889205d4a4aed6b3c58f3248a094f7bddd926cc402523e495d27437fd04a3a8b
|
|
| MD5 |
6af18597a916480f30040f85546c33db
|
|
| BLAKE2b-256 |
4922fe9ae08a4766dff72466aaaf1c61105256b53d5b7f23bfd73407dbc46c9b
|
Provenance
The following attestation bundles were made for neuraldefend_mcp-1.0.0.tar.gz:
Publisher:
release-mcp.yml on Neural-Defend/NeuralDefend-SDKs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
neuraldefend_mcp-1.0.0.tar.gz -
Subject digest:
889205d4a4aed6b3c58f3248a094f7bddd926cc402523e495d27437fd04a3a8b - Sigstore transparency entry: 2256521220
- Sigstore integration time:
-
Permalink:
Neural-Defend/NeuralDefend-SDKs@851dfcbecba45cfca3ce79efa5a4d851de45b76d -
Branch / Tag:
refs/tags/mcp-v1.0.0 - Owner: https://github.com/Neural-Defend
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mcp.yml@851dfcbecba45cfca3ce79efa5a4d851de45b76d -
Trigger Event:
push
-
Statement type:
File details
Details for the file neuraldefend_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: neuraldefend_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab16a33a404bc4d0732d1ec3f44b9cbdf0773f7ec53a35f69aba9b217bfe3677
|
|
| MD5 |
54d7bc5a317c32f53a0de7851a8f11d0
|
|
| BLAKE2b-256 |
88037434de6d63a7a36955198a900fbcc35400d3be415c9651dc33ccb9a0a876
|
Provenance
The following attestation bundles were made for neuraldefend_mcp-1.0.0-py3-none-any.whl:
Publisher:
release-mcp.yml on Neural-Defend/NeuralDefend-SDKs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
neuraldefend_mcp-1.0.0-py3-none-any.whl -
Subject digest:
ab16a33a404bc4d0732d1ec3f44b9cbdf0773f7ec53a35f69aba9b217bfe3677 - Sigstore transparency entry: 2256521221
- Sigstore integration time:
-
Permalink:
Neural-Defend/NeuralDefend-SDKs@851dfcbecba45cfca3ce79efa5a4d851de45b76d -
Branch / Tag:
refs/tags/mcp-v1.0.0 - Owner: https://github.com/Neural-Defend
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mcp.yml@851dfcbecba45cfca3ce79efa5a4d851de45b76d -
Trigger Event:
push
-
Statement type: