Build and connect a custom MCP server
Sometimes the system you want AVA to reach has a good API but no MCP server — or has one that does not fit how you want to control access, spend or field-level filtering. In that case you build a small MCP server of your own, host it in your tenant, and register it in AVA exactly like a vendor-hosted one.
This page covers what AVA requires of any server, how to choose its authentication, and then works through ZoomInfo as a complete example.
Tip
Check whether the vendor already publishes a hosted MCP server before you build one. ZoomInfo, for instance, operates its own remote MCP endpoint with OAuth sign-in and read-only tools. If that server's tool surface and entitlement model suit you, adding it takes ten minutes — see Add a hosted MCP server. Build your own when you need tools the vendor's server does not expose, tighter control over credit spend, field-level redaction, or joins across systems the vendor cannot see.
What AVA requires of a server
These are enforced, not advisory. A server that violates any of them will be refused at install time or at call time, with a specific error code.
Transport and address
| Requirement | Detail |
|---|---|
| Transport | Streamable HTTP. This is the only transport AVA supports — not stdio, and not the legacy HTTP+SSE transport. |
| Scheme | HTTPS only. |
| Port | 443 only. |
| Address | Must resolve to a public IP. Private, loopback, link-local, carrier-grade-NAT and reserved ranges are all refused, and localhost is refused by name. |
| URL contents | No username/password in the URL, no fragment, and no query parameter whose name looks like a secret (token, api_key, secret, password, signature, …). |
| Redirects | Followed manually, same origin only, at most 2. A redirect to another host is refused rather than followed. |
| DNS | AVA resolves the hostname once and pins the connection to that address, so a name cannot be re-pointed at an internal address mid-request. |
Heads up
Internal-only ingress. A server on a private network is unreachable by design — that rule is what stops AVA's add-server box from being used to probe your internal estate. If you deliberately want to host an MCP server on internal-only ingress, its hostname must be added to the ava:installed_remote_mcp_managed_hosts deployment configuration key by someone with access to Azure App Configuration. It cannot be granted from the admin UI, and every other rule above still applies. Talk to DataRM if you need this.
Tools and schemas
| Limit | Value |
|---|---|
| Tools per server | 500 |
tools/list pages followed | 20 |
| Tool name | A–Z a–z 0–9 _ . : -, 1–128 characters, unique within the server |
| Input schema | Must be type: "object". External $ref is refused; depth, key length and complexity are bounded |
| Schema size | 128 KB per tool, 2 MB across the whole server |
| Description | Truncated to 500 characters |
| Tool result returned to the model | 256 KB after normalisation; binary content is dropped, links and text are kept |
| HTTP response body | 4 MB |
| Request timeout | 15 seconds |
Note
A big tool surface is a liability, not a feature. AVA searches for tools rather than loading them all, so 200 near-identical tools mostly compete with each other for the same query. Ten well-named tools with clear descriptions beat a hundred thin API wrappers every time.
Annotations
Set readOnlyHint: true on everything that only reads, and destructiveHint: true on anything that deletes. AVA uses these to decide whether a call needs confirmation and whether it may run in a scheduled task. Note that AVA also reads the tool name and will escalate against your annotation but never relax one — a tool named delete_account is treated as destructive whatever it declares.
Choosing authentication
AVA supports five strategies. Pick by answering one question: whose permissions should apply when AVA calls this server?
| Strategy | Who holds the credential | Use it when | Scheduled tasks |
|---|---|---|---|
| None | Nobody | The server is genuinely public, or it is internal and the network is the boundary | Yes |
| Static API key | The deployment | The vendor issues a long-lived key sent as x-api-key / api-key / x-api-token | No |
| Static bearer | The deployment | Same, but sent as Authorization: Bearer | No |
| OAuth 2.1 (authorization code + PKCE) | Each user | Per-seat entitlements or per-user auditing matter at the vendor | Only if the provider issues a refreshable grant |
| Client credentials | The deployment | One service identity acts for everyone; the vendor has no per-user concept | Yes |
For a server you build yourself, the two realistic choices are client credentials (an Entra app registration, machine-to-machine) and OAuth 2.1 (your server fronts a real per-user sign-in). Client credentials is far simpler and is the right answer when the upstream vendor bills and permissions at the org level rather than the seat.
Heads up
Choosing a deployment-wide credential means AVA can no longer tell the vendor who is asking. Put your access control on the AVA side instead: restrict the server to named Entra groups, and keep write tools out of scheduled tasks.
If you want one-click setup
To make AVA configure your server's sign-in automatically instead of an admin pasting endpoints, implement the discovery chain:
| Standard | What to publish | What it buys you |
|---|---|---|
| RFC 9728 | /.well-known/oauth-protected-resource naming your authorization_servers and scopes_supported | AVA finds your identity provider without being told |
| RFC 8414 | Authorization-server metadata at the issuer | AVA finds the authorize, token and registration endpoints |
| RFC 7591 | A dynamic client registration endpoint | Nobody ever pastes a client ID |
| PKCE (S256) | Required on the authorization code flow | AVA will not use a flow without it |
| RFC 8707 | Accept a resource indicator and audience-bind the token | Tokens minted for AVA cannot be replayed elsewhere |
| RFC 9207 | Return iss on the authorization response | AVA verifies which provider actually answered |
If your server sits behind Entra ID, publish the protected-resource document naming Entra as the authorization server. Without it AVA has to guess the identity provider from the server's own address, guesses wrong, and reports discovery_authorization_server_undeclared. In that case an admin can still finish the install manually — but they must set Resource / audience to api://<your-app-id>, because Entra rejects a consent request whose resource does not match the requested scopes.
List your scope in that document too. scopes_supported is the only place AVA can learn which api://<your-app-id> your tokens are audience-bound to, and it is what lets AVA fill in Resource / audience for the admin instead of leaving them to find the application ID in the Azure portal:
{
"resource": "https://<your-server>/mcp",
"authorization_servers": ["https://login.microsoftonline.com/<tenant-id>/v2.0"],
"scopes_supported": ["api://<your-app-id>/<your-scope>"],
"bearer_methods_supported": ["header"]
}
Omit it and AVA has nothing to derive the audience from, so it sends no resource at all and lets the requested scope name the audience — which works, but only because the admin typed the scope by hand.
Worked example — ZoomInfo
ZoomInfo's Enterprise API is a good fit for a custom MCP server: the credential model does not map cleanly onto any off-the-shelf option, and credit spend is something you want to govern in code rather than hope for.
Why a custom server here
| Constraint | Consequence |
|---|---|
| ZoomInfo authenticates with username + password or PKI (client ID + private key), returning a JWT valid for one hour | Not an OAuth flow AVA can drive directly. Something must mint and cache that JWT. |
| Calls consume credits | You want a budget, a cache and a per-call guard in your own code, not in a prompt. |
| Responses are wide | Enrichment returns hundreds of fields. Returning them raw will hit AVA's 256 KB result cap and bury the model. Select fields deliberately. |
| Data governance | You may need to redact or withhold fields before they reach a model at all. |
Your MCP server holds the ZoomInfo credential, mints and caches the JWT, exposes a handful of purposeful read-only tools, and presents a clean, boring interface to AVA.
Architecture
AVA (Azure Container App)
│ Streamable HTTP + Bearer token (client credentials, Entra)
▼
kaleris-zoominfo-mcp (Azure Container App, public HTTPS ingress)
│ ZoomInfo JWT (minted from PKI creds, cached ~55 min)
▼
ZoomInfo Enterprise API
Three properties make this work:
- The ZoomInfo credential never leaves your server. AVA holds a token for your server, not for ZoomInfo.
- The JWT is cached. ZoomInfo's own guidance is not to authenticate on every request; mint once and refresh a few minutes before the hour is up.
- The tool surface is yours. You decide which fields, which limits, and what a "too expensive" query looks like.
Step 1 — ZoomInfo side
Get API credentials
Request Enterprise API access from your ZoomInfo account team. Prefer PKI (client ID + private key) over username and password — it avoids a human account's password becoming production infrastructure, and it survives that person leaving.
Confirm your entitlements
Company data, contact data, intent and technographics are licensed separately. Build tools only for what you actually hold; a tool that always returns "not entitled" is worse than no tool.
Understand your credit model
Know your monthly credit allowance and what each call type costs before you expose enrichment to a chat interface.
Check the API generation
ZoomInfo is retiring its legacy Enterprise API. Build against the current documented platform, not an older integration guide someone has lying around.
Step 2 — Build the server
Use the official MCP SDK for your language (TypeScript, Python, Java and C# are all first-class) and serve the Streamable HTTP transport. ZoomInfo publishes authentication client libraries for Python, Node.js, Java and C#, so JWT minting is a few lines rather than a project.
A tool surface that works well in practice:
| Tool | Purpose | Notes |
|---|---|---|
zoominfo_search_companies | Find companies by name, domain, industry, size, location | Cap limit (10 is a sane maximum). Return a compact row per company, not the full record. |
zoominfo_enrich_company | Full detail for one company by domain or ZoomInfo ID | The expensive one. Take a single identifier, never a list. |
zoominfo_search_contacts | Find people at a company by title, seniority, function | Return name, title, seniority, location, LinkedIn — decide deliberately whether email and direct dial are included. |
zoominfo_enrich_contact | Full detail for one person | Same discipline as company enrichment. |
zoominfo_company_technologies | Technographics for one company | Only if entitled. |
zoominfo_company_intent | Intent signals for one company | Only if entitled. Say plainly in the description what "intent" means, or the model will over-claim from it. |
Design rules that matter more than they look:
- Every tool is read-only. Set
readOnlyHint: true. This is what lets AVA use them without a confirmation prompt and lets you allow them in scheduled tasks. - Descriptions are how the model chooses. "Search ZoomInfo for companies matching a name, domain, industry, employee-count range or location. Returns up to 10 matching companies with ZoomInfo ID, name, domain, industry, employee count and HQ location." — that sentence does more work than any prompt tuning.
- Name for disambiguation. Prefix with
zoominfo_so tools do not collide with AVA's built-in CRM tools, and so a user can tell where an answer came from. - Return compact, structured text. Aim well under AVA's 256 KB result cap; a good response is a few kilobytes.
- Enforce your own limits. Clamp
limitserver-side. Reject an unbounded query with a clear message rather than spending credits on it. - Guard credits. Cache repeated lookups, keep a daily budget, and return an explicit "credit budget for today is exhausted" message rather than an opaque 4xx.
- Return errors as text, not stack traces. An MCP error result the model can read — "no company matched that domain" — produces a good answer. A 500 produces a retry loop.
- Log every call with the tool name, the arguments' shape and the credits consumed. You will want this within a week.
Step 3 — Host it
Deploy to an Azure Container App in the Kaleris tenant with public HTTPS ingress on 443. Front it with an Entra app registration and validate the bearer token on every request: check the signature, the issuer, the audience (api://<app-id>) and the app role. A public endpoint with no authentication is not acceptable even for read-only data.
If policy requires internal-only ingress, the hostname must be added to ava:installed_remote_mcp_managed_hosts in deployment configuration — see the callout near the top of this page.
Step 4 — Register it in AVA
Add the server
Admin → Tools & Skills → MCP servers → Add server. Paste the container app's HTTPS URL and name it ZoomInfo.
Configure Advanced
Choose the whole deployment signs in (client credentials). Token URL is https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token; client ID and secret are from an Entra app registration that has been granted your server's app role; scopes are api://<your-app-id>/.default; Resource / audience is api://<your-app-id>.
Set availability
Restrict to the Entra groups that should have ZoomInfo access — sales, marketing, revenue operations. ZoomInfo data is licensed and this is where you enforce who gets to spend it.
Probe
AVA connects and records your tools. Every tool should show as read. If one shows as write, its name reads as a write to AVA's classifier — rename it (get_, search_, list_, enrich_ all read cleanly).
Decide on scheduled tasks
A client-credentials server is background-capable, so read tools become available to scheduled tasks. That is genuinely useful — "every Monday, enrich the accounts added to the pipeline last week" — but it is also unattended credit spend. Turn it on only once your budget guard is proven.
Tune retrieval
Ask realistic questions in chat. If the model reaches for the wrong tool, or misses ZoomInfo entirely when it should have used it, edit the tool's description and keywords in the server's detail panel rather than changing the server.
Testing checklist
Run this before you let anyone else near it.
-
tools/listreturns over Streamable HTTP with a valid Entra token, and 401s without one. - The endpoint is HTTPS on 443 and resolves publicly.
- Every tool's input schema is
type: "object"with no external$ref. - All tool names match
A–Z a–z 0–9 _ . : -and are unique. - The largest realistic tool result is comfortably under 256 KB.
- Every call completes inside 15 seconds, including a cold JWT mint.
- The JWT is cached and refreshed before expiry, not minted per request.
- A bad input returns a readable error result, not a 500.
- Exhausting the credit budget returns a clear message.
- AVA's install classifies every tool as read.
- A user outside the assigned Entra groups sees no ZoomInfo tools at all.