# MCP Server Security, Tool Poisoning & Rug-Pull Scanner (`aegisaudit/mcp-server-security-scanner`) Actor

Scan remote Streamable HTTP MCP servers and tool manifests for OWASP MCP03 tool poisoning, hidden prompt injection, credential exfiltration, stealth Unicode injections, and SHA-256 TOFU rug-pull drift. $0 start fee, $0 on unreachable endpoints.

- **URL**: https://apify.com/aegisaudit/mcp-server-security-scanner.md
- **Developed by:** [AegisAudit](https://apify.com/aegisaudit) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$15.00 / 1,000 audited mcp servers

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## MCP Server Security & Rug-Pull Scanner (OWASP MCP Top 10)

Deterministic OWASP MCP security scanner, **Tool Poisoning (MCP03)** detector, and **SHA-256 TOFU Rug-Pull Drift Monitor** for remote Model Context Protocol (MCP) endpoints and inline JSON tool manifests.

### What It Audits

1. **Remote & Inline Discovery**: Probes `POST` Streamable HTTP / JSON-RPC (`tools/list`), `GET /.well-known/mcp.json`, or raw inline tool definitions.
2. **MCP03 Hidden Prompt Injection & Tool Poisoning**: Detects `<IMPORTANT>`, `<system>`, override directives, and user-concealment clauses embedded inside tool descriptions or schemas.
3. **MCP03 Credential & Secret Exfiltration**: Flags references to `~/.ssh`, `id_rsa`, `.aws/credentials`, `.env`, private keys, or unauthorized outbound HTTP fetch instructions.
4. **MCP03 Cross-Tool Shadowing**: Catches instructions trying to intercept or substitute sibling MCP tools.
5. **MCP06 Stealth Unicode Attacks**: Identifies zero-width (`U+200B..U+206F`) and Unicode Tag (`U+E0000..E007F`) smuggling payloads.
6. **MCP04 TOFU Rug-Pull Drift**: Computes a deterministic canonical `manifestHashSha256` across all tool schemas/descriptions and compares it against optional `baselineHashes`.
7. **MCP01 & MCP02 Transport / Privilege Surface**: Flags unencrypted `http://` MCP endpoints and high-privilege shell/exec/write tools.

### Transparent Pay-Per-Event Pricing

- **$0.015 per audited MCP server (`mcp-server-audited`)** = $15.00 per 1,000 audits.
- **$0.00 start fee**, and **$0.00 charge** when a remote target is `unreachable` or returns zero valid tools.

### Ready-to-Import n8n, Make.com & Clay Templates

Automate daily OWASP MCP03 tool-poisoning checks and SHA-256 baseline drift alerts without writing boilerplate code (MIT-licensed, built-in nodes only):

- **n8n Workflow JSON:** [04-mcp-server-security-rug-pull-gate.json](https://github.com/Goatincrypto/apify-b2b-lead-workflows/blob/main/workflows/04-mcp-server-security-rug-pull-gate.json)
- **Make.com 1-Click Blueprint:** [03-mcp-server-security-rug-pull-gate.make.json](https://github.com/Goatincrypto/apify-b2b-lead-workflows/blob/main/make-blueprints/03-mcp-server-security-rug-pull-gate.make.json)
- **Clay.com HTTP API Setup:** [clay-and-make-setup.md](https://github.com/Goatincrypto/apify-b2b-lead-workflows/blob/main/guides/clay-and-make-setup.md)

### Companion REST & x402 API

Prefer a direct API endpoint or AI-agent x402 micropayment? Use the hosted engine at <https://aegisaudit.org/api/v1/mcp/audit> or test free previews at <https://aegisaudit.org/api/v1/mcp/preview>.

# Actor input Schema

## `serverUrls` (type: `array`):

List of public https:// Streamable HTTP MCP endpoints (e.g. https://aegisaudit.org/mcp) or /.well-known/mcp.json manifest URLs. Strictly read-only initialize + tools/list; NEVER executes tools/call. $0.00 on unreachable URLs.

## `inlineToolManifests` (type: `array`):

Optional array of static MCP server manifests ({ name?, tools: \[{ name, description, inputSchema }] }) to scan locally in CI/CD before deploying internal MCP servers.

## `baselineHashes` (type: `object`):

Optional map of { "serverUrl": "previousManifestHashSha256" } to automatically trigger RUG_PULL_SCHEMA_DRIFT_DETECTED if a server alters tool descriptions or schemas at runtime.

## `concurrency` (type: `integer`):

Maximum number of concurrent MCP server audits (1 to 20).

## `requestTimeoutMs` (type: `integer`):

Per-request HTTP timeout in milliseconds (3000 to 30000).

## Actor input object example

```json
{
  "serverUrls": [
    "https://aegisaudit.org/mcp",
    "https://aegisaudit.org/.well-known/mcp.json"
  ],
  "concurrency": 5,
  "requestTimeoutMs": 10000
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "serverUrls": [
        "https://aegisaudit.org/mcp",
        "https://aegisaudit.org/.well-known/mcp.json"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aegisaudit/mcp-server-security-scanner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "serverUrls": [
        "https://aegisaudit.org/mcp",
        "https://aegisaudit.org/.well-known/mcp.json",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("aegisaudit/mcp-server-security-scanner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "serverUrls": [
    "https://aegisaudit.org/mcp",
    "https://aegisaudit.org/.well-known/mcp.json"
  ]
}' |
apify call aegisaudit/mcp-server-security-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aegisaudit/mcp-server-security-scanner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/u35EFMbXjbFpX0Fwb/builds/DzQU90Ng7gRtly5d0/openapi.json
