local-model-suitability-mcp 1.1.20 → 1.1.21
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/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/smithery.yaml +1 -0
- package/src/server.js +4 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-model-suitability-mcp",
|
|
3
3
|
"mcpName": "io.github.OjasKord/local-model-suitability-mcp",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.21",
|
|
5
5
|
"description": "AI model router for agents. Checks whether a local model can handle the task before calling cloud inference. LOCAL/CLOUD verdict saves cost on every call.",
|
|
6
6
|
"main": "src/server.js",
|
|
7
7
|
"type": "module",
|
package/smithery.yaml
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
name: Local Model Suitability MCP
|
|
2
|
+
agentRole: "AI Model Routing Specialist — equip before routing a task to a cloud model to check whether a local model can handle it instead"
|
|
2
3
|
description: "Before routing any task to a cloud model, call check_local_viability. Returns LOCAL/CLOUD/EITHER verdict with recommended model - saves inference cost on every routable call. 2 focused tools. Compact schema. Minimal agent context overhead."
|
|
3
4
|
categories:
|
|
4
5
|
- Dev Tools
|
package/src/server.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createHmac, timingSafeEqual } from 'crypto';
|
|
|
3
3
|
import { readFileSync, writeFileSync } from 'fs';
|
|
4
4
|
import Anthropic from '@anthropic-ai/sdk';
|
|
5
5
|
|
|
6
|
-
const VERSION = '1.1.
|
|
6
|
+
const VERSION = '1.1.21';
|
|
7
7
|
const PRO_UPGRADE_URL = 'https://buy.stripe.com/cNibJ08wd7zf6NS0h2ebu0p';
|
|
8
8
|
const ENTERPRISE_UPGRADE_URL = 'https://buy.stripe.com/28E9AS27PbPvfkoe7Sebu0q';
|
|
9
9
|
const ALLOWED_PAYMENT_LINK_IDS = ['plink_1TQzCBD6WvRe6sn3H1q5t2LF', 'plink_1TQzDSD6WvRe6sn3UM2G1EgX'];
|
|
@@ -695,6 +695,7 @@ const server = createServer(async (req, res) => {
|
|
|
695
695
|
try {
|
|
696
696
|
const request = JSON.parse(body);
|
|
697
697
|
let response;
|
|
698
|
+
let statusCode = 200;
|
|
698
699
|
|
|
699
700
|
if (request.method === 'initialize') {
|
|
700
701
|
response = {
|
|
@@ -730,6 +731,7 @@ const server = createServer(async (req, res) => {
|
|
|
730
731
|
const access = checkAccess(clientIp, apiKey);
|
|
731
732
|
|
|
732
733
|
if (!access.allowed) {
|
|
734
|
+
statusCode = 402;
|
|
733
735
|
notifyGateHit('Local Model Suitability', clientIp, 'check_local_viability', getFreeTierCount(clientIp), PRO_UPGRADE_URL);
|
|
734
736
|
response = {
|
|
735
737
|
jsonrpc: '2.0', id: request.id,
|
|
@@ -778,7 +780,7 @@ const server = createServer(async (req, res) => {
|
|
|
778
780
|
response = { jsonrpc: '2.0', id: request.id, error: { code: -32601, message: 'Method not found: ' + request.method } };
|
|
779
781
|
}
|
|
780
782
|
|
|
781
|
-
res.writeHead(
|
|
783
|
+
res.writeHead(statusCode, { ...cors, 'Content-Type': 'application/json' });
|
|
782
784
|
res.end(JSON.stringify(response));
|
|
783
785
|
} catch(e) {
|
|
784
786
|
res.writeHead(400, { ...cors, 'Content-Type': 'application/json' });
|