Skip to main content

Connect an MCP client

The hosted MCP server uses your existing owned Telegram Ads connection. It exposes 14 read-only tools, with input schemas, output schemas and structured results.

Connection settings

SettingValue
TransportStreamable HTTP
Server URLhttps://tgads.tlmtr.dev/v1/connections/<connection-id>/mcp
HeaderAuthorization: Bearer <personal-token>
Required scopesmcp:read and ads:read

Replace the placeholders with your own connection ID and personal API token. Use a client that supports custom Authorization headers. OAuth-only clients cannot complete an automatic login with this development endpoint.

This endpoint is stateless and uses POST JSON-RPC. A standalone GET is not the initialization flow and returns 405. Let an MCP SDK perform initialization and tool discovery.

TypeScript example

Install @modelcontextprotocol/sdk in your client project, then use:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const id = process.env.CONNECTION_ID!;
const transport = new StreamableHTTPClientTransport(
new URL(
`https://tgads.tlmtr.dev/v1/connections/${encodeURIComponent(id)}/mcp`,
),
{
requestInit: {
headers: {
Authorization: `Bearer ${process.env.TGADS_TOKEN}`,
},
},
},
);
const client = new Client({ name: "my-ads-client", version: "1.0.0" });
try {
await client.connect(transport);
const { tools } = await client.listTools();
console.log(tools.map((tool) => tool.name));
const result = await client.callTool({
name: "list_accounts",
arguments: {},
});
if (result.isError) throw new Error("Telegram Ads read failed");
console.log(result.structuredContent);
} finally {
await client.close();
}

Available tools

ToolResult
list_accountsAccounts available to this session
list_adsOne page of account ads
get_adAd details and safe creative metadata
get_budgetDisplayed account balance and visible history
get_account_statsAccount time series
get_ad_statsAd time series
get_account_reportTyped monthly account report
get_ad_reportTyped monthly ad report
search_targetChannel, bot or query target lookup
get_targeting_optionsLanguages, topics, countries and limits
get_similar_channelsSimilar channel candidates
get_similar_botsSimilar bot candidates
search_locationsOne page of location candidates
check_ad_postValidate a text-only ad preview without saving an ad

Use tools/list to read the exact current arguments. list_accounts returns structured { accounts: [...] }; report tools return { report: ... }. Other shapes are declared by each tool's outputSchema.

Example requests to your assistant

  • “List my Telegram Ads accounts, then show the ads in the account I select.”
  • “Compare August ad reports by Telegram Ads starts and cost. Explain which ads had enough volume to compare.”
  • “Show the text and targeting for my best-performing ads, and suggest experiments.”

MCP cannot create, edit, activate or delete campaigns, or allocate funds. Connection setup and cookie replacement happen through the extension or connection API. See coverage before relying on a metric or upstream operation.