@blockrun/mcp 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +27 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1116,7 +1116,8 @@ var VIDEO_PRICE_PER_SECOND = {
1116
1116
  "xai/grok-imagine-video": 0.05,
1117
1117
  "bytedance/seedance-1.5-pro": 0.092,
1118
1118
  "bytedance/seedance-2.0-fast": 0.238,
1119
- "bytedance/seedance-2.0": 0.298
1119
+ "bytedance/seedance-2.0": 0.298,
1120
+ "azure/sora-2": 0.1
1120
1121
  };
1121
1122
  var VIDEO_PRICE_PER_SECOND_IMAGE = {
1122
1123
  "bytedance/seedance-2.0-fast": 0.14,
@@ -1130,7 +1131,9 @@ var VIDEO_DEFAULT_DURATION = {
1130
1131
  "xai/grok-imagine-video": 8,
1131
1132
  "bytedance/seedance-1.5-pro": 5,
1132
1133
  "bytedance/seedance-2.0-fast": 5,
1133
- "bytedance/seedance-2.0": 5
1134
+ "bytedance/seedance-2.0": 5,
1135
+ "azure/sora-2": 4
1136
+ // Sora 2 accepts only 4 / 8 / 12s
1134
1137
  };
1135
1138
  function registerVideoTool(server, budget) {
1136
1139
  server.registerTool(
@@ -1141,6 +1144,7 @@ function registerVideoTool(server, budget) {
1141
1144
  Turns a text prompt (and optional seed image) into a short MP4 clip. The tool submits the job, then polls until the video is ready (typical total wall-time 60-180s; 5 min hard cap). Payment is settled only when upstream returns a finished video \u2014 if the job fails or we give up, you are not charged.
1142
1145
 
1143
1146
  Models (Seedance defaults bumped to 720p + synced audio on the gateway):
1147
+ - azure/sora-2 ($0.10/sec, 720p + synced audio, text-to-video) \u2014 OpenAI Sora 2 via Azure AI Foundry. duration_seconds must be 4, 8, or 12 (4s default -> ~$0.42/clip). No image_url / RealFace.
1144
1148
  - xai/grok-imagine-video ($0.05/sec, 8s default -> $0.42/clip) \u2014 stylized, fast
1145
1149
  - bytedance/seedance-1.5-pro (~$0.092/sec, 720p + audio t2v, 5s default up to 10s) \u2014 cheapest Seedance, token-priced upstream
1146
1150
  - bytedance/seedance-2.0-fast (~$0.238/sec text \xB7 ~$0.140/sec image-to-video, 720p + audio, ~60-80s gen) \u2014 sweet-spot price/quality; supports BytePlus RealFace assets
@@ -1154,7 +1158,7 @@ Returns a permanent blockrun-hosted MP4 URL (the gateway mirrors the asset to GC
1154
1158
  image_url: z6.string().url().optional().describe("Optional seed image URL for image-to-video generation"),
1155
1159
  real_face_asset_id: z6.string().regex(/^ta_[A-Za-z0-9]+$/, "token360 asset id like 'ta_xxxx'").optional().describe("BytePlus RealFace asset id (from blockrun_realface enroll/list) to generate video of a specific real person. Seedance 2.0 / 2.0-fast only. Mutually exclusive with image_url."),
1156
1160
  duration_seconds: z6.number().int().min(1).max(60).optional().describe("Duration to bill for (defaults to the model's default \u2014 8s for xAI, 5s for Seedance; Seedance supports up to 10s)."),
1157
- model: z6.enum(["xai/grok-imagine-video", "bytedance/seedance-1.5-pro", "bytedance/seedance-2.0-fast", "bytedance/seedance-2.0"]).optional().default("xai/grok-imagine-video").describe("Video model to use"),
1161
+ model: z6.enum(["azure/sora-2", "xai/grok-imagine-video", "bytedance/seedance-1.5-pro", "bytedance/seedance-2.0-fast", "bytedance/seedance-2.0"]).optional().default("xai/grok-imagine-video").describe("Video model to use"),
1158
1162
  agent_id: z6.string().optional().describe("Agent identifier for budget tracking and enforcement.")
1159
1163
  }
1160
1164
  },
@@ -1605,6 +1609,20 @@ Error: ${errMsg}` }],
1605
1609
 
1606
1610
  // src/tools/search.ts
1607
1611
  import { z as z8 } from "zod";
1612
+
1613
+ // src/utils/body.ts
1614
+ function coerceBody(body) {
1615
+ if (typeof body !== "string") return body;
1616
+ const trimmed = body.trim();
1617
+ if (trimmed === "") return {};
1618
+ try {
1619
+ return JSON.parse(trimmed);
1620
+ } catch {
1621
+ return body;
1622
+ }
1623
+ }
1624
+
1625
+ // src/tools/search.ts
1608
1626
  var SEARCH_PRICE_PER_SOURCE = 0.025;
1609
1627
  var SEARCH_DEFAULT_MAX_RESULTS = 10;
1610
1628
  function estimateSearchCost(body) {
@@ -1633,6 +1651,7 @@ Full request shape + worked examples in the \`search\` skill (\`skills/search/SK
1633
1651
  },
1634
1652
  async ({ path: path5, body, agent_id }) => {
1635
1653
  try {
1654
+ body = coerceBody(body);
1636
1655
  const estimatedCost = estimateSearchCost(body);
1637
1656
  const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
1638
1657
  if (!budgetCheck.allowed) {
@@ -1690,6 +1709,7 @@ Full request/response shapes + worked research workflows in the \`exa-research\`
1690
1709
  },
1691
1710
  async ({ path: path5, body, agent_id }) => {
1692
1711
  try {
1712
+ body = coerceBody(body);
1693
1713
  const estimatedCost = estimateExaCost(path5, body);
1694
1714
  const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
1695
1715
  if (!budgetCheck.allowed) {
@@ -1788,6 +1808,7 @@ Pass query params via 'params' (GET). Use 'body' only for POST endpoints (e.g. p
1788
1808
  },
1789
1809
  async ({ path: path5, params, body, agent_id }) => {
1790
1810
  try {
1811
+ body = coerceBody(body);
1791
1812
  const estimatedCost = estimateMarketCost(path5, body);
1792
1813
  const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
1793
1814
  if (!budgetCheck.allowed) {
@@ -2050,6 +2071,7 @@ Full action shapes + GPU type details in the \`modal\` skill.`,
2050
2071
  },
2051
2072
  async ({ path: path5, body, agent_id }) => {
2052
2073
  try {
2074
+ body = coerceBody(body);
2053
2075
  const cleanPath = path5.replace(/^\/+/, "").replace(/^v1\/modal\//, "");
2054
2076
  const estimatedCost = estimateModalCost(cleanPath);
2055
2077
  const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
@@ -2115,6 +2137,7 @@ Voice call flow + voice preset details + full body shapes in the \`phone\` skill
2115
2137
  },
2116
2138
  async ({ path: path5, body, agent_id }) => {
2117
2139
  try {
2140
+ body = coerceBody(body);
2118
2141
  const cleanPath = path5.replace(/^\/+/, "").replace(/^v1\//, "");
2119
2142
  const estimatedCost = estimatePhoneCost(cleanPath, body !== void 0);
2120
2143
  const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
@@ -2212,6 +2235,7 @@ Each Surf endpoint pre-validates required params before settling \u2014 you get
2212
2235
  },
2213
2236
  async ({ path: path5, params, body, agent_id }) => {
2214
2237
  try {
2238
+ body = coerceBody(body);
2215
2239
  const cleanPath = path5.replace(/^\/+/, "").replace(/^v1\/surf\//, "").replace(/^api\/v1\/surf\//, "");
2216
2240
  const estimatedCost = estimateSurfCost(cleanPath);
2217
2241
  const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/mcp",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "mcpName": "io.github.BlockRunAI/blockrun-mcp",
5
5
  "description": "BlockRun MCP Server - Give your AI agent web search, deep research, prediction markets, crypto data, X/Twitter intelligence. Paid via x402 micropayments.",
6
6
  "type": "module",