Introducing a new way to review your PRs.

Read the announcement

solana-foundation / pay

CLI for Agentic payments (x402, MPP, AP2).

View on GitHub

30 documents · Updated Nov 11, 2026

docs / managed-mcp-service-providers

Managed MCP service providers

Managed MCP service providers expose payer-scoped wallet, data, and compute resources through MCP tools and narrow HTTP planes. They turn agent requests into controlled actions against external providers while keeping tenant ownership, payment state, service bindings, and scheduled execution separate.

This page is a child of Agent protocol integrations. Read MCP payment tools for the shared MCP payment surface and ACP payment middleware for the related ACP integration.

Service provider model

Each service has a provider-neutral MCP control plane and one or more external-provider drivers. A verified payer selects a driver, and the service maps the portable request to the provider resource while preserving the payer boundary.

ServiceMain capabilityCurrent provider role
WalletCreate and read durable receive walletsPrivy-managed Solana wallets
DataCreate document stores and read or change JSON documentsFirestore-backed serverless document stores
ComputeDeploy and invoke serverless workloadsPluggable workload and trigger drivers

The MCP endpoints require verified payer and payment-channel context. Public health checks remain separate from control actions. Driver registries report available capabilities so an agent can choose a supported provider or data class before it creates a resource.

References: rust/…/server.rs• L59-98 rust/…/server.rs• L74-81 rust/…/server.rs• L176-187 rust/…/driver.rs• L34-61 rust/…/driver.rs• L71-112 rust/…/driver.rs• L55-97

Payer authorization

Payer authorization supplies the identity that owns each resource. The service derives a stable private tenant key from the verified payer identity, then uses that key to scope provider resources and reject cross-tenant access.

The control planes accept a payer identity only with the required internal proof and a valid payment channel. The data plane also requires a capability proof when a deployed workload accesses a bound store. This separates public payment verification from service-to-service trust and prevents a caller from selecting another payer's resource by changing request data.

References: rust/…/server.rs• L128-175 rust/…/server.rs• L435-467 rust/…/server.rs• L558-583 rust/…/binding.rs• L75-162

Wallet services

The wallet service provides stable payer-local receive wallets for later payment allocation. Its driver boundary keeps wallet lifecycle rules independent from the wallet provider, while the current Privy driver creates or reads Solana wallets by a tenant-scoped external name.

Wallet creation is idempotent: repeating a name returns the existing wallet. Wallets remain after the funding channel closes because they can receive later earnings. The service exposes provider capabilities, creation, and lookup through the wallet MCP server; spending still depends on provider authorization and policy keys.

References: rust/…/server.rs• L59-92 rust/…/types.rs• L18-55 rust/…/privy.rs• L83-143

Data services

The data service offers payer-owned document stores through a portable document/serverless class. The current Firestore driver keeps each tenant's logical namespace separate and supports store lifecycle plus JSON document get, put, and delete operations.

An owner can publish paid reads for a store. Published access is read-only and uses a stable gateway identity; writes and deletes stay behind the payer-authenticated MCP control plane. Store deletion follows its reclaim policy: it can remove documents or retain the provider data while removing the managed claim.

References: rust/…/server.rs• L74-184 rust/…/types.rs• L24-58 rust/…/firestore.rs• L402-425 rust/…/firestore.rs• L544-631

Compute services

The compute service deploys payer-owned serverless workloads through provider drivers. It supports workload discovery, deployment, lookup, listing, deletion, operation polling, direct invocation, and gateway invocation. A gateway gives a deployed workload a stable public route while the control plane remains payer-authenticated.

Workload deletion first removes attached triggers, then removes the workload. Deployment can resolve managed data bindings before the provider driver receives the request, so the deployed revision receives only the capabilities selected by the payer.

References: rust/…/server.rs• L186-305 rust/…/server.rs• L264-289 rust/…/server.rs• L67-95

Service bindings

Service bindings connect a compute workload to a managed data store without putting provider credentials in the workload request. A binding request names the store, workload, allowed read and write actions, and a bounded lease.

The data service returns a signed capability and an internal URL path. The compute service injects these values as reserved PAY_BINDING_... environment entries into the workload. At runtime, the data service checks the capability signature, store identity, tenant, workload, permissions, and expiry before it performs the document action.

The binding flow is shown below.

sequenceDiagram
    participant Agent
    participant Compute as Compute MCP
    participant Data as Data service
    participant Workload
    Agent->>Compute: Deploy with a data binding
    Compute->>Data: Request scoped binding
    Data-->>Compute: Capability, path, expiry
    Compute->>Workload: Start revision with binding environment
    Workload->>Data: Read or write with capability
    Data-->>Workload: Document result

Bindings require at least one permission and use a default one-day lease unless the request sets another value within the allowed range. User environment keys with the reserved prefix are rejected so a workload cannot replace a managed capability with caller-supplied values.

References: rust/…/binding.rs• L91-161 rust/…/server.rs• L195-229 rust/…/binding.rs• L101-162 rust/…/server.rs• L248-266

Payment policy controls

Compute payment policies define the selling price and payout recipients for a public deployment. The policy stores wallet references rather than caller-selected addresses, and the wallet service resolves those references as ownership evidence.

Policy changes belong to the deployment owner and use monotonic versions. Updates require the last observed version, exact retries are safe, and deletion leaves a tombstone so an old policy cannot silently return after a deployment is removed or recreated. A policy fails closed when it is expired, deleted, attached to a different deployment incarnation, or backed by wallets that the owner does not control.

Payment splits use basis points and preserve the full selling price after rounding. The primary recipient receives the remainder, while every recipient must resolve to a unique Solana wallet owned by the deployment owner.

References: rust/…/payment_policy.rs• L14-73 rust/…/payment_policy.rs• L83-190 rust/…/payment_policy.rs• L193-241 rust/…/payment_service.rs• L146-240

Payment policy resolution

The payment service stores policies durably and resolves them only after it confirms the current deployment identity and recipient wallets. The public gateway asks for a policy by deployment host and request path; a successful result contains the price, supported payment scheme, expiry, and concrete payout allocations.

The policy path is intentionally separate from the public workload path. If storage, deployment lookup, wallet evidence, or policy validation fails, the policy endpoint reports that payment policy is unavailable instead of allowing an unpriced request to proceed.

The resolution flow is shown below.

flowchart LR
    A[Owner sets policy] --> B[Check deployment owner]
    B --> C[Store versioned policy]
    C --> D[Resolve owner wallets]
    D --> E[Gateway requests policy]
    E --> F[Validate deployment and expiry]
    F --> G[Return price and allocations]
    F --> H[Fail closed]

References: rust/…/payment_service.rs• L157-203 rust/…/payment_service.rs• L243-294 rust/…/server.rs• L484-503

Trigger execution

Triggers attach an invocation mode to an existing compute workload. The current portable trigger shape is a scheduled invocation with a cron expression and time zone, plus bounded input and headers. Trigger drivers own creation, lookup, listing, pause, resume, immediate runs, deletion, and provider cleanup.

The scheduler sends a trusted execution payload to the compute service. The internal endpoint checks a separate executor proof before the selected trigger driver invokes the target private path. Execution consumes prepaid capacity and strips payment credentials from the internal call; failures return a payment-required result rather than becoming an unauthenticated public invocation.

The trigger lifecycle is shown below.

sequenceDiagram
    participant Agent
    participant Compute as Compute MCP
    participant Scheduler
    participant Executor as Compute trigger endpoint
    participant Workload
    Agent->>Compute: Create trigger for deployed workload
    Compute-->>Scheduler: Store schedule and prepaid budget
    Scheduler->>Executor: Send trusted execution payload
    Executor->>Executor: Verify executor proof
    Executor->>Workload: Invoke private path with bounded budget
    Workload-->>Executor: HTTP result
    Executor-->>Scheduler: Return execution result

Deleting a compute workload cleans up triggers first. Channel cleanup also removes provider resources funded by the channel, so schedules and managed resources do not remain as orphaned paid work.

References: rust/…/trigger_types.rs• L19-61 rust/…/trigger_driver.rs• L39-62 rust/…/server.rs• L308-409 rust/…/server.rs• L505-551

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep driver capability reports aligned with the request defaults and gateway prefixes used for provider selection.
  • When binding fields change, update the issued capability claims, reserved environment names, and runtime verification rules together.
  • When wallet reference or policy fields change, preserve owner checks, deployment incarnation checks, version conflicts, and exact price conservation.
  • When trigger payloads or execution headers change, update scheduler targets and the proof and budget checks at the internal execution endpoint.
  • When tenant or payment-channel identity rules change, review wallet, data, compute, and channel-cleanup paths as one ownership contract.

Important failure modes

TriggerConsequenceGuard
Missing verified payer, channel, or internal proofMCP control action is rejectedAuth middleware requires the full verified context
Caller supplies a PAY_BINDING_ environment keyDeployment is rejectedCompute reserves the binding prefix
Binding capability is expired or names another storeWorkload data request is rejectedData runtime verifies the signed claim and path match
Policy version is staleA newer policy cannot be overwrittenVersioned updates require the observed version
Policy wallet evidence is missing or cross-tenantPaid gateway policy cannot resolveWallet resolver proves owner-scoped wallet references
Trigger executor proof is invalidScheduled invocation does not runInternal trigger endpoint checks a separate proof
Public data gateway targets a non-published storeRead is rejectedStore publication must explicitly enable gateway reads

Key files

FileWhy to read it
rust/…/server.rsWallet MCP tools, payer checks, and wallet recipient resolution boundary
rust/…/privy.rsExternal wallet provider behavior and durable tenant-scoped wallet identity
rust/…/server.rsData MCP tools, binding routes, runtime routes, and paid read gateway
rust/…/binding.rsSigned capability lifecycle for compute-to-data access
rust/…/firestore.rsFirestore document-store driver and tenant-scoped data behavior
rust/…/server.rsCompute MCP tools, bindings, payment routes, gateway calls, and trigger execution
rust/…/payment_policy.rsPolicy validation, ownership evidence, versioning, and payout allocation
rust/…/payment_service.rsDurable policy storage and wallet-backed policy resolution
rust/…/trigger_types.rsPortable trigger requests and trusted execution payload shape
rust/…/trigger_driver.rsTrigger provider boundary and cleanup contract