# Codex

Use VPNDetection in Codex, its IDE extension and the ChatGPT desktop app: install the plugin, sign in with your account, and check addresses from your work.

Codex can check IP addresses, look into any of the VPNDetection databases and tell you which ones your organization holds. It connects to the hosted VPNDetection MCP server, `https://mcp.vpndetection.io/mcp`, you sign in with your VPNDetection account, and every tool is read-only.

Codex never sees your API key. When you sign in, you pick one of your organization's keys, and the server makes each request with it on your behalf, so every call counts against that key's plan as any API call does. The Codex CLI, its IDE extension and Codex in the ChatGPT desktop app read the same configuration, so one install covers all three.

## Before you begin

- Codex, in its CLI, its IDE extension or the ChatGPT desktop app.
- A VPNDetection account. You don't need a paid plan: on the free plan, your organization's first 1,000 lookups each UTC day return every field, and past them each lookup returns a `quota_exceeded` error that still carries the basics, which are `ip` with Tor and relay detection, whether the address is anycast, its reverse DNS name, where it is and the network that announces it, without `is_vpn`.
- The permission to share your organization's API keys. Approving the connection needs it, and asks you to confirm it's you.

## Install the plugin

The VPNDetection plugin adds the server with skills for checking addresses, screening a signup or order export, and working with the databases. It's in the [plugin directory](https://chatgpt.com/plugins/plugin_asdk_app_6accd4f290588191a74086b26d749253) Codex shares with ChatGPT, and it installs from the command line too:

1. Add the marketplace and install the plugin, then sign in:

   ```console
   codex plugin marketplace add vpndetection-io/openai-plugin
   codex plugin add vpndetection@vpndetection
   codex mcp login vpndetection
   ```

2. The last line opens your browser. Sign in with your VPNDetection account.
3. Under **Use this key:**, pick which of your organization's API keys Codex uses, and click **Approve**.

Once it's connected, ask something like *"Is 45.83.91.1 a VPN?"*.

### Add the server alone

To add the server alone, without the skills:

```bash
codex mcp add vpndetection --url https://mcp.vpndetection.io/mcp
```

Codex opens your browser to sign in as soon as it adds the server. If it doesn't, or you stop it there, `codex mcp login vpndetection` signs you in later.

## What the plugin adds

| Skill | What it does |
|---|---|
| `check-ips` | Checks one address or a list, and reads the result's `coverage` so a field your plan doesn't include is never reported as a "no". |
| `review-traffic` | Screens a signup, login or order export and keeps each verdict next to the record it came from. |
| `database-files` | Answers which databases you hold, how big they are, whether your copy is intact and why a download failed. |
| `analyze-database` | Explains a database's columns and sample rows, and in Codex analyzes a downloaded copy. |

## What you can ask

Ask in your own words, and Codex picks the tool that answers. For example:

- *"Is 45.83.91.1 a VPN?"*
- *"Here's yesterday's signup export. Which accounts came from proxies or Tor?"*
- *"Which databases are we licensed for, and how big is the latest VPN build?"*

Behind those answers are the server's lookup, plan and database tools, which [MCP Server](/integrations/mcp) describes one by one.

## Connect with your own key

To send a key yourself instead of signing in, keep it in an environment variable and add the server with `--bearer-token-env-var VPNDETECTION_API_KEY`. On the OpenAI API, the Responses API's `mcp` tool takes `https://mcp.vpndetection.io/mcp` as its `server_url` and the key as its `authorization`.

## Disconnect

To disconnect, run `codex mcp logout vpndetection`, or remove it in the console under **Settings** > **Sessions & devices** > **Connected applications**, where **Disconnect** ends its access. Access ends within about a minute.

## Troubleshoot

| Symptom | What to do |
| --- | --- |
| The browser doesn't open to sign in. | Run `codex mcp login vpndetection` to sign in. |
| The console says "You do not have permission to share an API key from this organization." | Your role can't share your organization's API keys. Ask an owner for that permission, then sign in again. |
| The console says the key "only accepts certain IP addresses". | The key has **Allowed source addresses** set, so only someone who can manage API keys can share it. Pick another key, or ask one of them. |
| A key can't be picked, because its secret was never stored. | The key predates retrievable keys. Rotate it in the console, under **API** > **Keys**, to get one that can be shared. |
| A lookup returns `quota_exceeded`. | Your organization's lookups with every field are used: on the free plan, its first 1,000 of the UTC day, and on a paid plan, its quota with overage off or its overage cap. The error still carries the basics, without `is_vpn` and the other fields a paid plan answers, until the lookups reset at 00:00 UTC or with the next period. A [paid plan](https://vpndetection.io/pricing) answers every field on every lookup. |
| A long list of addresses comes back refused. | Checking a list in one call needs a key on a paid plan. With a key on the free plan, a short list is checked one address at a time. |

## Next steps

Codex can now check addresses and look into the databases while you work. To connect another MCP client, or to see what each tool answers, read [MCP Server](/integrations/mcp). To check addresses from your own code, use a [programming SDK](/integrations/languages).
