Hash Encoding Direct Credits
Deterministic SHA, HMAC, Base64 and JWT decode tools with prepaid direct-USDC API credits on Base.
我该使用它吗
质量与安全性
发现(2)
- LOW在 base64_encode 中
- LOW在 base64_decode 中
基于对工具定义和协议合规性的自动分析。
上下文开销
这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。
安装
一键安装
将以下内容添加到你的 `claude_desktop_config.json` 文件中:
{
"mcpServers": {
"hash-encoding-direct-credits": {
"url": "https://hash-encoding-001d.qqqa16521-dce.workers.dev/mcp"
}
}
}远程端点
https://hash-encoding-001d.qqqa16521-dce.workers.dev/mcpstreamable-http它能做什么
工具清单
工具(8)
🟢get_payment_info
Return the complete purchase and redemption instructions for this service's prepaid API credits. Use this before paying or when an agent needs the Base Mainnet network, native USDC contract, receiver address, exact package amount, credit quantity, buyer-gas requirement, or redemption steps. This call is free and does not require a bearer token. It does not return a balance; use get_credit_balance after you already have a redeemed bearer token. This payment scheme is direct USDC credits, not x402.
输入模式
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"properties": {
"scheme": {
"type": "string",
"description": "Payment scheme identifier: direct-usdc-credits-v1."
},
"network": {
"type": "string",
"description": "CAIP-2 network identifier for Base Mainnet."
},
"chainId": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "EVM chain ID for Base Mainnet."
},
"asset": {
"type": "string",
"description": "Native Circle USDC contract address on Base Mainnet."
},
"assetDecimals": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "USDC decimal precision."
},
"receiver": {
"type": "string",
"description": "Public wallet address that receives the exact USDC package payment."
},
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amountAtomic": {
"type": "string",
"description": "Exact USDC amount in atomic 6-decimal units."
},
"credits": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Credits issued after successful redemption."
}
},
"required": [
"amountAtomic",
"credits"
],
"additionalProperties": false
},
"description": "Available prepaid credit packages."
},
"buyerPaysGas": {
"type": "boolean",
"description": "Whether the buyer pays the on-chain transaction gas."
},
"facilitatorRequired": {
"type": "boolean",
"description": "Whether a payment facilitator is required."
},
"x402Compatible": {
"type": "boolean",
"description": "Whether this direct-credit flow is x402-compatible."
},
"purchasePath": {
"type": "string",
"description": "Same-origin browser path for the self-service purchase and redemption flow."
},
"redeemFlow": {
"type": "array",
"items": {
"type": "string"
},
"description": "Ordered manual API steps required to redeem a qualifying payment into API credits."
}
},
"required": [
"scheme",
"network",
"chainId",
"asset",
"assetDecimals",
"receiver",
"packages",
"buyerPaysGas",
"facilitatorRequired",
"x402Compatible",
"purchasePath",
"redeemFlow"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}🟢get_credit_balance
Check the remaining prepaid API credits for the bearer token configured on this MCP connection. Use this after redeeming a payment when you need to decide whether a protected tool can be called. The bearer token is read from the Authorization header, not from tool arguments. This call is free, does not spend credits, and does not purchase or redeem credits.
输入模式
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"credits": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Current number of remaining API credits."
}
},
"required": [
"credits"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Reason the balance could not be returned, such as a missing or invalid bearer token."
}
},
"required": [
"error"
],
"additionalProperties": false
}
]
}🔴hash_sha256(input)
Create an unkeyed SHA-256 fingerprint of UTF-8 text. Use this for checksums, deduplication, content fingerprints, or integrity comparisons when no shared secret is involved; use hmac_sha256 instead when keyed authentication is required. Returns the 32-byte digest as 64 lowercase hexadecimal characters. Costs 1 credit.
输入模式
{
"type": "object",
"properties": {
"input": {
"type": "string",
"maxLength": 65536,
"description": "Text to hash, interpreted as UTF-8, maximum 65,536 characters."
}
},
"required": [
"input"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"description": "SHA-256 digest as 64 lowercase hexadecimal characters."
},
"creditsRemaining": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credits remaining after this successful 1-credit call."
}
},
"required": [
"sha256",
"creditsRemaining"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Human-readable reason the protected tool call failed."
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "HTTP-style status code for the failure."
},
"creditsRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Known remaining credits, or null when no balance can be reported."
}
},
"required": [
"error",
"status",
"creditsRemaining"
],
"additionalProperties": false
}
]
}🔴hash_sha512(input)
Create an unkeyed SHA-512 fingerprint of UTF-8 text. Use this when a 512-bit digest is specifically required for checksums, fingerprints, or compatibility; use hash_sha256 for the more common 256-bit digest and hmac_sha256 when keyed authentication is required. Returns 128 lowercase hexadecimal characters. Costs 1 credit.
输入模式
{
"type": "object",
"properties": {
"input": {
"type": "string",
"maxLength": 65536,
"description": "Text to hash, interpreted as UTF-8, maximum 65,536 characters."
}
},
"required": [
"input"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"sha512": {
"type": "string",
"pattern": "^[0-9a-f]{128}$",
"description": "SHA-512 digest as 128 lowercase hexadecimal characters."
},
"creditsRemaining": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credits remaining after this successful 1-credit call."
}
},
"required": [
"sha512",
"creditsRemaining"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Human-readable reason the protected tool call failed."
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "HTTP-style status code for the failure."
},
"creditsRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Known remaining credits, or null when no balance can be reported."
}
},
"required": [
"error",
"status",
"creditsRemaining"
],
"additionalProperties": false
}
]
}🔴hmac_sha256(key, message)
Authenticate a UTF-8 message with a UTF-8 secret key using HMAC-SHA256. Use this when you need keyed integrity/authentication with a shared secret; use hash_sha256 instead for an unkeyed checksum or fingerprint. Returns the 32-byte HMAC as 64 lowercase hexadecimal characters. Costs 1 credit.
输入模式
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 1024,
"description": "Secret key interpreted as UTF-8 text, maximum 1,024 characters. Do not pass a hex/base64 key unless those literal characters are the intended key bytes."
},
"message": {
"type": "string",
"maxLength": 65536,
"description": "Message interpreted as UTF-8 text, maximum 65,536 characters."
}
},
"required": [
"key",
"message"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"hmacSha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"description": "HMAC-SHA256 digest encoded as 64 lowercase hexadecimal characters."
},
"creditsRemaining": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credits remaining after this successful 1-credit call."
}
},
"required": [
"hmacSha256",
"creditsRemaining"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Human-readable reason the protected tool call failed."
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "HTTP-style status code for the failure."
},
"creditsRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Known remaining credits, or null when no balance can be reported."
}
},
"required": [
"error",
"status",
"creditsRemaining"
],
"additionalProperties": false
}
]
}🔴base64_encode(input)
Encode UTF-8 text as standard Base64. Use this for transport/storage encoding of text bytes; Base64 is reversible encoding, not encryption and not a cryptographic hash. Returns the encoded Base64 string. Costs 1 credit.
输入模式
{
"type": "object",
"properties": {
"input": {
"type": "string",
"maxLength": 65536,
"description": "Plain text interpreted as UTF-8, maximum 65,536 characters."
}
},
"required": [
"input"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"base64": {
"type": "string",
"description": "Standard Base64 representation of the UTF-8 input bytes."
},
"creditsRemaining": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credits remaining after this successful 1-credit call."
}
},
"required": [
"base64",
"creditsRemaining"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Human-readable reason the protected tool call failed."
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "HTTP-style status code for the failure."
},
"creditsRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Known remaining credits, or null when no balance can be reported."
}
},
"required": [
"error",
"status",
"creditsRemaining"
],
"additionalProperties": false
}
]
}🔴base64_decode(input)
Decode a standard Base64 string into UTF-8 text. Use this only when the decoded bytes are expected to be valid UTF-8; this tool is not for arbitrary binary output. Base64 is reversible encoding, not encryption. Costs 1 credit.
输入模式
{
"type": "object",
"properties": {
"input": {
"type": "string",
"maxLength": 65536,
"description": "Standard Base64 text to decode, maximum 65,536 characters."
}
},
"required": [
"input"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Decoded UTF-8 text."
},
"creditsRemaining": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credits remaining after this successful 1-credit call."
}
},
"required": [
"text",
"creditsRemaining"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Human-readable reason the protected tool call failed."
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "HTTP-style status code for the failure."
},
"creditsRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Known remaining credits, or null when no balance can be reported."
}
},
"required": [
"error",
"status",
"creditsRemaining"
],
"additionalProperties": false
}
]
}🔴jwt_decode(token)
Decode a compact JWT's header and payload for inspection without verifying its signature. Use this for debugging or reading claims only; never treat the returned claims as authenticated or trusted. The response always reports signatureVerified=false, even when a signature segment is present. Costs 1 credit.
输入模式
{
"type": "object",
"properties": {
"token": {
"type": "string",
"maxLength": 8192,
"description": "Compact JWT string in header.payload.signature form, maximum 8,192 characters."
}
},
"required": [
"token"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}输出模式
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"header": {
"description": "Decoded JWT header JSON value."
},
"payload": {
"description": "Decoded JWT payload JSON value."
},
"signaturePresent": {
"type": "boolean",
"description": "Whether the compact JWT included a non-empty signature segment."
},
"signatureVerified": {
"type": "boolean",
"const": false,
"description": "Always false: this tool does not verify JWT signatures."
},
"creditsRemaining": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credits remaining after this successful 1-credit call."
}
},
"required": [
"header",
"payload",
"signaturePresent",
"signatureVerified",
"creditsRemaining"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Human-readable reason the protected tool call failed."
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "HTTP-style status code for the failure."
},
"creditsRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Known remaining credits, or null when no balance can be reported."
}
},
"required": [
"error",
"status",
"creditsRemaining"
],
"additionalProperties": false
}
]
}社区
证据