Use it from code

curl, Python and TypeScript samples.

Any MCP SDK works. Every request carries the token and the server keeps no session between requests, so there is no session id to manage.

List tools

curl https://ads.drefly.pro/api/ads/mcp \
  -H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' 

Call a tool

curl https://ads.drefly.pro/api/ads/mcp \
  -H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_placements","arguments":{}}}' 

Reading results

Successful calls return the data as JSON text in content and as an object in structuredContent. Failed calls return isError set to true with a plain message.

Response
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "{\"pages\": [...]}" }],
    "structuredContent": { "pages": ["..."] },
    "isError": false
  }
}

Next steps

Was this page helpful?