Skip to main content
Glama
quillshield-mcp

quillshield-mcp

Official
README.md
# QuillShield MCP server

Run [QuillShield](https://www.quillaudits.com/quillshield/) smart contract audits from Cursor, Claude Desktop or any MCP client. The agent calls tools instead of clicking through the dashboard, with the same pricing and coupons: list projects and audits, read findings and reports, quote an audit and pay it from your prepaid wallet.

- npm: [`@quillaudits/mcp`](https://www.npmjs.com/package/@quillaudits/mcp)
- MCP Registry: `com.quillaudits/mcp`
- Guide: [MCP for Cursor and Claude](https://www.quillaudits.com/quillshield/developers/mcp-for-cursor-and-claude)

This repository is the server's source code. Releases of `@quillaudits/mcp` on npm are built from QuillAudits' main repository, and the source of each release is copied here (this is 0.1.0).

## Setup

1. Create an API key at [shield.quillaudits.com](https://shield.quillaudits.com): **Settings → API keys → Create key**. The page shows a ready-made `mcp.json` block.
2. Add the server to your MCP client (Cursor MCP settings or Claude Desktop config):

```json
{
  "mcpServers": {
    "quillaudits": {
      "command": "npx",
      "args": ["-y", "@quillaudits/mcp"],
      "env": {
        "QUILLSHIELD_API_KEY": "qs_live_YOUR_KEY",
        "QUILLSHIELD_API_URL": "https://api-production-7027.up.railway.app"
      }
    }
  }
}
```

3. If you plan to start audits, top up your prepaid balance under **Billing**.
4. Ask the agent, for example: *List my QuillAudits projects* or *Check my QuillAudits wallet*.

Requires Node.js 18+.

## Environment

| Variable | Required | Default |
|---|---|---|
| `QUILLSHIELD_API_KEY` | Yes | — (an org API key, `qs_live_…`) |
| `QUILLSHIELD_API_URL` | No | `https://api-production-7027.up.railway.app` |
| `QUILLSHIELD_ORG_ID` | No | The key's organization |

Without a key the server still starts and lists its tools; every call then returns a "Not configured" error.

## Tools

**Read:** `list_projects`, `list_versions`, `list_audits`, `get_audit`, `list_findings`, `get_report`, `get_wallet`, `get_quote`, `get_order`, `list_orders`, `watch_audit` (polls an audit for a short time per call).

**Write:** `submit_audit`, `create_quote`, `apply_coupon`, `remove_coupon`, `pay_quote`, `start_audit`, `cancel_audit`.

A typical run: `get_wallet` → `submit_audit` (`pay: false`) → optional `apply_coupon` → `pay_quote` (`confirm: true`) → `watch_audit` → `list_findings` / `get_report`.

## Payments

The agent can only spend prepaid wallet credit. Cards, Stripe checkout and top-ups stay in the dashboard.

| Quote's `final_price_cents` | What happens |
|---|---|
| `0` (the wallet covers it) | `pay_quote` or `submit_audit` spends the credit only with `confirm: true`; without it they return `confirm_required` and spend nothing |
| `> 0` | The tool returns `wallet_topup_required` with a link to [top up](https://shield.quillaudits.com/topup) |

Spending uses the wallet of the organization's owner, the same as the CLI.

## Source layout

| Path | What it is |
|---|---|
| `src/index.ts`, `src/run.ts` | Entry point: starts the server on stdio |
| `src/server.ts` | The MCP tools and their input schemas |
| `src/wallet-pay.ts` | Quote and wallet payment rules |
| `src/config.ts`, `src/result.ts` | Settings and tool results |
| `src/cli/` | The QuillShield API client, config file reading and folder zipping, shared with the QuillShield CLI (`@quillaudits/cli`) |
| `src/*.test.ts` | Tests |

## Develop

Needs [Bun](https://bun.sh) 1.3+.

```bash
bun install
bun test
bun run typecheck
bun run build        # dist/mcp.js, runs on Node.js 18+
```

## Docker

```bash
docker build -t quillshield-mcp .
docker run -i --rm -e QUILLSHIELD_API_KEY=qs_live_YOUR_KEY quillshield-mcp
```

## License

MIT. See [LICENSE](LICENSE).