@blockrun/mcp 0.16.1 → 0.17.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.
- package/dist/index.js +22 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -214,11 +214,11 @@ var BASE_CHAIN_ID = "8453";
|
|
|
214
214
|
var MODEL_TIERS = {
|
|
215
215
|
fast: ["google/gemini-3.5-flash", "google/gemini-2.5-flash", "google/gemini-3.1-flash-lite", "openai/gpt-5-mini", "deepseek/deepseek-chat", "google/gemini-3-flash-preview"],
|
|
216
216
|
balanced: ["openai/gpt-5.4", "anthropic/claude-sonnet-4.6", "google/gemini-2.5-pro", "moonshot/kimi-k2.6", "openai/gpt-5.3", "google/gemini-3.1-pro"],
|
|
217
|
-
powerful: ["openai/gpt-5.4-pro", "anthropic/claude-opus-4.7", "anthropic/claude-opus-4.6", "openai/o3", "openai/gpt-5.4"],
|
|
217
|
+
powerful: ["anthropic/claude-opus-4.8", "openai/gpt-5.4-pro", "anthropic/claude-opus-4.7", "anthropic/claude-opus-4.6", "openai/o3", "openai/gpt-5.4"],
|
|
218
218
|
cheap: ["zai/glm-5", "zai/glm-5-turbo", "nvidia/gpt-oss-120b", "nvidia/deepseek-v3.2", "google/gemini-2.5-flash", "deepseek/deepseek-chat", "openai/gpt-5.4-nano"],
|
|
219
|
-
reasoning: ["openai/o3", "openai/o1", "openai/o3-mini", "deepseek/deepseek-reasoner", "moonshot/kimi-k2.6", "openai/gpt-5.3-codex"],
|
|
219
|
+
reasoning: ["anthropic/claude-opus-4.8", "openai/o3", "openai/o1", "openai/o3-mini", "deepseek/deepseek-reasoner", "moonshot/kimi-k2.6", "openai/gpt-5.3-codex"],
|
|
220
220
|
free: ["nvidia/qwen3-next-80b-a3b-thinking", "nvidia/mistral-small-4-119b", "nvidia/gpt-oss-120b", "nvidia/deepseek-v3.2", "nvidia/qwen3-coder-480b", "nvidia/llama-4-maverick", "nvidia/gpt-oss-20b", "nvidia/glm-4.7"],
|
|
221
|
-
coding: ["zai/glm-5", "openai/gpt-5.3-codex", "moonshot/kimi-k2.6", "nvidia/qwen3-coder-480b", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4"],
|
|
221
|
+
coding: ["anthropic/claude-opus-4.8", "zai/glm-5", "openai/gpt-5.3-codex", "moonshot/kimi-k2.6", "nvidia/qwen3-coder-480b", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4"],
|
|
222
222
|
glm: ["zai/glm-5", "zai/glm-5-turbo", "nvidia/glm-4.7"]
|
|
223
223
|
};
|
|
224
224
|
|
|
@@ -714,6 +714,8 @@ Run blockrun_models to see all 41+ models with pricing.`,
|
|
|
714
714
|
system: z2.string().optional().describe("Optional system prompt"),
|
|
715
715
|
max_tokens: z2.number().optional().default(1024).describe("Max tokens in response"),
|
|
716
716
|
temperature: z2.number().optional().default(1).describe("Creativity 0-2"),
|
|
717
|
+
response_format: z2.enum(["text", "json_object"]).optional().describe("Set to 'json_object' to force valid JSON output (no markdown fences). Works across all providers."),
|
|
718
|
+
stop: z2.array(z2.string()).max(4).optional().describe("Up to 4 stop sequences; generation halts when any is produced"),
|
|
717
719
|
agent_id: z2.string().optional().describe("Agent identifier. If a budget was delegated for this agent_id via blockrun_wallet action:'delegate', spending is tracked and enforced. The agent is hard-stopped when its budget is exhausted."),
|
|
718
720
|
messages: z2.array(z2.object({
|
|
719
721
|
role: z2.enum(["user", "assistant", "system"]),
|
|
@@ -721,8 +723,9 @@ Run blockrun_models to see all 41+ models with pricing.`,
|
|
|
721
723
|
})).optional().describe("Conversation history for multi-turn context. When provided, 'message' is appended as the final user turn. Use with explicit 'model' param (defaults to 'openai/gpt-5.4' if not specified). Note: if you include a role:'system' entry in messages[], do not also pass the system param to avoid duplicate system messages.")
|
|
722
724
|
}
|
|
723
725
|
},
|
|
724
|
-
async ({ message, model, mode, routing, routing_profile, system, max_tokens, temperature, agent_id, messages }) => {
|
|
726
|
+
async ({ message, model, mode, routing, routing_profile, system, max_tokens, temperature, response_format, stop, agent_id, messages }) => {
|
|
725
727
|
const llm = getClient();
|
|
728
|
+
const responseFormat = response_format ? { type: response_format } : void 0;
|
|
726
729
|
const estimatedCost = estimateChatCost(mode, model, routing, routing_profile);
|
|
727
730
|
const budgetCheck = checkBudget(budget, agent_id, estimatedCost);
|
|
728
731
|
if (!budgetCheck.allowed) {
|
|
@@ -744,7 +747,12 @@ Run blockrun_models to see all 41+ models with pricing.`,
|
|
|
744
747
|
maxTokens: max_tokens,
|
|
745
748
|
maxOutputTokens: max_tokens,
|
|
746
749
|
temperature,
|
|
747
|
-
|
|
750
|
+
// @blockrun/llm 2.x dropped the "free" routing profile; the gateway
|
|
751
|
+
// already routes to the most cost-effective model by default, so we
|
|
752
|
+
// omit it and let ClawRouter pick (matches the SDK upgrade path).
|
|
753
|
+
routingProfile: routing_profile === "free" ? void 0 : routing_profile,
|
|
754
|
+
responseFormat,
|
|
755
|
+
stop
|
|
748
756
|
});
|
|
749
757
|
recordSpending(budget, result.routing.costEstimate || 1e-3, agent_id);
|
|
750
758
|
return {
|
|
@@ -772,7 +780,9 @@ ${result.response}` }],
|
|
|
772
780
|
try {
|
|
773
781
|
const result = await llm.chatCompletion(targetModel, fullMessages, {
|
|
774
782
|
maxTokens: max_tokens,
|
|
775
|
-
temperature
|
|
783
|
+
temperature,
|
|
784
|
+
responseFormat,
|
|
785
|
+
stop
|
|
776
786
|
});
|
|
777
787
|
const reply = result.choices?.[0]?.message?.content || "";
|
|
778
788
|
recordSpending(budget, estimatedCost, agent_id);
|
|
@@ -792,7 +802,9 @@ ${reply}` }],
|
|
|
792
802
|
const response = await llm.chat(model, message, {
|
|
793
803
|
system,
|
|
794
804
|
maxTokens: max_tokens,
|
|
795
|
-
temperature
|
|
805
|
+
temperature,
|
|
806
|
+
responseFormat,
|
|
807
|
+
stop
|
|
796
808
|
});
|
|
797
809
|
recordSpending(budget, estimatedCost, agent_id);
|
|
798
810
|
return { content: [{ type: "text", text: response }] };
|
|
@@ -812,7 +824,9 @@ ${reply}` }],
|
|
|
812
824
|
const response = await llm.chat(m, message, {
|
|
813
825
|
system,
|
|
814
826
|
maxTokens: max_tokens,
|
|
815
|
-
temperature
|
|
827
|
+
temperature,
|
|
828
|
+
responseFormat,
|
|
829
|
+
stop
|
|
816
830
|
});
|
|
817
831
|
recordSpending(budget, estimatedCost, agent_id);
|
|
818
832
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"url": "https://github.com/blockrunai/blockrun-mcp/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@blockrun/llm": "^
|
|
47
|
+
"@blockrun/llm": "^2.11.0",
|
|
48
48
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
49
49
|
"open": "^11.0.0",
|
|
50
50
|
"qrcode": "^1.5.4",
|