Virling

Pregunta a un asistente de IA qué canal de marketing, página o asistente de IA atrae a clientes que pagan. Analítica de ingresos de solo lectura que vincula Stripe, Paddle, Shopify y otros pagos con las visitas previas.

Servidor MCP alojado

npx add-mcp 'https://mcp.virling.com/mcp'

Se instala en Claude Code, Codex, Cursor y más

Documentación

MCP server

Virling serves a Model Context Protocol endpoint, so AI assistants such as Claude can read your reports and answer questions like “which channel made the most money last month?”. It is read-only. Apps sign in with OAuth, or use the same API keys as the Read API.

https://stats.example.com/mcp

It is served when the app is on (--app). Use your server’s public URL, as in VIRLING_BASE_URL. Assistants on the web, such as claude.ai, reach it from the internet, so it needs a public HTTPS address. Claude Code on your machine can also use a local one.

Authentication

There are two ways to sign in. Both read every site of your account and can’t change anything.

OAuth sign-in. Apps such as claude.ai and ChatGPT sign in with your Virling account: you add the URL, the app opens Virling, and you click Allow. It needs VIRLING_BASE_URL to be a public https:// URL at the root of its host, such as https://stats.example.com. On http://, or with a path such as https://example.com/virling, sign-in is off and only API keys work. Apps look for the sign-in metadata at the root of the host (RFC 8414 and RFC 9728), and Virling’s pages link to root paths, so serve it on its own host or subdomain. Connected apps are listed in Account settings > Connected apps, where you can revoke them. Only the account owner can connect an app.

API key. Create a key in Account settings > API keys in the app and send it on every request:

Authorization: Bearer vk_...

Requests without a valid key or token get 401 with a WWW-Authenticate header that points at the sign-in metadata.

For client developers

Virling follows the MCP authorization spec and is its own authorization server.

  • Protected resource metadata (RFC 9728) at /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-protected-resource. The resource is https://stats.example.com/mcp.
  • Authorization server metadata (RFC 8414) at /.well-known/oauth-authorization-server.
  • Dynamic client registration (RFC 7591) at /oauth/register. Clients are public: no secret, token_endpoint_auth_method is none.
  • Client ID Metadata Documents: a client_id that is an https URL is read from that URL when the app signs in. The document must name the same client_id, a client_name and its redirect_uris, and be at most 5 KB. Virling fetches it only from public addresses, does not accept a redirect, waits at most 3 seconds and keeps it for its Cache-Control max-age, an hour by default and a day at most.
  • Authorization code flow with PKCE, S256 only, at /oauth/authorize and /oauth/token. Redirect URIs must be https, or http on localhost, and must match a registered one exactly; a loopback URI may use any port. The response carries iss (RFC 9207).
  • The resource parameter (RFC 8707), when sent, must be the MCP URL. Tokens only work on /mcp, not on the Read API.
  • One scope, read. Access tokens last 1 hour. Refresh tokens last 30 days and rotate on every use; reusing an old one revokes the sign-in.
  • Tokens and codes are stored hashed, like API keys.

A dedicated MCP host

To give assistants a short address such as https://mcp.example.com/mcp while the app and sign-in stay on VIRLING_BASE_URL, point a second DNS name or tunnel at the same server and set VIRLING_MCP_URL=https://mcp.example.com (--mcp-url). It must be https with no path. Requests to that host answer only /mcp and the two /.well-known/oauth-protected-resource paths; everything else is 404 with no cookies. Its resource metadata names https://mcp.example.com/mcp as the resource and your base URL as the authorization server, so sign-in, authorization, tokens and registration stay there. Connect clients to <mcp_url>/mcp. Tokens are bound to the resource the app asked for: one for the MCP host works only there, and one for the base URL works on both. The base URL keeps working.

Claude Code

On an https server, add the URL and run /mcp in a session to sign in:

claude mcp add --transport http virling https://stats.example.com/mcp

Or send an API key, which also works on a local http server:

claude mcp add --transport http virling https://stats.example.com/mcp \
  --header "Authorization: Bearer vk_..."

Or in .mcp.json, with the key read from your environment:

{
  "mcpServers": {
    "virling": {
      "type": "http",
      "url": "https://stats.example.com/mcp",
      "headers": { "Authorization": "Bearer ${VIRLING_API_KEY}" }
    }
  }
}

For Claude Code, the CLI with --json works too, and uses less context per call.

claude.ai

For hosted Virling, add it from the Claude directory: open the listing, click Connect, and click Allow when Virling opens. For a self-hosted server, add a custom connector:

  1. Open Customize > Connectors and click Add custom connector. On Team and Enterprise plans, an Owner adds it under Organization settings > Connectors.
  2. Enter a name, such as Virling, and the URL https://stats.example.com/mcp. Leave the advanced settings empty.
  3. Click Add, then Connect. Virling opens: sign in if asked, then click Allow.
  4. Turn the connector on in a chat from the + menu.

On a server without https, use an API key instead: choose No sign-in and, under Request headers, add authorization with the value Bearer vk_....

ChatGPT

With developer mode on, create a custom app with the URL https://stats.example.com/mcp and OAuth authentication. ChatGPT opens Virling: sign in if asked, then click Allow.

Claude Code plugin

This repository is also a Claude Code plugin marketplace. The virling plugin bundles the agent skill and the MCP server:

claude plugin marketplace add virling/virling
claude plugin install virling@virling

In a session, /plugin marketplace add virling/virling and /plugin install virling@virling do the same. The plugin connects to hosted Virling at https://app.virling.com. Run /mcp, choose virling and sign in. If you self-host, add your own server instead, with the steps above. OAuth sign-in needs https; on http, use an API key.

Other clients

Any client that speaks the Streamable HTTP transport and can send a header works. Point it at /mcp with the Authorization header above. Virling answers each request with one JSON response; it does not open event streams or keep sessions, and GET /mcp returns 405. It speaks MCP 2026-07-28, which has no initialize and starts with server/discover, and the earlier revisions from 2025-03-26 to 2025-11-25.

Tools

ToolWhat it returnsArguments
list_sitesThe sites the key can read.none
get_overviewVisitors, payments, revenue, conversion and revenue per visitor, the previous period and the change.site, range
get_breakdownVisitors and credited revenue per channel, referrer, campaign, keyword, landing page, page, country, device, browser or OS.site, dimension (required), range, limit
get_channel_verdictsOne plain line per channel against the period before: what earned most, what to double, what earned nothing.site, range
get_retentionCustomers acquired, still paying, net and average LTV, refund rate and 30-day churn per first-payment channel, referrer and campaign, with a headline.site, range
get_ai_answersPer assistant: answers that opened the site’s pages, how often its answers to the site’s buyer questions name the site, cited pages, and the visitors and revenue it sent, with each question’s latest answer.site, range
list_paymentsPayments, newest first, with the credited visit and the visitor ID.site, range, filter, limit, offset
get_visitor_timelineOne visitor’s visits, pages, goals, exits and payments.site, visitor_id (required)

site is a domain from list_sites. It can be left out when the account has one site. A range is range (today, 7d, 30d, 90d, 12m or all) or from and to as YYYY-MM-DD. The results have the same fields as the Read API responses, as structured content and as JSON text.

To try the tools before any traffic arrives, open a new site and choose Try with sample data. Every tool then returns generated results, and Remove sample data clears them. See Read your dashboard.

Errors such as an unknown site come back as a tool result with isError: true and a message, so the assistant can correct itself.

Prompts

Clients that support MCP prompts list three, each taking an optional site:

PromptWhat it asks for
weekly_briefThe last 7 days against the week before, the best and the silent channel, and one thing to do.
channel_reviewKeep, fix or cut for each channel, by revenue, value per visitor and retention.
trust_checkHow much revenue is matched to a visit, why the rest is not, and the fix that matches the most.

What it refuses

The server only reads, and only what the dashboard shows:

  • Anything that changes data: no tool adds sites, goals, keys or payments.
  • Sites outside the account the key or sign-in belongs to. Another domain answers “site not found”.
  • Who a visitor is. There are no names, emails or IP addresses to return; visitors are IDs and generated names.
  • Raw events or bulk exports. Payments come at most 200 per call and breakdowns at most 1,000 rows.
  • Ranges over 10 years, or dates that are not YYYY-MM-DD.