Excalibur Mcp

io.github.lonniev由 GitHub 账号 lonniev 发布v0.43.0更新于 Nov 4, 2026

FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native

已验证Streamable HTTP可网页运行效率与工作流沟通与协作

概览

AI 生成的概览

远程 MCP 服务器,让 AI 助手撰写、排期并向 X(Twitter)发布格式化帖子,按调用次数用积分付费。

可以做什么
  • 向 X 发布文字或配图推文(Markdown 转为 Unicode 富文本),并发布公开 Nostr 笔记
  • 创建、读取、更新、列出和删除存储的帖子,作为草稿或定时发布
  • 管理可复用片段与写作风格设定,并用服务端 LLM 润色指定段落
  • 搜索、列出、回复并标记 X 上的对话线索,保存生成线索的查询
  • 读取帖子指标、衍生表现评分及 SVG 表现信息图
  • 处理会话、余额、积分购买、优惠券、定价、公证与入驻相关工具
适用场景
适合希望由助手代写并发布 X 帖子、维护草稿与发布计划,或寻找并回复 X 上相关对话的场景。更适合已在 DPYC/Tollbooth 生态中、且接受按次付费的用户。
运行要求
通过 streamable HTTP 连接的远程端点,无需本地安装。需要 OAuth 认证,并在连接上证明 Nostr npub 身份(NIP-98 签名或私信证明流程),还需通过 OAuth2 加 PKCE 授权 X 账号。工具调用从预充值的比特币闪电积分余额中扣费,认证与余额类工具免费。
安装前请注意
工具调用按 sats 计费,购买会生成批次,涉及真实支出。服务器将 X OAuth 令牌与运营方凭据存放在托管的 Neon 保险库中;发布、回复、排期和删除会改变 X 上的公开数据。可选的 LLM、Modal 与 GitHub 凭据可通过 Secure Courier 流程提交。自托管需要运营方 Nostr 私钥 TOLLBOOTH_NOSTR_OPERATOR_NSEC。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Excalibur Mcp,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.lonniev%2Fexcalibur-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "excalibur": {
      "type": "http",
      "url": "https://excalibur-mcp.fastmcp.app/mcp"
    }
  }
}

README

eXcalibur MCP

Sword-swift posting of pretty tweets to X (Twitter) via AI agents, monetized with Bitcoin Lightning micropayments through the DPYC(TM) Tollbooth protocol.

[Python] [License]

eXcalibur is a FastMCP server that lets AI agents post to X (Twitter) with rich Unicode formatting and optional images. Patron authentication for X uses OAuth2 Authorization Code + PKCE -- no credentials appear in chat. Operator credentials (X app keys, BTCPay) arrive via human-in-the-loop Secure Courier and are stored in the operator's per-operator Neon vault schema. Tool calls are metered with Tollbooth DPYC(TM) pre-funded Lightning balances -- Don't Pester Your Customer.

Part of the DPYC(TM) Social Contract.

Getting Started

Connect via Horizon -- no local install needed:

https://excalibur-mcp.fastmcp.app/mcp

The web editor at https://excalibur.tollbooth-dpyc.com drives the same tools from a browser.

Step 1: Check Session

Call excalibur_session_status to see your current session state. If you have an active session with funded credits, you are ready to post.

Step 2: Prove Your Npub on the Connection

Identity rides on the connection, not on tool arguments. Connecting from an AI assistant is an OAuth holder connection: call excalibur_request_npub_proof(patron_npub=<npub>), reply to the Nostr DM it sends, then call excalibur_receive_npub_proof(patron_npub=<npub>, nonce=<nonce>) once. The connection then holds your npub for the lifetime you chose in the reply (up to 30 days), and every tool call passes only npub. A caller that holds the nsec may instead sign each HTTP request (NIP-98).

Step 3: X OAuth2 + PKCE (Patron Credentials for X)

  1. Get your Nostr npub -- use the dpyc-oracle's how_to_join() tool, or any Nostr client.
  2. Call excalibur_begin_oauth(npub=<npub>) -- returns an authorize_url. Open the primary authorize_url (not a shortlink) in your browser and authorize the app on X.
  3. Call excalibur_check_oauth_status(npub=<npub>) -- completes the code exchange, vaults the tokens, and activates your session.

Sessions are keyed by npub. Tokens are stored in the Neon vault and auto-refresh on expiry.

Step 4: Secure Courier (Operator Credentials)

Operator credentials (X OAuth2 app keys, BTCPay connection) are delivered via Secure Courier (service="excalibur-operator"). This is a human-in-the-loop flow: the operator consciously approves each credential delivery via their Nostr client. On receive_credentials, the relay DM is destructively drained -- credentials exist only in the Neon vault after receipt.

Credits Model

Tool calls cost api_sats per call. Each purchase creates a tranche; it expires only if the operator's pricing model sets a tranche_lifetime. Auth and balance tools are always free. Use excalibur_check_balance to see your balance and tranche expiry. Top up via excalibur_purchase_credits.

Available Tools

Standard Tools (from the wheel)

Standard DPYC(TM) tools are registered by register_standard_tools() from tollbooth-dpyc. These include session management, credit operations, Secure Courier, pricing, notarization, and Oracle delegation. Each tool is identified by a deterministic UUID v5.

CategoryTools
Session & Billingsession_status, check_balance, account_statement, account_statement_infographic, restore_credits, service_status, check_price, check_authority_balance
Secure Courierrequest_credential_channel, receive_credentials, forget_credentials, update_operator_credential, delete_operator_credential, update_patron_credential, delete_patron_credential, get_patron_credential_fields
Npub Proofrequest_npub_proof, receive_npub_proof, check_proof_status, held_identities
Purchase & Couponspurchase_credits, check_payment, mint_coupon, list_coupons, update_coupon, delete_coupon, redeem_coupon, list_my_coupons, forget_coupon
Pricing & Constraintsget_pricing_model, set_pricing_model, reset_pricing_model, list_constraint_types, list_canonical_identities
Notarizationnotarize_ledger, list_notarizations, get_notarization_proof
Onboarding & Adoptionget_operator_onboarding_status, get_patron_onboarding_status, request_adoption, adoption_status, restore_neon_schema
Nostr & Diagnosticsget_nostr_profile, publish_nostr_profile, request_echo, report_issue
OAuth (X)begin_oauth, check_oauth_status
Oracle (delegated)oracle_about, oracle_how_to_join, oracle_lookup_member, oracle_get_tax_rate, oracle_network_advisory

Domain Tools (eXcalibur-specific)

Domain tools are defined in server.py (with storage handlers under tools/). Prices are set by the operator's pricing model -- preview any call with check_price. Read and auth tools are free.

Posting to X

ToolDescription
post_tweetPost a text tweet with markdown-to-Unicode rich text formatting
post_tweet_imagePost a tweet with a hero banner image (image URL or SVG rendered to PNG)
get_x_profileFetch the connected X account's handle and name for this patron (free)
post_nostr_messagePublish a public Nostr note (kind 1) for your proven npub, signed by an ephemeral scribe key that p-tags you

Stored posts (drafts & scheduling)

ToolDescription
create_postStore a new post (draft or scheduled); returns its post_id
get_postRead one stored post by id (owner-scoped)
list_postsList your stored posts, server-side sorted, filtered, and paginated
update_postPatch a stored post (doc, publish_at, recurrence, status)
delete_postDelete a stored post (soft delete by default)

Snippets & Voice

ToolDescription
list_snippetsList your saved post snippets (server-side sorted/filtered/paginated)
get_snippetRead one saved snippet by id
save_snippetSave a reusable snippet (opening/footer/CTA)
delete_snippetDelete a saved snippet (free, owner-scoped)
get_voiceRead your saved writing Voice (profile blurb + banned words)
save_voiceSave your per-npub writing Voice

AI editorial & dynamic blocks

ToolDescription
refine_post_regionRefine a flagged region of a post with an LLM, server-side
resolve_dynamic_blockStart resolving a dynamic (prompt-backed) post block; returns a claim check
fetch_dynamic_blockRedeem a resolve_dynamic_block claim check (free, proof-gated)

Conversation leads

ToolDescription
find_conversationsSearch X for people asking questions you could answer; score and store them as leads
list_conversationsPage through your stored leads (free)
reply_to_conversationPost your reply into a lead's thread on X and mark the lead engaged
set_conversation_statusMark a lead new, seen, engaged or dismissed (free)
list_conversation_queriesList your saved conversation queries (free)
save_conversation_queryCreate or update a saved conversation query (free)
delete_conversation_queryDelete a saved query; its leads are kept (free)

Post metrics

ToolDescription
harvest_metricsCadence-aware sweep that snapshots X metrics for sent posts (operator-only)
get_post_metricsRead the metrics snapshot series for one of your posts
post_performanceDerived reach scores across your harvested post metrics
post_performance_infographicSVG infographic of post performance

Scheduler

ToolDescription
process_scheduled_postsPublish every due scheduled post (operator-only)
get_scheduler_logRead recent scheduler-tick outcomes
scheduler_statusThe scheduler's configuration and current status (free; any proven patron)
scheduler_pendingWhat the scheduled-post cron Worker is waiting on (operator-only)
scheduler_check_nowRun one scheduler tick now (any proven patron)
scheduler_reissueSend the scheduler's proof request again, now (operator-only)

OAuth flow tools (begin_oauth, check_oauth_status) are now standard tools provided by the wheel (see the Standard Tools table above).

Tools that take an npub take only the npub: the connection proves it (see Security).

Security

  • Npub identity -- Patrons are identified by a Nostr public key (npub), not an email or password. One keypair per role, managed by the user.
  • Identity on the connection -- A connection proves its npub in one of two ways: each HTTP request is signed with the npub's key (NIP-98, kind 27235), or an OAuth holder connection carries an Operator-signed grant earned through request_npub_proof / receive_npub_proof. The patron chooses the grant's lifetime, up to 30 days; held_identities and check_proof_status show what a connection holds.
  • Human-in-the-loop Secure Courier -- Credential delivery requires conscious operator approval via Nostr DM. On receipt, the relay message is destructively drained so secrets exist only in the encrypted Neon vault.
  • Per-operator Neon schema -- Each operator's credentials are stored in an isolated Postgres schema with a dedicated LOGIN role. No cross-operator access.

Architecture

src/excalibur_mcp/  server.py        FastMCP server -- domain tools + register_standard_tools()  config.py        Pydantic settings from environment variables  oauth_flow.py    X-specific OAuth2 Authorization Code + PKCE wrapper  x_client.py      X API v2 client with OAuth 2.0 Bearer token auth  formatter.py     Markdown -> Unicode rich text (bold, italic, headers)  refine.py        Server-side editorial refinement for the post editor  resolve.py       Server-side resolution of dynamic (prompt-backed) post blocks  resolver.py      Builds one post's finished body (the slow half: dynamic blocks)  publisher.py     Carries a finished body to X (the fast half: bill, post, record)  scheduler.py     Scheduled-post firing (publishes due posts on the owner's behalf)  conversation_scoring.py  Pure scoring + query composition for conversation leads  metrics_harvest.py       Post-metrics harvest cadence and derived reach scores  nostr_note.py    Public Nostr notes signed by an ephemeral scribe key  tools/           Domain storage handlers (posts, snippets, voices, conversations, metrics)  db/              eXcalibur persistence on the wheel's NeonVault (posts, snippets, voices,                   conversations, metrics, scheduler runs, migrations)modal_app.py       Detached runner for long dynamic-block resolves (Modal)scheduler-worker/  Cloudflare Worker cron that fires due scheduled postsfrontend/          The web editor (excalibur.tollbooth-dpyc.com)

Key design choices:

  • OAuth2 Authorization Code + PKCE -- Patron tokens acquired via browser flow. begin_oauth returns the primary authorize_url (not a shortlink); check_oauth_status completes the exchange. Tokens stored in Neon vault, auto-refreshed on expiry. No OAuth 1.0a.
  • UUID v5 tool identity -- Every tool (standard and domain) has a deterministic UUID derived from its capability name. Pricing, constraints, and billing all key on UUID.
  • Standard tools from the wheel -- register_standard_tools() provides all DPYC(TM) infrastructure tools. Only domain-specific X/Twitter tools are defined in server.py.
  • Markdown to Unicode -- Converts **bold**, *italic*, and # headers to Unicode characters that render in tweets without markup syntax.

Self-Hosting

Environment Variables

DPYC(TM) Identity (required to boot)
VariableRequiredDescription
TOLLBOOTH_NOSTR_OPERATOR_NSECYesOperator's Nostr secret key for identity bootstrap and DM encryption

This is the only env var required to start. All other secrets (X app keys, BTCPay credentials) arrive via Secure Courier credential templates and are stored in the per-operator Neon vault schema.

Operator Credentials (via Secure Courier)

These are delivered via Secure Courier (service="excalibur-operator"), not set as environment variables:

CredentialDescription
client_idX OAuth2 Client ID (from X Developer Portal)
client_secretX OAuth2 Client Secret (from X Developer Portal)
btcpay_hostBTCPay Server URL
btcpay_store_idStore ID for invoices
btcpay_api_keyAPI key with invoice permissions
llm_api_keyOptional. Model-router key (OpenRouter by default) for refine_post_region and dynamic blocks; posting works without it
modal_token_id, modal_token_secret, modal_app_nameOptional. Modal workspace that runs long dynamic-block resolves detached from the MCP host
github_repo, github_tokenOptional. Where report_issue files patron field reports (token needs only issues:write)

Certified operators bootstrap their Neon database URL from the Authority via encrypted Nostr DM -- NEON_DATABASE_URL is not read from the environment.

Optional Tuning
VariableDescription
SCHEDULER_WORKER_URLPublic URL of the scheduled-post cron Worker (default: https://excalibur-scheduler.lonniev.workers.dev)
RESOLVE_BLOCK_BUDGET_MAX_SCeiling, in seconds, on one dynamic block's LLM run (default: 1800); the job, lease and runner timeouts are derived from it

Troubleshooting

Cold start

On first request after deploy, the service may take a few seconds to initialize Neon connections and load the pricing model. The runtime handles this with inline retry -- the caller receives the result after the warm-up completes, not a "service unavailable" error.

Common tool call situations

Responses describe the current lifecycle state with guidance on the next step, not bare error messages.

  • proof_required -- The connection does not prove that npub (or its grant expired). Call request_npub_proof, reply to the DM, then receive_npub_proof once. check_proof_status shows how long a grant has left.
  • "Insufficient credit balance" -- Call purchase_credits to top up. Check tranche expiry with check_balance.
  • "Operator credentials not configured" -- Operator setup issue, not the patron's problem.

Don't Pester Your Customer: Do NOT ask the patron to re-authenticate, re-authorize, or re-do OAuth unless the response specifically says the upstream token is expired or invalid.

Development

bash
# Install in development modecd excalibur-mcppython -m venv .venvsource .venv/bin/activatepip install -e ".[dev]"
# Run tests.venv/bin/pytest tests/
# Type checkingmypy src/excalibur_mcp/
# Formattingblack src/ tests/ruff check src/ tests/

DPYC(TM) Ecosystem

Trademarks

DPYC, Tollbooth DPYC, and Don't Pester Your Customer are trademarks of Lonnie VanZandt. See the TRADEMARKS.md in the dpyc-community repository for usage guidelines.

License

Apache License 2.0 -- see LICENSE for details.

来源:README.md,提交 a78286f

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

2
  1. v0.43.0最新Oct 21, 2026
  2. v0.40.2Sep 16, 2026

评分

已满足适用检查项的 75%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。