# MCP Tool Contract, Agent Readiness & x402 Compliance Auditor (`piksen_digital/mcp-tool-contract`) Actor

Audits MCP endpoints, OpenAPI specifications, and Apify Actors for tool contracts, agent readiness, x402 payment requirements, Store metadata, and security risks.

- **URL**: https://apify.com/piksen_digital/mcp-tool-contract.md
- **Developed by:** [George Chapungu](https://apify.com/piksen_digital) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $160.00 / 1,000 mcp tool contracts

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Tool-Contract, Agent-Readiness & x402 Auditor

Use this Actor to audit remote MCP endpoints, OpenAPI 3.0/3.1 specifications, and published Apify Actors. Review structured findings for agent readiness, contract quality, and CI.

### What it checks

- MCP tool discovery and tool metadata
- JSON Schema input contracts and constrained string fields
- Operation IDs and parameter descriptions
- Missing agent-facing descriptions
- `readOnlyHint` and `openWorldHint` conflicts
- x402 payment declarations
- MCP HTTP response content types
- OpenAPI versions and operation structure
- Apify Actor Store metadata and input schemas

### Configure your audit

| Field | Description | Default |
|---|---|---|
| `targets` | MCP, OpenAPI, or Apify Actor targets | Required |
| `checks` | Audit categories | All categories |
| `failOn` | Severity that makes the run fail | `none` |
| `exportFormats` | Reports to generate | `summary`, `sarif`, `junit` |
| `requestTimeoutSecs` | Per-request timeout | `30` |
| `maxRedirects` | Maximum HTTP redirects | `5` |
| `includePassingChecks` | Include passed checks in reports | `true` |
| `dryRun` | Skip network access | `false` |

#### Choose your targets

- **OpenAPI:** Provide a complete URL to a plain-text JSON or YAML specification, not a bare domain, landing page, or binary image file. For example: `https://raw.githubusercontent.com/owner/repository/main/openapi.json`.
- **MCP:** Provide a reachable HTTP(S) endpoint. The audit performs an HTTP GET and checks the response headers and body for MCP metadata and a parseable tools list; it does not send a JSON-RPC `tools/list` POST request. POST-only endpoints may therefore produce a response-format warning or fail to expose their tools.
- **Apify Actors:** Provide the fully qualified `owner/name` Actor ID, such as `apify/website-content-crawler`.

`failOn` controls whether findings make the Actor run fail, not whether findings are written. With `failOn: "none"` (the default), findings are still saved to the Dataset and reports, while the run succeeds if execution and output storage complete. Invalid input, runtime errors, and output-storage failures still fail the run.

### Example configuration

```json
{
  "targets": [
    { "type": "openapi", "name": "Pet API", "url": "https://example.com/openapi.json" },
    { "type": "mcp", "name": "MCP server", "url": "https://mcp.example.com/mcp" },
    { "type": "apify-actor", "name": "Sample Actor", "actorId": "owner/sample-actor" }
  ],
  "checks": ["contracts", "agent-ready", "x402", "store", "security"],
  "failOn": "high",
  "exportFormats": ["summary", "sarif", "junit"],
  "requestTimeoutSecs": 30,
  "includePassingChecks": true,
  "dryRun": false
}
```

### Your results

- Default Dataset: one item per check or finding
- `SUMMARY.md`: human-readable summary
- `results.sarif`: SARIF 2.1.0 for code scanning
- `junit.xml`: JUnit XML for CI test reporters
- `results.json`: complete structured findings
- `OUTPUT`: summary counts and report names

### GitHub Actions

Upload the SARIF output to GitHub code scanning after downloading or forwarding the run's Key-Value Store record:

```yaml
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif
```

Use the generated JUnit XML with your CI test publisher, or inspect `junit.xml` directly.

### Pay Per Event

Configure these events in the Actor Store monetization UI:

| Event name | Title | Description | Suggested price |
|---|---|---|---:|
| `audit-complete` | Completed audit | Charged once after an audit finishes successfully | $0.25 |
| `target-audited` | Audited target | Charged for each MCP, OpenAPI, or Actor target audited | $0.10 |
| `finding-created` | Audit finding | Charged for each emitted actionable finding | $0.02 |
| `report-exported` | Report export | Charged once for each generated report | $0.05 |

The runtime charges `audit-complete` once after a completed run, `target-audited` for each successfully audited target, `finding-created` for each emitted warning or failure, and `report-exported` for each generated report (`results.json` and each selected additional format).

# Actor input Schema

## `targets` (type: `array`):

Add one or more MCP endpoints, OpenAPI specifications, or Apify Actors.

## `checks` (type: `array`):

Choose the compliance categories to run.

## `failOn` (type: `string`):

Return a non-zero exit code when findings reach this severity.

## `exportFormats` (type: `array`):

Additional report formats to write to the Key-Value Store.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for each network request, in seconds.

## `maxRedirects` (type: `integer`):

Maximum number of HTTP redirects to follow before failing the request.

## `proxyConfiguration` (type: `object`):

Proxy servers used by the Actor to hide its origin IP. Leave disabled for direct connections.

## `includePassingChecks` (type: `boolean`):

Include successful checks in the dataset and SUMMARY report alongside warnings and errors.

## `dryRun` (type: `boolean`):

Validate configurations, pathing formats, and fields without executing external network calls.

## Actor input object example

```json
{
  "targets": [
    {
      "type": "openapi",
      "url": "https://example.com/openapi.json",
      "name": "Example API"
    }
  ],
  "checks": [
    "contracts",
    "agent-ready",
    "x402",
    "store",
    "security"
  ],
  "failOn": "none",
  "exportFormats": [
    "summary",
    "sarif",
    "junit"
  ],
  "requestTimeoutSecs": 30,
  "maxRedirects": 5,
  "includePassingChecks": true,
  "dryRun": false
}
```

# Actor output Schema

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

No description

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

No description

## `sarif` (type: `string`):

No description

## `junit` (type: `string`):

No description

## `json` (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 = {
    "targets": [
        {
            "type": "openapi",
            "url": "https://example.com/openapi.json",
            "name": "Example API"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("piksen_digital/mcp-tool-contract").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 = { "targets": [{
            "type": "openapi",
            "url": "https://example.com/openapi.json",
            "name": "Example API",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("piksen_digital/mcp-tool-contract").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 '{
  "targets": [
    {
      "type": "openapi",
      "url": "https://example.com/openapi.json",
      "name": "Example API"
    }
  ]
}' |
apify call piksen_digital/mcp-tool-contract --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,piksen_digital/mcp-tool-contract"
        }
    }
}
```

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/qqKssLvLzmaSFD0YP/builds/VZckHfUjqKYksC5Ma/openapi.json
