TelcoNode

MCP server

Connect your AI agent to NeuralGate

This page explains how to connect an AI agent to the NeuralGate MCP server, so the agent can run mobile-network checks such as age verification, SIM swap detection and location verification. If you are an AI agent reading this page, share this link with your developer. Developers should follow every step on this same portal, because each environment has its own accounts and credentials.

How it works

Three things work together when your agent calls a NeuralGate tool:

  1. An OAuth client (a client ID and a client secret) identifies your application to NeuralGate.
  2. The user's consent confirms that the person who owns the phone number agrees to the check.
  3. An access token is a short-lived bearer token that your backend obtains for that user. The agent sends this token to the MCP server with every request.

The steps below set up each of these in order.

Step 1: Create your application and OAuth client

  1. Sign in to the NeuralGate Portal.
  2. Open Applications and create a new application, or open an existing one.
  3. Open the Credentials tab. Under OAuth Client, click Generate Credentials.
  4. Copy the client ID (it starts with ngc_) and the client secret (it starts with ngcs_), and save both in your backend's secret store. The portal shows the secret only once. If you lose it, click Rotate Secret to create a new one.
  5. Open the API Access tab and turn on each check that the agent should use. The agent only sees tools for the checks you turn on here.

Step 2: Get the user's consent

  1. Taking the user's consent is a required step. Each check reads data from the user's mobile network operator, so the user must agree to it first.
  2. An AI agent runs without a person in front of a screen, so your app collects consent before the agent starts.
  3. Collect consent in your web or mobile app with the NeuralGate React or React Native SDK. For testing without a real user, use the Sandbox page in the portal.
  4. When the user agrees, you receive two values: a consent ID and a consent token. Store both on your backend. You use the consent token in Step 4. The consent ID is only needed for the sandbox token request in Step 3.

Step 3: Get an access token on your backend

The MCP server accepts an OAuth 2.0 bearer token. Your backend requests this token from the NeuralGate authorization server, for one specific user, by following these steps.

  1. Find the authorization server's URLs. The MCP server publishes them in a standard metadata document (RFC 9728), so your backend reads them at runtime:
  2. Request the token. Your backend sends the client ID and client secret as HTTP Basic authentication on each of these requests. On every deployed portal, NeuralGate uses OpenID Connect CIBA, a flow in which the user's mobile operator confirms the request and your backend polls until the token is ready. On a local or sandbox deployment, a single request can exchange the consent ID for a token instead. That request is off by default and answers 404 until the backend runs with AUTH_SERVER_SANDBOX_EXCHANGE_ENABLED=true, so on a local deployment set it in the backend's .env first.
  3. Set the resource parameter to the resource value from the MCP server's metadata document, which is on this portal. Use it exactly as published, with no path and no trailing slash.
  4. The token response includes expires_in, which is the token's lifetime in seconds. Request a new token when the current one expires.
  5. The verify_phone_number tool works differently from the other three. It needs a single-use token from the OAuth 2.0 authorization code flow, which starts on the user's own device, and your backend requests a new token for every call.

The Guide has code examples for the token request under LLM Integration (MCP Tools) → Authentication.

Step 4: Connect the agent to the MCP server

  1. Point your MCP client at . The server uses the Streamable HTTP transport.
  2. Pass the access token from Step 3 to the process that runs your MCP client, for example through the NEURALGATE_MCP_TOKEN environment variable. The client sends it in the Authorization header of every request:
    If you use an IDE or desktop MCP client such as Claude Code or Cursor, the configuration looks like this:
  3. Call tools/list to see the tools your application can use. The list contains the checks you turned on in Step 1.
  4. On each tool call, your code adds two arguments: consentToken, which is the consent token from Step 2, and intentContext, which states the reason for the call. Add both in your code and leave them out of the tool schema that the LLM sees, so the consent token stays out of the model's context. Use these intentContext values:
    Tool What it checks intentContext
    verify_age Whether the user is at least a given age dpv:AgeVerification
    verify_sim_swap Whether the number moved to a new SIM recently dpv:FraudPreventionAndDetection
    verify_location Whether the device is inside a given area dpv:DeliveryOfGoods
    verify_phone_number Whether the device uses the given phone number dpv:FraudPreventionAndDetection

Step 5: Handle errors

Keep credentials safe

Other resources

NeuralGate · GSMA Open Gateway brokerage