Mahshar

io.github.sharken3948由 GitHub 帳號 sharken3948 發布v1.0.0更新於 Oct 30, 2026

Free API discovery for AI agents; execution may require USDC/x402 payments on Arc Mainnet.

已驗證Streamable HTTP可網頁執行金融開發者工具商業與電商

概覽

AI 產生的概覽

Mahshar 是遠端 MCP 端點,用來探索按次付費的 API,並在 Arc 主網上準備 USDC/x402 付費呼叫,由外部錢包簽章執行。

可以做什麼
  • 搜尋與檢視 API:search_apis 與 get_api 回傳機器可讀的上架資訊與中繼資料。
  • 準備並重放付費呼叫:execute_api_call 產生 x402 付款要求,並重放外部簽章的請求。
  • 取回結果:get_purchase_response 依特定購買紀錄取回對應回應。
  • 不需連接錢包即可瀏覽公開探索頁面與穩定的 API 詳情頁。
適用情境
適合助手需要尋找按次收費的第三方 API,並以使用者自行掌控的錢包發起付費請求時使用。僅做公開探索不需錢包;只有使用者願意在 Arc 主網花費 USDC 時,付費執行才值得接入。
執行需求
遠端 streamable HTTP 端點 mahshar.xyz(MCP 路徑 /api/mcp),不需安裝套件。付費執行需要持有 USDC 的 Arc 主網(鏈 ID 5042)錢包,且由買方在外部簽章,伺服器不保管私鑰。公開探索不需連接錢包。
安裝前請注意
付費呼叫會花費真實的 Arc 主網 USDC,價格由賣家按次設定。伺服器只準備付款要求而不簽章,每次簽章都需使用者確認。錢包工作階段儲存在 Cookie 中,敏感的刊登變更需要重新簽章。賣家的上游憑證保留在伺服器端,但請求資料會經代理轉送給第三方 API。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mahshar,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.sharken3948%2Fmahshar/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "mahshar": {
      "type": "http",
      "url": "https://mahshar.xyz/api/mcp"
    }
  }
}

README

Mahshar

The API marketplace for humans and autonomous agents, powered by USDC on Arc.

Mahshar lets API providers monetize existing endpoints without rebuilding billing infrastructure. Buyers and autonomous agents can discover APIs, pay per call in USDC, and receive responses through Mahshar's payment-aware proxy.

What Mahshar Does

For sellers:

  • List an existing API without changing its backend.
  • Set a USDC price per call.
  • Support public or credential-protected upstream APIs.
  • Keep upstream credentials hidden from buyers.
  • Track calls, earnings, and withdrawal state.
  • Receive seller earnings through the marketplace accounting flow.

For buyers and agents:

  • Discover APIs programmatically.
  • Inspect machine-readable API metadata.
  • Pay per request using USDC.
  • Retrieve responses tied to the exact purchase.
  • Never receive the seller's upstream credentials.

Public Discovery and Buyer Application

Mahshar provides crawlable public discovery surfaces without requiring a wallet connection:

The public discovery layer is isolated from wallet authentication, payment execution, and proxy behavior. The wallet-enabled /buyer application remains the place to connect a wallet and execute paid API requests.

Supported Upstream Authentication

ModelUpstream behavior
Public APINo credential is added.
API KeyA stored API key is injected as an authorized header only after target validation.
Bearer TokenA stored bearer credential is injected into the Authorization header only after target validation.
Query CredentialA stored credential is added as the configured query parameter only after canonical target authorization.
HTTP BasicAn encrypted username/password bundle is applied server-side after target validation.
Custom Credential HeadersOne or more encrypted header values use configured, validated header names.
Custom AuthorizationA validated Token or ApiKey Authorization scheme is applied server-side.
OAuth 2.0 Client CredentialsAn approved provider profile uses a seller-owned connection; configuration and access tokens remain encrypted server-side.

The Client Credentials profile must be enabled by the operator. Authorization Code + PKCE is present in the implementation but disabled in Production. An active provider connection does not activate a listing; publication still requires verification. Stored credentials and tokens are server-side data and are not included in buyer responses or public discovery metadata. Provider authentication details.

How a Paid API Call Works

text
Buyer / Agent  → Discover API  → Request paid endpoint  → x402 payment requirement  → USDC settlement  → Canonical target authorization  → Seller credential injected server-side where required  → Upstream API  → Durable purchase-scoped response  → Buyer / Agent

Settlement, delivery, and response recovery have distinct durable identities. A recovery capability can retrieve only the response associated with its exact purchase.

Beyond the Arc Reference Apps

circlefin/arc-commerce demonstrates purchasing application credits with USDC, while circlefin/arc-p2p-payments demonstrates wallet-based peer-to-peer payments.

Mahshar adds application-layer primitives for machine-readable paid API discovery, MCP-native discovery and externally signed execution, x402 pay-per-call API monetization, canonical upstream authorization before credential injection, server-side seller credential isolation, prepared-call integrity, purchase-scoped response recovery, and durable payment, settlement, accounting, and delivery state handling.

Mahshar composes existing x402, MCP, Circle Gateway, USDC, Arc wallet, CCTP, and bridge infrastructure; it does not claim to have invented those technologies. See Reusable Arc primitives for implementation boundaries, verification status, and extraction requirements.

Arc Mainnet

Mahshar's production network is Arc Mainnet, chain ID 5042 (eip155:5042). Marketplace prices, buyer payments, platform accounting, and seller earnings are denominated in USDC.

Public Arc Mainnet Verification

Mahshar-owned:

The public address above is Mahshar's platform wallet on Arc Mainnet. The linked historical transaction is a successful call from that wallet to the official Arc Memo contract and can be independently verified in the Arc explorer. It is evidence of Mainnet operation and is not presented as independent proof of an x402 buyer purchase. Private signing material is never committed to the repository.

Automatic Memo writes have been removed. The linked transaction remains historical Mainnet evidence; paid API execution relies on Circle Gateway settlement and durable purchase, delivery, and response records, with no auxiliary platform-wallet transaction.

Official Arc/Circle contracts currently used by Mahshar:

ContractAddress
Arc USDC0x3600000000000000000000000000000000000000
Gateway Wallet0x77777777Dcc4d5A8B6E418Fd04D8997ef11000eE
Gateway Minter0x2222222d7164433c4C09B0b0D809a9b52C04C205

These are official system contracts, not Mahshar contracts. Mahshar currently deploys no custom smart contract.

The installed Circle x402 runtime requires explicit Arc Mainnet RPC configuration and its current Mainnet compatibility settings. See .env.example and agent integration for the repository's operational contract.

Wallet Authentication

Normal browser authentication is designed to avoid repeated signature prompts:

text
Connect wallet  → Sign one login challenge  → Fixed eight-hour authenticated session  → Use normal marketplace features without repeated wallet prompts

The server stores an opaque, wallet-bound session in an HttpOnly cookie. The session has a fixed expiry and does not become permanent through activity. Wallet changes isolate private state and require authentication for the newly connected wallet.

Fresh operation-specific signatures remain required for:

  • Seller withdrawals.
  • endpoint_url changes.
  • auth_type changes.
  • Stored credential, OAuth configuration, or provider connection changes.
  • Authentication parameter-name changes.
  • HTTP method changes.
  • Dynamic-path, path-parameter, or query-parameter security-contract changes.

Normal navigation, private reads, and edits to names, descriptions, categories, prices, examples, documentation, and other presentation fields use the existing session.

Security Architecture

Mahshar includes layered controls for payment-aware proxying and wallet-scoped marketplace data:

  • Canonical upstream target validation before credential injection.
  • Traversal and encoded-traversal rejection.
  • Declared dynamic-path and query-parameter contracts.
  • Duplicate-query and credential-query collision protection.
  • Seller credential non-disclosure.
  • Purchase-scoped response recovery.
  • Durable x402 settlement and delivery state.
  • Atomic seller withdrawal reservations.
  • Durable fencing for ambiguous external execution.
  • Wallet-scoped private buyer and seller data.
  • Independent wallet and trusted-IP rate-limit buckets where applicable.
  • Bounded serialized response delivery.
  • A bounded declarative path/query matcher rather than arbitrary request-path JavaScript regular expressions.
  • Bounded response-retention and wallet-authentication pruning.
  • Origin and Fetch Metadata checks for session-authenticated mutations.
  • Fresh one-use operation authorization for sensitive listing changes.

These controls reduce identified risks; they are not a claim that the system is vulnerability-free. See Security documentation and SECURITY.md.

API Response Safety

Seller verification measures a representative serialized response. A response near Mahshar's delivery limit produces a seller-visible warning, and an over-limit representative response cannot complete verification. The runtime serialized-response limit remains authoritative for every paid delivery.

Verification observes one response and cannot guarantee that the upstream API will return the same size later.

Seller Withdrawals

Before external withdrawal work begins, Mahshar creates an atomic database reservation against the seller's currently available earnings. Concurrent requests cannot reserve the same earnings twice.

If submission or mint execution becomes ambiguous, the reservation remains locked in a recoverable submission_unknown or mint_unknown state. Confirmation and reconciliation are idempotent, and ambiguous money-moving operations are not blindly retried. The dashboard presents a status-check action instead of offering a duplicate withdrawal.

Machine Discovery

Autonomous clients should start with the public discovery endpoint and its current machine contract:

  • MCP V1 endpoint: https://mahshar.xyz/api/mcp (stateless discovery through search_apis and get_api, real x402 challenge preparation and externally signed replay through execute_api_call, and purchase-capability recovery through get_purchase_response). Mahshar never accepts buyer private keys, signs automatically, or takes custody. A scripted external MCP Canary verified four paid Production executions covering HTTP Basic, custom API-key header, custom Authorization token, and multiple credential headers. All four responses and purchase-scoped recoveries succeeded, with matching application accounting and no observed duplicate payment or credential exposure. Gateway nanopayment balances updated; final onchain batch settlement was not independently verified. This was a scripted harness, not a fully autonomous AI agent. Earlier external-client verification also covered same-authorization replay without duplicate payment.
  • OpenAPI document
  • Agent integration guide

Runtime discovery and OpenAPI URLs are generated from the configured canonical marketplace origin.

Admin Acquisition

The first bounded Production mock canary completed successfully. Continuous draft-only acquisition is deployed. Execution follows operator-approved configuration and Admin Start/Stop controls. All server-only acquisition flags default to false; the existing bounded Discovery Worker remains the default. Enabling acquisition flags requires separate operator approval; deployment does not start the Worker. The consumed canary and historical invitations remain preserved.

The Brevo acquisition delivery integration is deployed with real sending disabled by default. Immutable acquisition drafts and simulated results remain separate from ordinary Admin Outreach messages. A separately authorized real delivery requires ADMIN_ACQUISITION_BREVO_ENABLED=true, verified sender/channel approval and current consent-backed recipient eligibility; a published email address is not permission to send. Only current, validated V2 template drafts can enter the linked Outreach reservation and one-shot transport path. Unsafe historical invitations remain blocked and all historical drafts remain unchanged. ADMIN_ACQUISITION_MODE requires exactly one authorized operating mode: ADMIN_ACQUISITION_CANARY or ADMIN_ACQUISITION_CONTINUOUS. Continuous mode reuses bounded cloud batches of up to 60 minutes, immediate eligible-run continuation, checkpoints, quotas and Start/Stop/Resume. It renders and saves the approved versioned English invitation template using current verified identity and contact evidence, independently of dispatch eligibility; draft preparation itself invokes no invitation inference and creates no reservation or dispatch. Company and product names require fresh provider-owned naming evidence; directory titles, OpenAPI titles and documentation headings are not independent naming proof. An unverified or conflicting company name uses a neutral greeting; an unverified or conflicting product name uses the approved generic API invitation. Application and database validation protect draft persistence, reservation and final transport, including historical drafts with unverified names. Historical Groq drafts remain preserved and qualification AI is unchanged. Directory contracts remain supporting evidence, historical skips remain available separately from current readiness, and Brevo stays deactivated. Existing provider-level reservation, DNC, suppression and sending authorization checks remain enforced. Rejected or uncertain real deliveries retain their reservations and are never automatically resent.

The Admin Worker dashboard separates distinct discovered/qualified providers, validated saved template and Groq invitations, and real accepted initial Outreach invitations. Simulated delivery never counts as a real send. Preparation counts distinguish immutable versioned template drafts from historical Groq drafts and require explicit persisted provenance; mock and historical unknown-origin drafts are excluded. Live Activity shows persisted checkpoints and Worker lifecycle events, with the latest three events initially and older saved history on demand. Exact executing stages are not inferred. Provider Activity lists each provider once by latest saved activity, shows three providers initially, and offers View All with pagination. View is read-only and includes saved research, provider activity timelines, exact invitation text and delivery details. Dashboard polling refreshes every 12 seconds while visible. Contact research distinguishes verified email, official form available, CAPTCHA/manual review required, unresolved research and no contact found. Provider View exposes saved official contact URLs; forms remain manual and a published email does not grant sending permission. Bounded commercial-first refresh revisits legacy no-email investigations while retaining technical qualification and contact history. Trusted provider reply counts remain unavailable until inbound sender identity is supported.

See Admin Acquisition controls and activation boundaries.

Admin Worker discovery has eight deployed, read-only catalog adapters: APIs.guru, Public API Lists, GitHub Public APIs, publicapis.dev's MIT repository, the Apify Store catalog, x402 List, PayAPI Market and bolthub. The additive source-allowlist migration is installed. Durable cursors, cached catalogs and bounded recovery share provider history, qualification, verified-contact and Pending Emails checks. Twelve other sources remain disabled. Discovery requires an authorized Worker Start; it neither executes paid catalog tools nor sends email automatically. Groq-backed qualification is separate from the deterministic acquisition canary and continuous Worker. See Admin Worker discovery.

Pending Emails is a separate Admin-only Automation page at /admin/operations/pending-emails for tracking emails sent externally. It uses verified, qualified Worker contacts independently of invitation drafts and preserves permanent manual-sending history without sending email or fabricating delivery receipts. The registry migration is installed in Production. Historical reconciliation/import and Worker processing require separate operator authorization; this deployment does not start the Worker or enable email delivery. See Admin Pending Emails.

Wallet Funding

Mahshar supports Circle Onramp funding for a connected Arc Mainnet wallet. It is available from the dashboard Wallet workspace and from the Buyer application when additional Arc USDC is needed.

The dashboard provides explicit Circle Bridge Kit flows for SDK-supported Mainnet USDC routes into the user's connected Arc Mainnet wallet. The dedicated Solana to Arc workspace moves supported SPL USDC from a connected Solana source wallet to that Arc wallet. Route availability is derived from the installed SDK rather than a fixed list in this README.

After USDC arrives on Arc, depositing it into the user's Gateway balance is a separate, explicit wallet action through Circle App Kit. Bridge and wallet funding flows remain separate from paid API execution; completing a bridge does not automatically purchase or call an API.

See dynamic Circle routes for implementation details and current limitations.

Repository Structure

PathPurpose
src/app/Next.js pages, layouts, and route handlers.
src/lib/Marketplace, payment, authorization, proxy, and integration logic.
src/components/Shared client and server UI components.
supabase/migrations/Ordered forward database migrations.
tests/Marketplace, payment, database, dashboard, and integration regressions.
docs/Detailed architecture, operations, and security documentation.
scripts/Read-only audits, local verification, and explicitly gated utilities.

The reviewer-oriented primitive inventory maps the reusable payment, proxy, discovery, MCP, integrity, and recovery patterns to their implementation files.

Database Setup

Follow Database bootstrap. A fresh environment requires the reviewed base schema followed by the complete ordered migration chain; migrations must not be skipped or reordered.

Security Documentation

Security reports should follow SECURITY.md.

Development

bash
npm installnpm run dev

Type-check the project:

bash
npx tsc --noEmit --incremental false --pretty false

Create a production build:

bash
npm run build

Environment

Copy .env.example to .env.local and provide the required local values.

Never commit production secrets. Server-only private keys, service-role credentials, encryption material, API keys, internal API secrets, and cron authorization secrets must never use a NEXT_PUBLIC_ prefix.

Arc Mainnet RPC roles

  • Passive browser Arc Wallet USDC reads use the optional, browser-safe NEXT_PUBLIC_ARC_MAINNET_RPC_URL, then Arc's official public RPC, an Arc-confirmed connected wallet provider, and finally Mahshar's fixed-purpose same-origin balance endpoint.
  • The balance endpoint and other server-side Arc reads use the server-only ARC_MAINNET_RPC_URL. This value may contain provider credentials and is never exposed to the browser.
  • Transaction simulations and receipt checks retain their operation-specific public clients; read failover does not select or submit a write transport.
  • Transactions are still submitted only through the connected wallet after the existing chain-convergence and user-confirmation checks.

NEXT_PUBLIC_ARC_MAINNET_RPC_URL is optional. If configured, it must be a non-secret Arc Mainnet endpoint that permits browser CORS. The shared wallet-balance cache is intentionally short-lived (four seconds); successful balance-changing actions force a refresh.

License

MIT.

來源:README.md,提交 89a0e1f

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v1.0.0最新Oct 30, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分