AI & MCP
For developers (SDKs)
Copy page
Use Hostino MCP from your own code with the Vercel AI SDK, OpenAI, the Anthropic API and the official MCP SDKs
If you are building your own app or agent, you can call Hostino tools directly from code.
| Item | Value |
|---|---|
| URL | https://mcp.hostino.ai/mcp |
| Transport | Streamable HTTP |
| Authentication | Authorization: Bearer <access_token> |
| Token lifetime | access one hour; refresh fourteen days |
Getting a token
You have three options:
- API token (simplest): at auth.hostino.ai/app → “API tokens” create an
hst_pat_…token with the permissions and lifetime you need and use it directly in place ofaccess_token(details). - Device Flow (simplest for scripts, CI and testing): run the commands in Quick start, method 2 and request the scopes you need, for example
services:read domains:read dns:read offline_access. Pass theaccess_tokento your code and use therefresh_tokento get a fresh one every hour. - OAuth inside your app: client-side SDKs (AI SDK, MCP SDK, OpenAI Agents JS) run the whole OAuth flow themselves with an
authProvider: automatic registration (DCR), PKCE and refresh.
Vercel AI SDK
// npm i ai @ai-sdk/mcpimport { createMCPClient } from '@ai-sdk/mcp';import { generateText, stepCountIs } from 'ai';
const mcp = await createMCPClient({ transport: { type: 'http', url: 'https://mcp.hostino.ai/mcp', headers: { Authorization: `Bearer ${process.env.HOSTINO_TOKEN}` }, // or: authProvider (an MCP SDK OAuthClientProvider) for automatic OAuth },});
try { const { text } = await generateText({ model: 'anthropic/claude-sonnet-5.5', tools: await mcp.tools(), stopWhen: stepCountIs(5), prompt: 'List the services that are due in less than 30 days', }); console.log(text);} finally { await mcp.close();}In older versions (AI SDK 5) the function is experimental_createMCPClient from the ai package.
OpenAI Responses API
from openai import OpenAI
client = OpenAI()resp = client.responses.create( model="gpt-5", tools=[{ "type": "mcp", "server_label": "hostino", "server_url": "https://mcp.hostino.ai/mcp", "authorization": HOSTINO_TOKEN, # the token itself, without "Bearer " "require_approval": "always", "allowed_tools": ["list_services", "list_domains"], }], input="Which of my domains expire soon?",)print(resp.output_text)With require_approval: "always", each call returns an mcp_approval_request that you approve with an mcp_approval_response (together with previous_response_id). Use allowed_tools to limit access to read-only tools.
OpenAI Agents SDK
from agents import Agent, Runnerfrom agents.mcp import MCPServerStreamableHttp
async with MCPServerStreamableHttp( name="Hostino", params={"url": "https://mcp.hostino.ai/mcp", "headers": {"Authorization": f"Bearer {token}"}}, cache_tools_list=True,) as server: agent = Agent(name="Assistant", mcp_servers=[server]) result = await Runner.run(agent, "List my services") print(result.final_output)Anthropic Messages API (MCP connector)
import anthropic
client = anthropic.Anthropic()response = client.beta.messages.create( model="claude-opus-5-5", max_tokens=1000, messages=[{"role": "user", "content": "List my Hostino services"}], mcp_servers=[{"type": "url", "url": "https://mcp.hostino.ai/mcp", "name": "hostino", "authorization_token": token}], tools=[{"type": "mcp_toolset", "mcp_server_name": "hostino"}], betas=["mcp-client-2025-11-20"],)To limit it to a few tools: {"type": "mcp_toolset", "mcp_server_name": "hostino", "default_config": {"enabled": false}, "configs": {"list_services": {"enabled": true}}}.
Official MCP SDKs
TypeScript
import { Client } from '@modelcontextprotocol/sdk/client/index.js';import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const client = new Client({ name: 'my-app', version: '1.0.0' });await client.connect(new StreamableHTTPClientTransport(new URL('https://mcp.hostino.ai/mcp'), { requestInit: { headers: { Authorization: `Bearer ${token}` } }, // or: authProvider for automatic OAuth}));const { tools } = await client.listTools();const res = await client.callTool({ name: 'list_domains', arguments: {} });Python
from mcp import ClientSessionfrom mcp.client.streamable_http import streamablehttp_client
headers = {"Authorization": f"Bearer {token}"}async with streamablehttp_client("https://mcp.hostino.ai/mcp", headers=headers) as (read, write, _): async with ClientSession(read, write) as s: await s.initialize() tools = await s.list_tools() res = await s.call_tool("list_services", {})For automatic OAuth in Python, use mcp.client.auth.OAuthClientProvider.
Notes
- Each tool needs a specific scope (listed in Remote MCP and Authentication). If the token lacks the scope, the tool returns a “Missing permission” error.
- Purchases and payments from code still need the account owner’s confirmation:
request_orderreturns an approval link, and in-chat confirmation needs a phrase that the user types themselves. - If you only need data and no language model, the API with the same token is simpler.
- Every tool call is recorded in the panel → API / MCP → “Usage log” (app/token, tool, result, duration and
request_id). When you contact support about an error, send therequest_id(details). - To see new capabilities, read the changelog feed (
GET https://api.hostino.ai/v1/changelogor thechangelog_listtool).