Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 13 min read

Set up a governed MCP gateway for Claude, ChatGPT, Copilot and Gemini

Originally published at nexatron.io/blog/governed-mcp-gateway-setup. TL;DR: An enterprise MCP gateway gives every AI assistant one remote MCP endpoint in front of your business systems. It applies sign-in, existing perm

Originally published at nexatron.io/blog/governed-mcp-gateway-setup.

TL;DR: An enterprise MCP gateway gives every AI assistant one remote MCP endpoint in front of your business systems. It applies sign-in, existing permissions, approved metric definitions and audit to every call. With Nexatron, the endpoint is https://api.nexatron.io/api/v1/mcp, one MCP server for Claude, ChatGPT, Copilot and Gemini. Claude adds it from the Connectors Directory or as a custom connector. ChatGPT adds it as a custom MCP server. Microsoft 365 Copilot uses it as a Model Context Protocol tool in Copilot Studio. Gemini agents reach it through the Gemini API or the Agent Development Kit (ADK) with the user's access token. Users sign in with their existing account in each system, or through the company's SSO if it has one. Every assistant then returns the same governed number, from data the user is already authorized to see.

Why an MCP gateway, and what it has to do

The usual path to MCP sprawl is reasonable at every step. Sales adds a CRM server to Claude, and finance tries an ERP server in ChatGPT. Someone builds a Copilot Studio agent over the warehouse, and a data science team wires Gemini into an internal tool. Six months later you have four assistants, a dozen MCP servers, four sign-in models and no single place to answer who read what.

A governed MCP gateway is one endpoint that every assistant connects to, and it has four jobs:

  1. It signs users in with OAuth, so nobody pastes keys into a chat client.
  2. It runs each call under the user's existing permissions in the source system.
  3. It answers business questions from approved definitions, so revenue means the same thing in every assistant.
  4. It writes governed answers to an audit trail that security can review.

This tutorial walks through an enterprise MCP gateway end to end for Claude, ChatGPT, Microsoft 365 Copilot and Gemini agents. The vendor steps follow each vendor's current documentation, linked under Sources. Menu labels move often, so treat those pages as the authority whenever a label in this post has changed.

The endpoint and what it exposes

Every assistant in this tutorial points at the same URL. The server speaks Streamable HTTP and uses OAuth 2.1 with PKCE and dynamic client registration. It also publishes its protected-resource metadata at https://api.nexatron.io/.well-known/oauth-protected-resource, so clients that support discovery need nothing beyond the URL.

https://api.nexatron.io/api/v1/mcp

Scopes narrow what an assistant may do, and they never add to what the user's role allows. When a client asks for no scopes, the connection gets the read-only defaults mcp:query, mcp:read and openid, and action scopes are never granted by default.

Tool What it does Scope it needs
ask Answers a business question under the user's permissions. Returns rows, the generated query and lineage. mcp:query
list_sources Lists the sources the user can query mcp:read or mcp:query
list_metrics, explain_metric Lists available definitions and returns one definition's formula, filters, table and dimensions mcp:read or mcp:query
query_metric Runs a named, defined metric mcp:metrics:execute or mcp:query
compare_metric_across_sources Runs several named metrics in one call and returns each result, or why it was refused mcp:federation, mcp:metrics:execute or mcp:query
audit Returns the caller's own audit trail for this server Checks the account's role
list_actions, dry_run, execute_action Discovers, previews and runs actions in a connected system An actions scope at the action's risk tier

Step 1: Connect the business systems and choose who can use them

A Nexatron workspace administrator adds each source system under Knowledge β–Έ Sources β–Έ New connection. Under Who can use it, they choose Everyone or selected groups and people for that connection. A new connection is available to no one until that is saved, which gives you a clean pilot group.

Users then sign in to each system from Knowledge β–Έ Sources β–Έ Your connected accounts. They use their existing account in that system, or the company's SSO if it has one, and from then on Nexatron inherits their permissions there:

  • Snowflake: the user's role grants, row access policies and masking policies.
  • Salesforce: sharing rules, field-level security and the role hierarchy.

Whatever the assistant, the user only gets data they are already authorized to see.

Start with the systems your questions hit most, which are usually CRM, ERP and the warehouse. The connector catalog lists every system by category, and each connector page shows example questions and setup steps.

Step 2: Approve assistants and set the action policy

If your workspace requires administrator approval for new assistants, the first connection from an assistant waits as pending. Review it under Settings β–Έ Integrations β–Έ AI assistants β–Έ Pending approvals, approve only the intended client, and have the user reconnect. The same approval rules apply to Claude, ChatGPT, Copilot and Gemini clients. Revoking a client in the same place stops every token issued to it in the workspace at once.

Decide early how you treat actions. Questions never change data, and actions are a separate set of tools with their own safeguards:

  • They can be previewed with dry_run.
  • Clients ask before execute_action runs.
  • High-risk or irreversible actions need a typed confirmation.
  • Write-back is off on each connection until an administrator turns it on.

For a first rollout, keep connections on read scopes, and let a team ask for actions once it has a workflow and an owner for it. In the rollouts I've seen, a read-only start also makes the first security review much simpler.

Step 3: Connect Claude

Nexatron is listed in Claude's Connectors Directory as a community connector, at claude.ai/directory/nexatron.

  • Team and Enterprise: an Owner opens Organization settings β–Έ Connectors, selects Browse connectors and adds Nexatron to the team. Members then connect from Customize β–Έ Connectors and sign in.
  • Free, Pro, Max and Ultra: users add it themselves from Customize β–Έ Connectors, with Free limited to one custom connector.

Where the directory is not available, add a custom connector with the server URL above:

  • Owners: Organization settings β–Έ Connectors β–Έ Add β–Έ Custom β–Έ Web.
  • Individual plans: Customize β–Έ Connectors β–Έ + Add β–Έ Add custom connector.

Keep Claude's recommended OAuth client option, and you will not need a client ID or secret. Review tool permissions as you go: read tools can be allowed, and anything that changes data should need approval or be turned off. The full Claude walkthrough, with Snowflake as the example source, is in Connect Claude to Snowflake.

Step 4: Connect ChatGPT

ChatGPT adds remote MCP servers as custom plugins. OpenAI's current guide describes the flow on ChatGPT for the web:

  1. Open Plugins, select + and choose Add custom MCP server.
  2. Give it a name and, under Connection, enter the Server URL.
  3. Pick OAuth for authentication, review the risk warning and continue.
  4. Select Create as a plugin, then install the plugin before you use it in a conversation.

Nexatron supports dynamic client registration, so you supply no client ID or secret.

Workspace permissions and security settings apply to adding and using custom MCP servers, so on business plans a workspace admin may need to allow them first. If the option is missing, ask your ChatGPT workspace admin. ChatGPT asks for confirmation before write actions by default, and it treats any tool without the readOnlyHint annotation as a write. Nexatron's analytics tools are annotated read-only, so ordinary questions run without extra prompts.

Step 5: Connect Microsoft 365 Copilot through Copilot Studio

In Copilot Studio, make sure generative orchestration is on for your agent, because MCP requires it. Then open the agent's Tools page and select Add a tool, then New tool, then Model Context Protocol. The MCP onboarding wizard asks for a Server name, a Server description and the Server URL. The orchestrator reads the description to decide when to call the server, so write what the server answers, such as governed questions about revenue and pipeline.

For authentication, choose OAuth 2.0 with Dynamic discovery. Nexatron supports dynamic client registration and publishes its discovery metadata, so the wizard finds the endpoints itself. Select Create, then Next, then Create a new connection, then Add to agent. Publish the agent to the Teams and Microsoft 365 Copilot channels to put it where people work. Copilot Studio supports the Streamable transport for MCP, which is what the Nexatron server uses.

Server name:        Nexatron
Server description: Ask governed questions of our business systems: revenue,
                    pipeline, headcount, operations and warehouse data.
Server URL:         https://api.nexatron.io/api/v1/mcp
Authentication:     OAuth 2.0 > Dynamic discovery

One Microsoft detail is easy to miss: MCP access in Copilot Studio relies on Power Platform connectors. If a data policy regulates those connectors, it also governs access to the MCP server and its tools. Check your data policies before the pilot, or the agent will fail in ways that look like a server fault.

Step 6: Connect Gemini agents

For Gemini, you connect where you build with it. Two documented paths reach a remote MCP server:

  • Gemini API (Interactions API): accepts a tool of type mcp_server with a name, a url, optional headers and an optional allowed_tools list. It supports Streamable HTTP servers only.
  • Agent Development Kit: McpToolset with StreamableHTTPConnectionParams does the same job.

In both cases, authenticate as the signed-in user. Your application runs the OAuth 2.1 sign-in with PKCE against Nexatron for that user, then passes the user's access token in the Authorization header. Never call the gateway with one token for every user of your app, because that collapses all of your users' permissions into one.

Limit the tools to what the agent needs: most agents need ask, list_sources and the metric tools, and no action tools. Google asks for server names in snake_case, without hyphens.

# Gemini API (Interactions API): remote MCP server as a tool.
# GEMINI_MODEL and user_access_token are placeholders.
from google import genai

client = genai.Client()
interaction = client.interactions.create(
    model=GEMINI_MODEL,  # the Gemini model your app uses
    input="What was net revenue by region last fiscal quarter?",
    tools=[{
        "type": "mcp_server",
        "name": "nexatron",
        "url": "https://api.nexatron.io/api/v1/mcp",
        "headers": {"Authorization": f"Bearer {user_access_token}"},
        "allowed_tools": [{"mode": "auto", "tools": ["ask", "list_sources",
            "list_metrics", "explain_metric", "query_metric"]}],
    }],
)

# Agent Development Kit: McpToolset over Streamable HTTP
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

agent = LlmAgent(
    model=GEMINI_MODEL,
    name="business_questions",
    instruction="Answer business questions with the Nexatron tools.",
    tools=[McpToolset(
        connection_params=StreamableHTTPConnectionParams(
            url="https://api.nexatron.io/api/v1/mcp",
            headers={"Authorization": f"Bearer {user_access_token}"},
        ),
        tool_filter=["ask", "list_sources", "list_metrics",
                     "explain_metric", "query_metric"],
    )],
)

Approved definitions: the same number in every assistant

The fastest way to lose trust in AI answers is to ask Claude and Copilot for last quarter's revenue and get two numbers. That happens whenever each tool writes its own SQL against whatever tables it finds, and a gateway that only routes calls does nothing about it.

In Nexatron, definitions such as net revenue, bookings, churn and headcount live once, owned and approved by the team that owns the number. Any assistant can call list_metrics to see what is available, explain_metric to read the formula, filters and source table, and query_metric to run it. Answers carry a trust label, such as Approved or Interpreted, that says where the definition came from. Reviewers can then see when a question went beyond the approved set.

Test this directly by asking the same bounded question in all four assistants, as the same user. The numbers and the SQL that came back should match. Where they do not, the definition list shows you which metric needs an owner.

Audit: one record, whichever assistant asked

Governed answers go to the workspace audit trail regardless of which assistant asked, so the security team reviews one record, not four vendor logs.

Administrators open Settings β–Έ Workspace β–Έ Audit log and filter by time range, resource and category, such as Data access or Permissions. Download CSV exports the entries shown on the page. Export evidence packet produces a packet for compliance reviews and needs the Compliance admin role. Entries are append-only and hash-chained, and the page flags a broken chain if there is one.

Users and agents can also call the audit tool from any connected assistant to list their own recent events on the server, with the time and type of each. During a pilot, ask a question in ChatGPT, then call audit from Claude with the same account. Check that a question event appears at that time. The list shows events, not the question text or which assistant asked.

Rollout checklist

  • Inventory first: list the MCP servers, custom connectors and agents already in use, and who owns each.
  • Connect three systems: pick by question volume, usually CRM, ERP and the warehouse. Limit them to a pilot group under Who can use it.
  • Approve ten definitions: agree on the metrics that cause the most arguments before users start asking.
  • Run the two-user test: two users with different roles ask the same question. Answers should differ exactly where their permissions differ.
  • Point all four assistants at the gateway: keep them on read scopes and compare one question across all four. Review the audit log weekly for the first month.
  • Retire the side doors: remove duplicate team-level MCP connections as users move to the governed endpoint. Enable actions only where a team has an owner for them.

Troubleshooting

Symptom Likely cause and fix
The assistant shows the connection as pending Workspace approval is on. A Nexatron workspace administrator approves the client under Pending approvals, then the user reconnects.
No option to add a custom MCP server in ChatGPT The plan or workspace settings do not allow it yet. Ask the ChatGPT workspace admin.
The Copilot Studio agent fails on every call A Power Platform data policy blocks the connector, or generative orchestration is off for the agent.
Two assistants return different numbers One answer used an interpreted definition. Check the trust label and have the metric owner approve a definition.

FAQ

What is an MCP gateway?

It is a managed entry point between AI assistants and the systems behind them. It authenticates users, applies access policy, routes each tool call and records what happened. The MCP gateway page compares gateways, proxies and routers.

Is a remote MCP server the same as an MCP gateway?

A remote MCP server is any MCP server reached over HTTP. A gateway is a remote MCP server that sits in front of many systems and adds identity, policy, definitions and audit.

Do we need SSO?

SSO is optional. Users can sign in with their existing account in each system, and companies that run Okta or Microsoft Entra ID can use them for sign-in.

Will Claude and Copilot give the same number?

For governed questions, yes, because both use the same approved definitions and sources. Each answer carries the definition and query, so the result can be checked.

Can an assistant change data?

Questions never change data. Actions are separate tools that need an actions scope, they can be previewed with dry_run, and clients ask before execute_action runs. High-risk or irreversible actions need a typed confirmation. Write-back is off on each connection until an administrator turns it on.

How is it priced?

Contact sales for Nexatron pricing. Each assistant vendor bills its own plans separately.

Further reading

Sources

The full guide, with diagrams and updates, is on nexatron.io: https://nexatron.io/blog/governed-mcp-gateway-setup

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.