Spec Driven Development
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Educational Weather Stats MCP Service — Tollbooth DPYC monetization sample
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
ใช้ได้ทั้ง Claude บนเว็บ แอปคอมพิวเตอร์ และมือถือ:
https://tollbooth-sample.fastmcp.app/mcpพิมพ์คำสั่งนี้ใน Terminal
claude mcp add --transport http tollbooth-sample https://tollbooth-sample.fastmcp.app/mcpวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"tollbooth-sample": {
"url": "https://tollbooth-sample.fastmcp.app/mcp"
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"tollbooth-sample": {
"type": "http",
"url": "https://tollbooth-sample.fastmcp.app/mcp"
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ChatGPT ต่อได้เฉพาะ server ที่อยู่บนอินเทอร์เน็ต:
https://tollbooth-sample.fastmcp.app/mcpชื่อเมนูอาจต่างกันเล็กน้อยตามแพ็กเกจและรุ่นของแอป
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
ยังไม่ได้อ่านรายการเครื่องมือของตัวนี้ เราตรวจ endpoint ทีละชุดวนไป
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub lonniev ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้ตรวจ เราตรวจ endpoint ทีละชุดวนไป
ยังไม่ได้ตรวจ เราตรวจ endpoint ทีละชุดวนไป
ยังไม่ได้ตรวจ เราอ่านรายการเครื่องมือตอนตรวจ endpoint
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนคลาวด์ของผู้ทำ ต่อผ่านอินเทอร์เน็ตได้เลย ไม่ต้องลงโปรแกรม แต่ข้อมูลที่ส่งให้จะผ่านเซิร์ฟเวอร์ของผู้ทำ
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.5.0) เข้า registry 16 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต่อผ่าน URL จึงใช้กับโปรแกรมที่รับ remote MCP ได้ เช่น ChatGPT ที่เปิดโหมดนักพัฒนา
ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, FlyDocs
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Spec-driven development workflow: your agent works issues, sessions and the status lifecycle.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Educational Weather Stats MCP Service — the reference implementation for building Tollbooth DPYC monetized API services with Bitcoin Lightning micropayments.
This service wraps the free Open-Meteo weather API and gates paid tool calls through the Tollbooth credit system using the @runtime.paid_tool() decorator. Domain tools contain only business logic; debit, rollback, balance warnings, and constraint evaluation are handled automatically by the OperatorRuntime. Standard DPYC tools (balance, purchase, Secure Courier, Oracle, pricing, constraints) are delegated to the wheel via register_standard_tools().
bootstrap-dpyc-operator skillThis repo doubles as a Claude Code plugin. The bootstrap-dpyc-operator skill turns your existing REST API, stdio MCP, or HTTP MCP into a monetized DPYC Operator MCP: it clones this template live, wraps your domain logic, and generates a deploy-ready project. You keep writing business logic — the SDK handles payments, identity, vault, audit, and pricing.
Install it in Claude Code:
/plugin marketplace add lonniev/tollbooth-sample
/plugin install bootstrap-dpyc-operator@tollbooth-dpyc
Then ask Claude to *"make my API a paid DPYC operator"* — the skill activates automatically by its description. It never touches your original code (it emits a sibling -mcp/ project) and reads this repo's live wheel pin on every run, so it can't go stale.
See skills/bootstrap-dpyc-operator/ for the skill and its reference guides (canonical pattern, source adapters, sessions & vaults, onboarding checklist).
DPYC stands for Don't Pester Your Customer. It's a philosophy and protocol for API monetization that eliminates mid-session payment popups, subscription nag screens, and KYC friction.
npub), not an email or password. One keypair per role, managed by the user. No account creation forms.ToolIdentity object with a deterministic UUID v5 derived from a capability name. Pricing hints come from the category field:| Category | Pricing hint | Use case |
|---|---|---|
free | 0 sats | Balance checks, status |
read | 1 sat | Simple lookups |
write | 5 sats | Multi-step operations |
heavy | 10 sats | Expensive queries |
Actual prices are set dynamically by the operator's pricing model in Neon.
tool_idEach domain tool is registered as a ToolIdentity with a frozen `tool_id` (an opaque UUID), a capability name, a category (pricing hint), and an intent description. Mint the UUID once at the tool's birth — run capability_uuid("get_current_weather") at a REPL (or uuid.uuid4()), then paste the result as a literal constant and never change it again. Freezing the literal is what lets you rename a capability later without orphaning its pricing rows in Neon. Do not call capability_uuid(...) at runtime; the identity must live in exactly one place:
from tollbooth.tool_identity import ToolIdentity, STANDARD_IDENTITIES
from tollbooth.runtime import OperatorRuntime, register_standard_tools from tollbooth.credential_templates import CredentialTemplate, FieldSpec from tollbooth.credential_validators import validate_btcpay_creds
GET_CURRENT_WEATHER_UUID = "b7327eb8-92b4-5252-84e0-ba3f437a16ed" GET_WEATHER_FORECAST_UUID = "b6d0e596-3aec-5a62-980b-7875aa04d079" GET_HISTORICAL_WEATHER_UUID = "5608f3e9-44c4-5b28-9744-704af6d701f0"
_DOMAIN_TOOLS = [ ToolIdentity( tool_id=GET_CURRENT_WEATHER_UUID, capability="get_current_weather", category="read", intent="Get current weather conditions", ), ToolIdentity( tool_id=GET_WEATHER_FORECAST_UUID, capability="get_weather_forecast", category="write", intent="Get weather forecast", ), ToolIdentity( tool_id=GET_HISTORICAL_WEATHER_UUID, capability="get_historical_weather", category="heavy", intent="Get historical weather data", ), ]
TOOL_REGISTRY: dict[str, ToolIdentity] = {ti.tool_id: ti for ti in _DOMAIN_TOOLS}
@runtime.paid_tool() decoratorEvery paid tool is a single decorator away from full DPYC monetization. The decorator takes the tool's frozen tool_id constant and handles debit, balance checks, constraint evaluation, rollback on failure, and low-balance warnings automatically. Your tool function contains only domain logic:
from typing import Any
from fastmcp import FastMCP from tollbooth.params import PatronNpub
mcp = FastMCP("tollbooth-sample", ...)
runtime = OperatorRuntime( tool_registry={STANDARD_IDENTITIES, TOOL_REGISTRY}, operator_credential_template=CredentialTemplate( service="tollbooth-sample-operator", version=2, description="Operator credentials for BTCPay Lightning payments", fields={ "btcpay_host": FieldSpec(required=True, sensitive=True, ...), "btcpay_api_key": FieldSpec(required=True, sensitive=True, ...), "btcpay_store_id": FieldSpec(required=True, sensitive=True, ...), }, ), credential_validator=validate_btcpay_creds,
holder_auth_url="https://tollbooth-sample.fastmcp.app", ... )
tool = register_standard_tools(mcp, "weather", runtime, ...)
@tool @runtime.paid_tool(GET_CURRENT_WEATHER_UUID) async def current( latitude: float, longitude: float, npub: PatronNpub = "", ) -> dict[str, Any]: """Get current weather conditions for a location.
Returns temperature, wind speed, and weather code from Open-Meteo. """ return await weather.get_current(latitude, longitude)
That is the complete paid tool. No manual debit calls, no try/except rollback blocks, no balance-warning plumbing. The decorator:
ToolIdentity registry by UUIDnpub from the function arguments for billing`register_standard_tools(mcp, "weather", runtime, …)` — Registers all standard DPYC tools (balance, purchase, payment, pricing, Secure Courier, Oracle, constraints) from the tollbooth-dpyc wheel, mounts oracle delegations under _oracle_*, and returns the slug-prefixed @tool decorator. Capture the return so you can use the same decorator for your own paid tools — every wire-exposed name on this operator then shares one slug prefix.
`validate_btcpay_creds` — Credential validator that checks BTCPay credentials at receive time, not at first use. Invalid credentials are rejected immediately during the Secure Courier exchange.
`CredentialTemplate` — Declares the operator's required secrets (BTCPay host, API key, store ID) so the Secure Courier flow can prompt for the right fields and validate them on delivery.
npub parameterEvery paid tool must accept an npub keyword argument. It tells the runtime which patron to bill; the connection proves the caller holds it. Use the SDK's PatronNpub type so every operator describes it the same way:
from tollbooth.params import PatronNpub
npub: PatronNpub = ""
A paid tool called with an empty or invalid npub is refused (npub is required) before your function runs.
Tool call arrives
| v @runtime.paid_tool(GET_CURRENT_WEATHER_UUID) | +-- UUID lookup in tool_registry -> ToolIdentity + pricing +-- npub extraction from kwargs; the connection proves it | +-- Constraint chain from the pricing model (discounts, surge, supply caps, coupons) +-- Balance check + debit | | | insufficient --> Return error (no function call) | +-- Call your function | | | exception --> Automatic rollback, return error | +-- Append low-balance warning if needed | v Return result to caller
Constraints are dynamic pricing steps that live in the operator's pricing model: each tool's chain in the model lists the steps the ConstraintGate walks on every call, and coupons bound to the tool are added after them. Author them in Pricing Studio or with weather_set_pricing_model; nothing is switched on by environment variable.
Common constraint types (the SDK registry holds more — weather_list_constraint_types enumerates the full set live):
| Type | Effect |
|---|---|
free_trial | First N calls are free |
happy_hour | Discount during specific hours |
temporal_window | Allow calls only during a time window |
finite_supply | Cap total invocations globally |
loyalty_discount | Discount after spending N sats |
bulk_bonus | Discount after N invocations |
surge_pricing | Demand-elastic multiplier during high demand |
Use weather_check_price to preview constraint effects without spending credits — it walks exactly the chain the debit will.
New to Tollbooth? See [GETTING-STARTED.md](GETTING-STARTED.md) for a step-by-step guide covering Nostr keypair setup, Authority enrollment, BTCPay configuration, and deploying your first monetized MCP service.
git clone https://github.com/lonniev/tollbooth-sample.git
cd tollbooth-sample pip install -e ".[dev]" python -m tollbooth_sample.server
This serves over STDIO. There is no development bypass: paid tools are gated exactly as in production, and the patron's npub is proven by the HTTP connection (a NIP-98 signed request or an OAuth holder bearer), s
ตัดมาแค่ช่วงต้น อ่านต่อใน repo