Connect AI Agents with the NIM MCP Server
Developer guides
Give AI agents and MCP-compatible tools controlled access to NIM through the built-in Model Context Protocol server.
NIM includes an embedded MCP server that exposes NIM tools over the Model Context Protocol, so AI agents and MCP clients can work with NIM data and automation directly. Access is administrator-controlled: every request must authenticate with either an API key or an authorized OAuth connection, and both are managed from the same place.
Enable the MCP server
- Go to Configuration → Settings → Preferences.
- Turn on MCP API endpoint enabled.
- If you want to support MCP clients that connect through an OAuth authorization flow (such as ChatGPT's connector flow) rather than an API key, also turn on MCP OAuth 2.1 connector support enabled.
Both settings are off by default. An administrator opening the MCP access panel (see below) while either is disabled sees a warning banner linking back to this settings page.
Manage API keys and connections
Administrators manage MCP access from their account menu:
- Select your account name in the top bar.
- Select MCP access. This option is only visible to administrators.
The MCP access dialog has two tabs:
API Keys
Use an API key to let a script or agent authenticate directly, without an interactive OAuth flow.
- Create a key — enter a description (for example,
Claude agent – production) so you can identify it later, and optionally a lifetime in days. Leave the lifetime empty for a key that never expires. - Copy the key immediately. The full key is only ever shown once, right after creation. If it's lost, delete it and create a new one.
- The list shows each key's description, creation date, last-used date, and expiration date. An expired key is highlighted and can no longer authenticate.
- Select the delete icon next to a key to revoke it immediately.
Use the key in the Authorization header of requests to the MCP endpoint:
Authorization: NimApiKey <key>
MCP Connections
This tab lists applications that have been authorized through the OAuth connector flow (available when MCP OAuth 2.1 connector support enabled is on), showing the application name, granted scope, and expiration.
Select the delete icon next to a connection to revoke its access immediately — the application must be re-authorized to reconnect.
Choosing between an API key and OAuth
| Scenario | Recommended approach |
|---|---|
| A script, agent, or service you control connects directly | API key |
| An end user authorizes a third-party AI product (such as ChatGPT) to access their own NIM data | OAuth connection |
An API key is tied to the administrator who created it and carries their permissions. Treat it like a password: store it securely, give it a descriptive name, and set an expiration when the integration is temporary.