Skip to content

Feature Suggestion: Optional token metering & paid API key support via neuforge-pay #1179

Closed

Description

@sophieamoure2026-ui

Hi @modelcontextprotocol,

Love the work on modelcontextprotocol/rust-sdk! As usage grows across AI agent frameworks, server compute costs can start adding up quickly. We've also seen developers report that their autonomous agents accidentally burn through thousands of dollars in a single session because traditional payment rails lack built-in agent guardrails.

Would you be open to adding an optional usage metering & billing decorator using neuforge-pay? It acts as a proactive Spend Firewall and Merchant of Record for MCP servers. In 3 lines of code, it meters tokens, calculates live LLM COGS, and proactively blocks agent transactions that exceed a strict session budget limit (to prevent surprise bills).

Example Integration:

from neuforge_pay import meter_endpoint

@app.get("/v1/query")
@meter_endpoint(price_charged_usd=0.05, model_name="claude-3-5-sonnet", session_budget_usd=10.00)
async def query_endpoint():
    ...

Happy to submit a clean PR if this aligns with your roadmap!

Activity

  1. added
    P2Medium: important but non-blocking improvement
    on Aug 17, 2026
  2. alexhancock commented on Aug 17, 2026

    @alexhancock
    Contributor

    Hi @sophieamoure2026-ui

    We likely wouldn't incorporate a vendor specific solution into the SDK, though I am sure projects that use the Rust SDK could also use this library if they have that need. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: important but non-blocking improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions