Skip to content

Decide what each user gets

The MCP server asks two of your features about every request, and reads their outcomes by a fixed convention, the way your page reads a paywall feature. You build both in Revenue › Decision Engine › Features, with the same builder as any feature. See Create and edit a feature.

Asked once per tool call, about the user alone. It never sees a content item.

mcp_access returns The tool call
An outcome whose decision is allow Runs
Anything else, or no answer at all Is refused: You do not have access to this server.

Asked once for each content item a tool is about to return. The outcome’s id decides:

mcp_content returns The item
An outcome with the decision deny Dropped, whatever the id
An outcome whose reason is error Dropped
No outcome Dropped
Id full Reveals the whole text
Id excerpt Reveals the item’s lead only
Any other id Reveals metadata: the headline, the URL and the item’s details, no text

A dropped item is left out of search results, and fetch answers No content item with that id. as if it did not exist. What each reveal returns from each tool is on Search and read.

The paywall features your pages ask for do not apply here. If your users should get on the server what they get on your site, have mcp_content’s rules match your paywall’s.

A request to the MCP server always has a signed-in user and a site. It has no page, no device and no browser. So a rule here can read:

  • the user and their standing: user.*, user_site.*, and grants.*;
  • site.id;
  • meters, segments and per-user experiments;
  • profile.* and streaming.*, as on your pages;
  • in mcp_content only, the item.* facts below.

These read differently from a page:

Facts On the MCP server
user.state Never anonymous: every caller is signed in
device.token Empty
request.* request.geo is empty, and request.new_device and request.preview are false
gift_link.* No gift link: gift_link.present is false
context.* None: there is no page to send them
external.* Empty on every site. A deploy is refused while mcp_access or mcp_content reads it
db_user_traits.*, bot.* Cannot be read. A rule that tests one is unreadable
item.* in mcp_access Cannot be read: the call is not about an item yet
signed.*, content.* Never: stage refuses a rule that names a content fact your site signs, in any feature

An unreadable rule does not hold. If no rule wins and one was unreadable, the canvas returns its error outcome, which drops the item or refuses the call. See What a rule can read.

Each item.* fact describes the content item being decided, as EdgeKit holds it from your CMS:

Fact Type Value
item.source_id string The item’s id in your CMS
item.source string The source key of the item’s content source
item.ref string The source key and the CMS id, <source key>:<id>: one item across all your content sources
item.sections list of strings The ids of the item’s sections, as your CMS gives them
item.tags list of strings The ids of the item’s tags
item.authors list of strings The ids of the item’s authors: your CMS’s id, or, for a byline without one, an id made from the name. A pushed source’s ids carry the CMS in front, such as glide:12
item.content_type string Your CMS’s type for the item, verbatim. Arc XP: the story’s type, such as story. WordPress: the post type, such as post
item.content_subtype string Your CMS’s subtype, verbatim. No value when it has none
item.published_at number When it was first published, else its display date, in milliseconds since 1 January 1970 UTC
item.language string A BCP 47 tag such as en-GB: your CMS’s, else the content source’s default language

The lists hold ids, never names, so a rule keeps working when a section is renamed. An author’s id is the last part of its address in Content › Content › Authors. Section and tag ids come from your CMS; the item’s screen in Content › Content › Items shows their names. item.published_at is a number so a rule can compare it: item.published_at is under 1767225600000 holds for an item first published before 2026.

item.* is an EdgeKit fact computed from the stored copy of your CMS content. It is not a content fact your site signs, and no rule here reads those.

No condition means “the site this request is for”. A rule that checks access to the current site writes that site’s id, which is the last part of its address in Delivery › Delivery › Sites, such as site_example. Write both tests in the same rule:

  • site.id is site_example;
  • grants.site_ids includes site_example.

A feature that runs on several sites needs one such rule per site. Without the site.id test, a user with a grant on one site would get full text on every site’s server.

A meter counts on the MCP server as it does on a page, with these differences:

  • fetch counts, search never does. search reads the count to decide each item but changes nothing, so listing results uses up nothing. fetch counts when its winning rule has Count a read if this rule wins, as a page read does.
  • Every count is the user’s. The caller is always signed in, so a device meter counts on the user too, as for a signed-in user on a page. See Whose count.
  • A seen-set needs a key this server has. An mcp_content rule may count on a seen-set keyed on an item.*, user.*, user_site.* or site.* fact. Keyed on item.ref, it counts each item once per period; item.source_id alone counts two content sources’ items with the same CMS id as one. Keyed on any of the others, it counts one read at most, since the key never changes here. The meter screen keys a seen-set only on a signed fact, which stage refuses here. Declare an mcp_content seen-set keyed on item.ref in a config tree.
  • A count meter counts every fetch. Fetching the same item twice counts twice.
  • No gift link. mcp_content may not count on a gift_link meter.
  • A reveal is never given without its count. If the count cannot be taken, for example because another fetch used the last free read at the same moment, the item is decided again on the new count. If the new answer would still count, the item is dropped.

Stage refuses a draft that breaks these rules, with one of these messages:

Message Cause
meter "<name>" is a seen-set keyed on "<field>", which this feature never has, so this tick could never be charged. Only mcp_content has item.*, and it has no page or device: give it its own seen-set keyed on item.ref. An mcp_content rule counts on a seen-set keyed outside item.*, user.*, user_site.* and site.*, such as signed.article_id. Or another feature counts on a seen-set keyed on item.*
meter "<name>" counts per gift link, and mcp_content never has one, so this tick could never be charged. An mcp_content rule counts on a gift_link meter

By default, a user who holds a live grant on any of your sites counts on no meter, here as on your pages. See How a meter counts.

Every signed-in user may use the server. A user whose grants reach the site gets full text, and everyone else gets the excerpt. The site’s id is site_example, and both features run on it alone.

mcp_access

  • Canvas signed-in, entered when user.state is one of registered, paid, which holds for every caller here. No rules.
    • else: id allow, Opens the article, reason match.
    • on error: id deny, Stops them, reason error.
  • Fallback: id deny, Stops them, reason default. On error: the same as the canvas’s.

mcp_content

  • Canvas items, entered by Everyone:
    • Rule grant-site_example: site.id is site_example, and grants.site_ids includes site_example. Returns id full, Opens the article, reason grant.
    • else: id excerpt, Opens the article, reason default.
    • on error: id deny, Stops them, reason error.
  • Fallback: id excerpt. On error: id deny, reason error.

A user with no grant on the site sees excerpts in search, with full_available false, and gets the excerpt from fetch. A user whose grant reaches the site sees the same excerpts in search with full_available true, and gets the whole text from fetch.

To give users without a grant five full items in any 30 days, declare a count meter mcp-reads that counts user on site_example (see Set up a meter), then add two rules to mcp_content below grant-site_example:

  • Rule paid-elsewhere: user.state is paid. Returns id excerpt, Opens the article, reason upgrade.
  • Rule free-read: mcp-reads is under 5, in the last 30 days, Count a read if this rule wins. Returns id full, Opens the article, reason meter.

paid-elsewhere catches users whose grants are all for other sites. They count on no meter, so without that rule free-read would give them full text with no limit.

While a user has fewer than 5 reads counted, search shows full_available true and counts nothing. Each fetch that returns full text counts one, including a second fetch of the same item. Once 5 are counted, fetch returns the excerpt and search shows full_available false.

For site_a and site_b, run both features on both sites, and give mcp_content one rule per site:

  • Rule grant-site_a: site.id is site_a, and grants.site_ids includes site_a. Returns full.
  • Rule grant-site_b: site.id is site_b, and grants.site_ids includes site_b. Returns full.

A rule may read an experiment arm. A per-user experiment assigns the user the same arm as on your pages. A per-device experiment assigns no arm here, because there is no device. The MCP server reports no exposures. See Experiments.

edgekit.ai