Skip to main content
Codex is OpenAI’s AI coding agent. When connected to Nekt through the MCP Server, it can query and analyze your data directly from the CLI. The connection uses bearer token authentication via an environment variable.
Requires a paid Nekt plan (for MCP Server access) and the Codex CLI installed (codex command available).

1. Activate your MCP Server

The connection is made by activating the MCP Server in your workspace. Check this guide for instructions.

2. Get your endpoint and token

Go to Integrations > MCP Server in the Nekt platform. You’ll need two values:
  • Endpoint — the MCP server URL displayed at the top of the page
  • Token — a bearer token created in the MCP Tokens section
If you don’t have a token yet, create one. You can scope it to specific tables or grant full access.
Tokens created manually can be scoped to specific tables for fine-grained access control. Tokens grant Codex access only to the tables associated with that token.

3. Connect Codex to Nekt

1

Set your token as an environment variable

Export the token in your current shell session:
export NEKT_MCP_BEARER_TOKEN="YOUR_TOKEN_HERE"
To persist it across sessions, add it to your shell profile:
echo 'export NEKT_MCP_BEARER_TOKEN="YOUR_TOKEN_HERE"' >> ~/.zshrc
source ~/.zshrc
2

Add the Nekt MCP server

You can register the MCP server using the CLI or by editing the configuration file directly.Option A — Using the CLI:
codex mcp add nekt --url https://mcp.nekt.com/mcp --bearer-token-env-var NEKT_MCP_BEARER_TOKEN
Option B — Editing the configuration file:Open ~/.codex/config.toml and add the following block:
[mcp_servers.nekt]
url = "https://mcp.nekt.com/mcp"
bearer_token_env_var = "NEKT_MCP_BEARER_TOKEN"
3

Verify the connection

Confirm the server was registered correctly:
codex mcp list
codex mcp get nekt --json
The server nekt should appear as enabled, with the URL https://mcp.nekt.com/mcp and auth mode showing bearer token via env var.You can also ask Codex to list the available Nekt tools to confirm the connection is working. You should see the nine tools provided by the Nekt MCP Server. You can learn more about them here.
The OAuth login flow (codex mcp login nekt) is not supported for Nekt. Use bearer token authentication as described above.

4. Explore your data

Once connected, ask Codex a question about your data. For example:
Using Nekt, give me a summary of the your_table_name table.
Codex will use the MCP tools to query your data and return an answer.
We’d love to know what you’re building with Nekt! Share your projects with us through any of our communication channels.

Privacy & Security

Your data privacy is a core principle of the Nekt platform. When you connect Codex to Nekt through the MCP Server, Codex does not receive direct database credentials or unrestricted access to your infrastructure. Instead, Codex interacts with your data exclusively through the secure tools exposed by the Nekt MCP Server, which act as a controlled gateway to the Nekt API. These tools enforce the same authentication, authorization, and permission rules used throughout the Nekt platform. Access is scoped using tokens and user permissions, meaning Codex can only access the tables and actions explicitly allowed by the token you configured. This architecture ensures that all queries, analysis, and data interactions remain governed, auditable, and restricted to your workspace permissions. When using Codex, your interactions are subject to OpenAI’s privacy settings and policies. We recommend reviewing the official OpenAI privacy documentation to understand their data handling policies and selecting the configuration that best aligns with your organization’s security requirements.

Need help?

Contact our support team if you encounter issues during setup.