Build an MCP Server for Your App
Turn your app's API into an MCP server that any AI assistant can use. Document your API in a DocStar collection, and DocStar gives that collection its own MCP server. Your users add one URL to Claude, ChatGPT, Cursor or VS Code, then ask for things in plain language instead of writing API calls.
The quickest way is to let your own AI assistant do the setup. See Let your AI assistant build it.
What your MCP server offers
| Collection type | What AI assistants can do |
|---|---|
| Docs and blogs | Search and read your published pages. |
| API docs | Search and read your docs, read your API reference, and call your API. |
| Embed collections | No MCP server. |
Only published content is visible. Drafts never reach your MCP server.
Set it up in five steps
- Document your API. Create an API collection and add an endpoint for each API you want to expose. Describe each one well: what it does, every parameter, and a full JSON request body example. The better the docs, the better the assistant uses your API. Publish the endpoints.
- Get your MCP URL. DocStar creates the server for you. Open your collection's settings, open the MCP tab and copy the MCP server URL. It looks like
https://mcp.docstar.io/connector/your_collection_slug. - Pick your main tools. Give your most important endpoints their own tools. See Endpoint tools.
- Teach assistants how to use your API. Write the server's skill. See Skill.
- Add your rules and sign-in. Add instructions and, if your API needs a logged-in user, sign-in for API calls.
Then share the URL with your users. Anyone can add it to an AI assistant.
Endpoint tools
By default, assistants reach your API through a general "call any API" tool: they search your docs, find the endpoint, then call it. That works for every endpoint, but your most important actions work better as tools of their own.
Give up to 20 published endpoints their own named tool, for example create_payment or list_invoices. Assistants then see these actions directly and pick them more reliably.
For each tool you can set:
| Setting | What it does |
|---|---|
| Name | Up to 45 letters, numbers, _ and -. Must be unique on the server. |
| Description | What the tool does and when to use it. Leave it empty to follow the endpoint's docs, so the tool stays up to date when you edit them. |
| Safety hints | Mark a tool read-only, destructive, idempotent or open-world, so assistants know when to ask before running it. |
| Token header | The header that carries the signed-in user's token, and its prefix, such as Authorization: Bearer. DocStar reads this from your endpoint docs. |
Choose the endpoints your users reach for most. Everything else stays available through the call-any-API tool.
This is set through the Upsert Endpoint Tool endpoint in the MCP Server module of the DocStar API. Use Get MCP Tools to see what you have and Delete MCP Tool to remove one.
Skill
Every MCP server ships with a skill: a short quickstart guide that assistants load before they use your API. DocStar generates one from your docs. It follows your docs and tools as they change.
Write your own when you know things the docs don't say, for example which endpoint to call first, how ids relate, or common mistakes. A good skill covers:
- What your API is for, in two or three sentences.
- The usual order of calls, such as "list projects, then create a task".
- Rules and limits, such as rate limits or required fields.
- Which endpoints are safe to call freely and which to confirm first.
Once you write your own, it no longer follows doc changes. Reset it any time to go back to the generated version.
This is set through Update MCP Skill, and Reset MCP Skill restores the generated one. Get MCP Skill shows the current content.
Additional instructions
Use Additional instructions for short rules assistants receive every time they connect, for example "Always use the v2 endpoints" or "Ask for the account id before creating an order". They are added to DocStar's own instructions. Keep them under 2,000 characters.
Set them in the MCP tab, or through Update Collection MCP Server. Use the skill for longer guidance and the instructions for rules that must always apply.
Let users call your API with their own account
For API collections, you can let AI assistants call your API as the signed-in user. Anyone can still connect and read your docs. The first time an assistant calls your API, the user signs in with their own account on your platform.
In the MCP tab, open Sign-in for API calls and enter your OAuth app's details:
| Field | What to enter |
|---|---|
| Authorization URL | Where your users sign in and approve access. |
| Token URL | Exchanges the authorization code for an access token. |
| Client ID and Client secret | From your OAuth app. The secret is stored only on the MCP server and never shown again. |
| Token validation URL | Any endpoint that returns 200 for a valid access token. It is checked on every MCP request. |
Then add every Redirect URI shown in the tab to your OAuth app's allowed callback URLs. Without it, sign-in fails.
Custom domain
Serve your MCP server on your own domain, such as mcp.yourcompany.com. Add the DNS records DocStar gives you, then check the status. The shared URL keeps working. Add the redirect URI for your new domain to your OAuth app too.
This is set through Set MCP Custom Domain, Check MCP Custom Domain and Remove MCP Custom Domain.
Let your AI assistant build it
Everything above is available through the DocStar API, so an AI assistant connected to DocStar can do the whole setup from your code. Connect it first (Connect your AI assistant), then give it this prompt:
Use the DocStar MCP to turn my app's API into an MCP server. First read https://docstar.io/mcp/quickstart.md and follow it step by step. Read my latest code for the API, not an old OpenAPI file, and document each endpoint with a clear description and a full JSON body example.
The assistant documents your endpoints, gets your MCP URL, picks up to 20 important endpoints as tools, writes the skill and adds your instructions. It asks you before it changes or publishes anything.
If your assistant can't connect to DocStar, use an Auth Key instead: Run the DocStar API with an Auth Key.