{"id":51295436,"url":"https://github.com/bitcryptic-gw/mdf-reference-server","last_synced_at":"2026-06-30T14:01:51.855Z","repository":{"id":361366204,"uuid":"1251907431","full_name":"bitcryptic-gw/mdf-reference-server","owner":"bitcryptic-gw","description":"Reference implementation of the MDF (Markdown First) spec — self-hostable Bun/Docker server with content negotiation, discovery, and payment stubs","archived":false,"fork":false,"pushed_at":"2026-05-30T11:01:37.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T11:09:10.224Z","etag":null,"topics":["ai","ai-agents","bitcoin","http","l402","markdown","markdown-first","mdf","open-source","self-hosted","web-standards","x402"],"latest_commit_sha":null,"homepage":"https://github.com/bitcryptic-gw/mdf","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitcryptic-gw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-28T02:38:29.000Z","updated_at":"2026-05-30T11:01:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bitcryptic-gw/mdf-reference-server","commit_stats":null,"previous_names":["bitcryptic-gw/mdf-reference-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bitcryptic-gw/mdf-reference-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcryptic-gw%2Fmdf-reference-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcryptic-gw%2Fmdf-reference-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcryptic-gw%2Fmdf-reference-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcryptic-gw%2Fmdf-reference-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitcryptic-gw","download_url":"https://codeload.github.com/bitcryptic-gw/mdf-reference-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcryptic-gw%2Fmdf-reference-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34969682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agents","bitcoin","http","l402","markdown","markdown-first","mdf","open-source","self-hosted","web-standards","x402"],"created_at":"2026-06-30T14:01:51.157Z","updated_at":"2026-06-30T14:01:51.845Z","avatar_url":"https://github.com/bitcryptic-gw.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mdf-reference-server\n\nReference implementation of the [MDF (Markdown First)](https://github.com/bitcryptic-gw/mdf) spec.\n\nA self-hostable server that serves markdown natively to AI agents via HTTP content negotiation, with structured discovery, payment-gated content tiers, and bearer token auth. Built with Bun, configured via a single YAML file, runs as a non-root Docker container.\n\n**Live demo:** https://mdf-demo.bitcryptic.com  \n**Spec:** https://github.com/bitcryptic-gw/mdf  \n**Status:** v0.1.0-draft — payment verification is stubbed; see [open milestones](#status)\n\n![mdf-server dashboard](docs/dashboard.png)\n\n---\n\n## Quick start\n\n```bash\n# Clone\ngit clone https://github.com/bitcryptic-gw/mdf-reference-server.git\ncd mdf-reference-server\n\n# Create the secrets directory and wallet address file\nmkdir -p secrets\necho -n 0xYourWalletAddress \u003e secrets/wallet_address\nchmod 600 secrets/wallet_address\n\n# Build and run\ndocker compose up --build\n```\n\nThe server listens on port 3030 (host) → 3000 (container). The dashboard is on port 9090, no external mapping — access via Tailscale or internal network.\n\n---\n\n## Try it\n\n```bash\n# Discover the site's MDF capabilities\ncurl https://mdf-demo.bitcryptic.com/mdf.json\n\n# Fetch the agent index\ncurl https://mdf-demo.bitcryptic.com/llms.txt\n\n# Request markdown directly (agent-style)\ncurl -H \"Accept: text/markdown\" https://mdf-demo.bitcryptic.com/\n\n# Free content — no payment required\ncurl -H \"Accept: text/markdown\" https://mdf-demo.bitcryptic.com/docs/getting-started\n\n# Paid content — returns 402 with payment instructions\ncurl -H \"Accept: text/markdown\" https://mdf-demo.bitcryptic.com/premium/deep-dive\n\n# Private content — returns 402 with auth endpoint hint\ncurl https://mdf-demo.bitcryptic.com/private/internals\n```\n\n---\n\n## Configuration\n\nAll server configuration lives in `mdf.yaml`. The wallet address is never in config — it is read from `/run/secrets/wallet_address` at startup (file-mounted via Docker, not an env var).\n\n```yaml\nsite:\n  url: https://your-domain.com\n  name: Your Site Name\n  contact: admin@your-domain.com\n\npricing:\n  default:\n    amount: \"0.0001\"\n    currency: USDC\n    chain: base\n  sections:\n    /docs/**:\n      amount: \"0.0000\"\n    /premium/**:\n      amount: \"1.0000\"\n      currency: USDC\n      chain: base\n    /private/**:\n      amount: \"100.00\"\n      currency: USDC\n      chain: base\n```\n\nSee `mdf.yaml` in this repo for the full reference configuration.\n\n---\n\n## Content\n\nPlace markdown files under `content/`. The directory structure maps directly to URL paths. Frontmatter is supported. The server auto-generates `/mdf.json` and `/llms.txt` from `mdf.yaml` and the content directory at startup — no manual maintenance required.\n\n---\n\n## Payment rails\n\nTwo rails are implemented:\n\n**L402 (Bitcoin/Lightning)** — production-complete. Creates real Lightning invoices via Alby Hub, issues HMAC-bound macaroons, and verifies preimage submission against settled invoice records.\n\n**x402 (EVM/stablecoin)** — structural stub. Receipt shape is validated but on-chain settlement is not yet verified. See the [open issue](https://github.com/bitcryptic-gw/mdf/issues/3) for the x402 trust model discussion.\n\nSites advertise accepted rails via `payment.accepted_chains` in `/mdf.json`.\n\n---\n\n## Reverse proxy\n\nA Caddy snippet is included at `caddy/Caddyfile`. Point your reverse proxy at port 3030.\n\n---\n\n## Status\n\n| Feature | State |\n|---------|-------|\n| HTTP content negotiation (`Accept: text/markdown`) | ✅ Complete |\n| `/mdf.json` + `/llms.txt` auto-generation | ✅ Complete |\n| ETag / `Last-Modified` caching headers | ✅ Complete |\n| Atom feed with `mdf:change_type` extension | ✅ Complete |\n| WebSub hub declaration | ✅ Complete |\n| Bearer token issuance (auth-via-payment) | ✅ Complete |\n| Dashboard | ✅ Complete |\n| L402 payment verification (Bitcoin/Lightning) | ✅ Complete |\n| Validator CLI | ✅ Complete |\n| x402 on-chain receipt verification | 🔲 Next milestone |\n\n---\n\n## Development\n\n```bash\nbun install\nbun run src/index.ts\n```\n\nRun the smoke tests:\n\n```bash\nbash smoke-test.sh\n```\n\n36 tests across content negotiation, discovery, payment stubs, and auth — all passing.\n\n---\n\n## Authors\n\n**Gary Walker** / [BitCryptic™](https://bitcryptic.com)  \n**Graham Hall** / [Slepner](https://slepner.com.au)\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcryptic-gw%2Fmdf-reference-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcryptic-gw%2Fmdf-reference-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcryptic-gw%2Fmdf-reference-server/lists"}