Deployment shapes
The hosted MCP is discovery-only. A private MCP can execute paid tools only when its operator explicitly configures a payer signer and budgets. The dashboard is optional and is not part of either core deployment.Docker quickstart
Requirements:- Docker Engine with Compose v2.
- About 2 GB of free disk for images and PostgreSQL.
- Outbound access to Stellar testnet RPC, Horizon, and Friendbot.
openx402/):
.env as POSTGRES_PASSWORD. Put the second
in .env as FACILITATOR_KEY_ENCRYPTION_KEY. The encryption key must decode
to exactly 32 bytes. Losing or changing it makes previously encrypted managed
keys unreadable.
From the repository root (openx402/):
postgres:pgvector/pgvector:pg17with a persistent volume;facilitator: HTTP on host port4022by default;mcp: discovery-only Streamable HTTP on host port4522by default.
STELLAR_TESTNET_SPONSOR_SECRET for this flow.
The sponsor pays network fees; it never becomes payer or payment recipient.
Check the running stack from the repository root (openx402/):
FACILITATOR_API_KEYS is set, add
Authorization: Bearer <configured-key> when calling /supported, /verify,
/settle, or /analytics/v1/*.
/health/ready gates database connectivity. Search status is included in its
JSON but a missing embedding provider does not make the facilitator unready.
Stellar accounts and balances are checked before the HTTP listener starts;
the readiness endpoint is not a continuous deep RPC or Horizon check.
Core-only deployment
MCP is not required. From the repository root (openx402/):
Configuration
The facilitator loads the YAML selected byFACILITATOR_CONFIG, defaulting to
config/self-hosted.yaml inside its container. Secrets are read through the
environment variable names referenced by that YAML.
Important environment variables in the root .env file:
The full key surface is in the
facilitator configuration reference.
Catalog origin policy
Both checked-in facilitator profiles require HTTPS for public resource URLs. They differ for local development:config/self-hosted.yamlsetscatalog_security.allow_local_origins: true, so loopback/private HTTP resources can be cataloged locally.config/railway.yamlsets it tofalse, so the hosted catalog rejects loopback, private, link-local, and plain-HTTP public resources.
Search profiles
The stock Docker image intentionally omits the optional local ONNX runtime. The default self-hosted YAML selects local BGE-M3, but without@huggingface/transformers the worker reports a degraded semantic provider and
search continues with PostgreSQL full-text retrieval. It does not download
model weights.
To run local embeddings, build a custom facilitator image that installs the
optional @huggingface/transformers peer dependency. Preserve the pinned model
repository, revision, dimension, pooling, and normalization settings unless
you intentionally create and reindex a new model generation.
For a remote OpenAI-compatible embedding provider, author a facilitator YAML
with search.semantic.provider: remote, then point
search.semantic.remote_url_env and remote_api_key_env at environment
variables containing the endpoint and optional bearer token. Provider errors,
timeouts, invalid dimensions, and missing pgvector degrade to lexical search.
See Search and indexing for provider contracts,
generation handling, and reindex commands.
Running MCP separately
The local MCP YAML defaults to stdio because an agent runtime normally launches the process directly. Docker cannot expose stdio as a network service, so the Compose service selects the Streamable HTTP Railway profile instead. For direct local discovery-only MCP, fromopenx402/mcp-server/:
signer.mode: none; only
x402_search_resources and x402_get_resource are registered. Paid execution
and its authentication, signer, budget, and network requirements are described
in the MCP server guide.
Railway one-click deployment
The Railway template creates private PostgreSQL plus public facilitator and discovery-only MCP services. It does not deploy the optional dashboard. In Railway, supply:FACILITATOR_EMBEDDING_URL=https://openrouter.ai/api/v1/embeddings and generates
the database password and facilitator encryption key. The Railway profile uses
openai/text-embedding-3-small, remote inference, and no reranker. A provider
failure degrades search to lexical retrieval; payment endpoints remain
available.
Use the complete Railway deployment guide for
service variables, health checks, and hardening.
Operations
All facilitator replicas must share the same PostgreSQL database andFACILITATOR_KEY_ENCRYPTION_KEY. PostgreSQL coordinates channel leases,
idempotency, fee budgets, indexing jobs, and recovery across replicas.
Back up from an operator shell with PostgreSQL client tools installed. Run from
the directory where the backup should be written:
openx402.dump:
DATABASE_URL and
FACILITATOR_KEY_ENCRYPTION_KEY exported, from openx402/facilitator/:
upto contract-instance and Wasm-code
TTLs.