Prompt
How do I connect ChatGPT to my company's backend?
Latest observation
There are two main ways to connect ChatGPT to your company’s backend, depending on where you want the integration to live: inside your own app/backend via the OpenAI API, or inside ChatGPT itself via a custom MCP app/server. OpenAI’s official docs point to function calling / tools in the Responses API for app-side integrations, and to remote MCP servers for ChatGPT-side integrations. (help.openai.com)
Option 1: Connect your backend to ChatGPT in your product
This is the usual choice if you want users to chat in your app and have the model call your internal services. The pattern is:
- User sends a message to your backend.
- Your backend calls the OpenAI Responses API.
- You define tools/functions like
get_customer,create_ticket, orquery_inventory. - The model decides when to call a tool.
- Your backend executes the real API/database call.
- Your backend sends the tool result back to the model for a final answer. OpenAI describes this as function calling, and recommends Structured Outputs with
strict: truewhen you want schema-conformant tool arguments. (help.openai.com)
Good fit for:
- CRM / ERP / support / internal dashboards
- Private APIs and databases
- Workflows that can read and write
- Full control over auth, logging, approvals, and rate limits
Architecture
User -> Your frontend -> Your backend -> OpenAI API
-> Your internal APIs / DB / services
Minimal pattern
Define tools such as:
search_orders(order_id, email)get_account_balance(account_id)create_refund(order_id, reason)lookup_policy(doc_id)
Then let the model choose among them.
Important security rule
Do not let the model talk directly to your database. Put a thin service layer in front of it with:
- scoped endpoints
- auth checks
- input validation
- audit logging
- allowlists for writable actions
That keeps the model as a planner, while your backend remains the enforcement point. This is an implementation best practice I’m recommending based on the tool-calling architecture OpenAI documents. (help.openai.com)
Option 2: Connect your backend directly into ChatGPT
If you want employees to use chatgpt.com and access company systems there, OpenAI supports custom apps via MCP. ChatGPT connects to remote MCP servers, and if your MCP server is private/on-prem, OpenAI says to use Secure MCP Tunnel rather than exposing it publicly. (help.openai.com)
Good fit for:
- Internal employee assistant in ChatGPT
- Search/fetch over company knowledge
- Controlled actions in enterprise workflows
- OAuth-based per-user access
For Company Knowledge in ChatGPT Business / Enterprise / Edu, OpenAI says custom apps built with MCP can provide company-specific data, and access respects the user’s existing permissions. Apps require user connection through OAuth, and admins can manage access with RBAC. (help.openai.com)
Architecture
ChatGPT -> Remote MCP server -> Your internal APIs / DB / services
Notes
- ChatGPT connects to remote MCP servers, not directly to a local machine. (help.openai.com)
- For private networks or on-prem systems, use Secure MCP Tunnel. (help.openai.com)
- Company Knowledge is available on ChatGPT Business and Enterprise/Edu, and uses apps for retrieval grounded in enterprise permissions. (help.openai.com)
Which should you choose?
Choose the OpenAI API + function calling route if:
- You’re building the assistant into your own app
- You need custom UI and workflow control
- You want write actions with approvals
- Your backend team wants full orchestration ownership
Choose ChatGPT + MCP if:
- Your team wants to use ChatGPT directly
- You want to expose internal tools/knowledge to employees
- You already have enterprise auth/governance patterns
- Search/fetch in ChatGPT is the main use case, with selective actions later
Recommended implementation plan
-
Start read-only
First expose safe endpoints like search, lookup, list, summarize. This reduces risk while you validate prompts and schemas. -
Design narrow tools
Prefer:get_invoice(invoice_id)search_kb(query)
over broad tools like:
run_sql(sql)call_any_internal_api(path, body)
-
Require explicit approval for writes
For actions like refunds, deletes, status changes, or provisioning, add a human confirmation step. -
Use per-user auth, not one shared super-token
For ChatGPT apps, OpenAI notes OAuth/user-connected access patterns and permission-aware access. (help.openai.com) -
Log everything
Store user request, tool chosen, arguments, result, and final response. -
Validate model outputs before execution
Use JSON schema / Structured Outputs, then server-side validation as a second layer. OpenAI documents Structured Outputs for exact schema matching of function arguments. (help.openai.com)
Example backend tool set
For a support company backend, you might expose:
find_customer(email | account_id)list_recent_orders(customer_id)get_subscription_status(customer_id)search_help_center(query)draft_refund(customer_id, order_id, reason)submit_refund(refund_draft_id, approved_by)
Notice the pattern:
- read tools are easy
- write tools are split into draft and submit
- sensitive actions require approval
That pattern usually works much better than letting the model directly perform irreversible actions.
If your backend is private/VPN-only
You have two practical setups:
A. Your app calls OpenAI
Your backend can stay private because your server is the one calling both OpenAI and your internal systems.
B. ChatGPT calls your MCP server
Your MCP server must be reachable as a remote MCP server, but OpenAI says Secure MCP Tunnel can connect private/on-prem/developer-machine MCP servers to supported products without exposing them to the public internet. (help.openai.com)
Data/privacy considerations
For ChatGPT Business, Enterprise, and Edu, OpenAI says information accessed from apps is not used to train their models, and conversations using apps are available through the Compliance API for those plans. (help.openai.com)
My practical recommendation
For most companies:
- Customer-facing product or internal web app → use Responses API + function calling
- Employee assistant inside ChatGPT → use custom MCP app/server
- If you need both, build a single internal tool layer and expose it to:
- your app through normal backend calls
- ChatGPT through an MCP wrapper
That avoids duplicating business logic.
If you want, I can next give you one of these:
- a reference architecture diagram
- a Node.js example using Responses API + function calling
- a Python example
- an MCP server design for ChatGPT Enterprise
- a security checklist for connecting production systems
Brands
Citations
- Function Calling in the OpenAI API | OpenAI Help Center
- Function Calling in the OpenAI API | OpenAI Help Center
- Function Calling in the OpenAI API | OpenAI Help Center
- Developer mode and MCP apps in ChatGPT | OpenAI Help Center
- Company knowledge in ChatGPT (Business, Enterprise, and Edu) | OpenAI Help Center
- Developer mode and MCP apps in ChatGPT | OpenAI Help Center
- Developer mode and MCP apps in ChatGPT | OpenAI Help Center
- Company knowledge in ChatGPT (Business, Enterprise, and Edu) | OpenAI Help Center
- Company knowledge in ChatGPT (Business, Enterprise, and Edu) | OpenAI Help Center
- Function Calling in the OpenAI API | OpenAI Help Center
- Developer mode and MCP apps in ChatGPT | OpenAI Help Center
- Admin Controls, Security, and Compliance in apps (Enterprise, Edu, and Business) | OpenAI Help Center
Observation history
Unlock observation history
Create a free Obsurfable account to unlock historical responses, model comparisons, and deeper brand intelligence.
How did Obsurfable measure this prompt?
Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.
Which AI systems does Obsurfable collect answers from?
OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, and Meta AI.