How to build an MCP server for your API, or connect the API without writing one
What a custom MCP server for a REST API takes: tools, OAuth, keys, hosting and upkeep. And how to connect the same API to ChatGPT or Claude without building one.
Contents
To give ChatGPT or Claude your own API, you need an MCP server: a program that describes the API's operations as tools and makes the calls. Building one yourself means choosing the tools, adding OAuth sign-in, storing the API keys safely, hosting it over HTTPS and fixing it when the API changes. If you don't want to build and run it, a ready MCP server such as APIUniCon reads the API's documentation, writes the adapter for you, keeps the key out of the chat and asks you before any change.
What an MCP server for an API does
MCP, the Model Context Protocol, is the standard that ChatGPT, Claude and other assistants use to work with outside tools. An MCP server sits between the assistant and your API. It tells the assistant which operations exist, “list orders”, “get an invoice”, “change a price”, and when the assistant picks one, the server makes the HTTP call with your key and returns the answer.
So “build an MCP server for my API” really means three jobs: describe the API as a set of tools, run those tools safely, and keep the whole thing online.
What building your own takes
The official build-server tutorial walks through a first working server. A server you would let near real data takes more than that:
- Tools. You choose which endpoints become tools and write a clear description for each, because the assistant picks tools by those descriptions. Too many tools and it picks the wrong one; too few and it can’t answer.
- Sign-in. ChatGPT and Claude on the web reach a remote server over HTTPS, and the MCP authorization spec uses OAuth 2.1: your server is a resource server, it publishes its authorization server, and the client signs the person in with PKCE. That is a working OAuth server, not a config line.
- Keys. The API key of the service has to live somewhere. It must not pass through the chat, and it should be encrypted at rest.
- Changes. An assistant that can call “delete” or “refund” needs a step where a person says yes before it happens.
- Upkeep. APIs change their endpoints and fields. Someone has to notice and update the server.
For a product team that ships an API to thousands of customers, building an official server is worth it. For one business that wants to ask about its own data in one service, it is usually more than the question is worth.
How to connect an API without building a server
APIUniCon is one MCP server that connects to any service with an HTTP API and documentation. You add it once, and every service after that is connected in the chat.
- Add APIUniCon to ChatGPT or Claude. The buttons for each are on the setup page.
- Write in the chat: “Connect my service”, with a link to its API documentation. The AI first looks for a ready adapter in the shared catalog. If there is none, it reads the documentation and writes a small adapter for the operations you need.
- Open the link the AI sends you. On that page you see the address the requests will go to and paste your API key. The key never goes into the chat.
- Wait for the test: the AI runs the read operations and tells you what it can see.
The address of the server is https://apiunicon.online/mcp, with OAuth sign-in. In Claude Code it is one command: claude mcp add --transport http apiunicon https://apiunicon.online/mcp.
What to ask once the API is connected
The point of connecting an API is to ask in plain words. Good first questions:
- What operations can you run on this service, and which of them change data?
- Show me the last 20 orders and the status of each.
- Which customers haven’t paid for more than 30 days?
- How did this week compare with last week, and what changed most?
- Find the record for invoice 1042 and tell me everything about it.
- Which items are low on stock, and when did we last restock them?
- What did this endpoint return, and what does each field mean?
Cases: three ways teams connect an API
A store on a platform with an open API
An online store wants Claude to answer “what sold this week and what is about to run out”. The platform has a REST API and public documentation. The owner pastes the documentation link, gets the key page, pastes a read-only key, and the AI tests listing orders and products. Nothing was written by hand, and the first answer comes in the same conversation.
An in-house tool with its own API
A company has an internal tool with a small REST API: a dozen endpoints, an API key in a header. It has no public documentation site, so the team gives the AI an OpenAPI file at a public link. The AI writes the adapter from it. Every request goes only to the address approved on the key page, so the assistant can’t wander off to other hosts.
When building your own server is right
A software vendor wants its customers to connect its product to ChatGPT and Claude, listed in the directories under its own name. Here a dedicated server is the right call: the vendor controls the tools, the sign-in and the branding, and keeps it up to date with its own releases. APIUniCon is for the other side, the business that uses many services and wants them all in one assistant.
What the AI can do through a connected API
Reading comes first, and it is available on every plan. Changing data is available on Pro and Business, and it always goes through you:
- create or update a record, such as a deal, a task or a shipment;
- change a price or a stock level;
- send an email or a reminder through the service;
- mark an invoice as paid once the money has arrived.
Each change is shown to you first: what will change, where and to what. Nothing happens until you confirm, and a deletion is always confirmed on its own page.
If something goes wrong
If the AI says the key is wrong, the service most likely needs it in a different place, a header with a prefix or a pair of keys. Tell the AI what the documentation says about authentication and ask it to update the connection. If the documentation site blocks automated readers, give the AI a direct link to an OpenAPI file or to the page with the endpoint you need.
Questions and answers
Do I need to build an MCP server to use my API in Claude?
Claude reaches outside services through MCP servers, so something has to play that part. It can be a server you build, or a ready one that connects any API, like APIUniCon. Either way it is added once in Customize → Connectors, and Claude's free plan allows one such connection. The steps are on the setup page.
What language should I write an MCP server in?
The protocol has official SDKs in several languages, TypeScript and Python among them, and the official build-server tutorial walks through a full example. For ChatGPT and Claude on the web the server has to run remotely, over HTTPS, usually with the Streamable HTTP transport.
How does an MCP server authenticate users?
The MCP specification uses OAuth 2.1: the server acts as an OAuth resource server, publishes where its authorization server is, and the client signs the person in with the authorization code flow and PKCE. ChatGPT and Claude both support this flow for custom servers.
Can ChatGPT and Claude use the same MCP server?
Yes. A remote MCP server works with both. In ChatGPT it is added under Plugins as a custom MCP server on Business, Enterprise and Edu (Pro can only read); in Claude it is added under Customize → Connectors on every plan.
Where are my API keys stored if I don't build my own server?
With APIUniCon you paste the key on our page, never in the chat. We store it encrypted and decrypt it only to make your requests; the AI gets the service's answers, not the key. A [local version](https://github.com/A1exZabr/apiunicon) keeps the keys on your own computer.
What if my API changes?
A server you built has to be updated by whoever wrote it. In APIUniCon the adapter is a small description of the operations you use: when an endpoint changes, you tell the AI, it reads the new documentation and fixes the adapter, and the read operations are tested again before use.



