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

  1. 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.
  2. 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.
  3. Pick your main tools. Give your most important endpoints their own tools. See Endpoint tools.
  4. Teach assistants how to use your API. Write the server's skill. See Skill.
  5. Add your rules, brand and sign-in. Add instructions, your branding 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.
Inputs What assistants send the tool, taken from the endpoint's docs: path variables, query params and the fields of the JSON example body. Describe an input in your own words, or say whether a query param or body field is required. Path variables are always required. Leave a description empty to use the one from your docs.
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.

Your input descriptions and required choices stay when you edit the endpoint's docs. An input you remove from the docs loses them.

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.

#

Built-in tools

Every MCP server also has built-in tools that DocStar keeps in line with your docs:

Tool What it does
search_<slug>_docs Searches your published docs.
get_<slug>_api_docs Reads your API reference, one level at a time (API collections).
call_any_read_api_of_<slug> Calls any endpoint with GET (API collections).
call_any_api_of_<slug> Calls any endpoint with POST, PUT, PATCH or DELETE (API collections).
send_feedback_to_<slug> Sends bug reports and feedback from assistants to your team.

You can rewrite what assistants read about each one:

Setting What it does
Description What the tool is for and how to use it, for example your API's base URL or what to confirm before a call.
Title and safety hints The title AI clients show, and the read-only, destructive, idempotent and open-world hints.
Input descriptions What assistants put in each argument. For example, if your API takes only Authorization: Bearer, describe the call tools' headers input as "Only send {"Authorization": "Bearer"} and no other header." A nested field is named by its path, such as parent.child.

Your text stays when DocStar updates the tools. Leave a setting empty to go back to the generated text, which follows your collection's name and docs again. You can also turn off the two call tools and the feedback tool, for example so assistants reach your API only through your endpoint tools.

This is set through Update Built-in Tool Description in the MCP Server module of the DocStar API, and Set Built-in Tool Enabled turns a tool off or on. Get MCP Tools shows each tool's current and generated text, input by input.

#

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.

#

Branding

Choose how your MCP server introduces itself when an AI assistant connects. Claude, ChatGPT, Cursor and app directories then show your product's name, website and icon instead of a generic server.

In the MCP tab, open Server and click Edit next to Branding:

Field What to enter
Display name The name people see, such as Acme. Up to 100 characters.
Server id A short id for the server, such as acme: letters, digits, dots, dashes and underscores, up to 64.
Website Your product's website, starting with http:// or https://.
Icon URL A square logo, PNG or SVG, at least 64×64 pixels, on https://. A preview shows next to the field.

Leave a field empty to use the default. Changes apply to the next connection.

This is set through the branding field of Update Collection MCP Server. Send only the fields you change: the others keep their saved value, and an empty string removes one. Get Collection MCP Server returns the current branding.

#

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. These are the same details as the collection's OAuth tab (Settings), which also adds a Connect button to your public docs: see Let Visitors Sign In to Try Your API.

#

Usage

See how the tools that call your API are doing. In the MCP tab, open Usage. It shows all tools together, with each tool's calls under Calls by tool. Pick a tool in the list at the top, or click it under Calls by tool, to see only that tool.

For the time range you pick (24 hours, 3, 7 or 14 days) you see:

  • How many calls were made and how many succeeded. A call counts as failed when your API answered with an error (status 400 or above) or couldn't be reached.
  • The response time: the median, and the time 95% of calls finished within.
  • Calls per hour (for 24 hours) or per day, split into succeeded and failed.
  • Answers by status, such as 200 OK or 404 Not Found.

Click See in Logs to open the calls. When there were more calls than can be counted in time, Usage says the numbers come from the newest calls; pick a shorter range or a single tool for exact numbers.

#

Logs

See every call AI assistants made to your API through your MCP server. In the MCP tab, open Logs and pick a tool. Each tool has its own log, including the two call-any-API tools.

The newest calls are listed first, and older ones load as you scroll. Use Failed only or the search box to find a call. Click one to see:

Part What it shows
Summary Whether the call worked, the method and path, when it ran, and a one-line reason when it failed.
Input from the AI assistant What the assistant gave the tool.
Request sent to your API Method, URL, query params, headers, body, and whether a signed-in user's token was sent.
Response from your API Status, time taken, size and the response body.

Use the logs to find out why a call failed. A 401 says your API rejected the token or the user wasn't signed in, a 404 that the assistant used a wrong path or id, and a 400 or 422 that the request body was wrong. Your API's own error message is shown too.

  • Tokens, API keys and other secret values are masked.
  • Calls are kept for two weeks.
  • You need edit access to the collection to see its logs.
#

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, adds your instructions and sets your branding. 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.