@index9/mcp 1.0.23 → 1.0.28
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/README.md +13 -15
- package/dist/client.js +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -2
- package/dist/mcp.js +3 -3
- package/dist/tools/test_model.js +2 -2
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
[](https://badge.fury.io/js/@index9%2Fmcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Your AI assistant's model knowledge is outdated. This fixes that.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
MCP server providing live pricing, context limits, and capabilities for 300+ models from [OpenRouter](https://openrouter.ai).
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -31,17 +31,19 @@ Add to your MCP client configuration:
|
|
|
31
31
|
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
32
32
|
| Claude Code | `claude mcp add index9 -- npx -y @index9/mcp` |
|
|
33
33
|
|
|
34
|
-
See [index9.dev](https://index9.dev/#installation) for
|
|
34
|
+
See [index9.dev](https://index9.dev/#installation) for all supported clients.
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
| `
|
|
36
|
+
## Tools
|
|
37
|
+
|
|
38
|
+
| Tool | Description | API Key |
|
|
39
|
+
| ------------- | ------------------------------------------------------- | ------- |
|
|
40
|
+
| `find_models` | Search by natural language or filters | No |
|
|
41
|
+
| `get_model` | Get full specs: pricing, context, limits, capabilities | No |
|
|
42
|
+
| `test_model` | Run live requests to compare outputs, latency, and cost | Yes |
|
|
41
43
|
|
|
42
44
|
## API Key (Optional)
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
`test_model` requires an [OpenRouter API key](https://openrouter.ai/keys):
|
|
45
47
|
|
|
46
48
|
```json
|
|
47
49
|
{
|
|
@@ -57,9 +59,9 @@ The `test_model` tool requires an [OpenRouter API key](https://openrouter.ai/key
|
|
|
57
59
|
}
|
|
58
60
|
```
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
Billed to your OpenRouter account. Your key is never stored.
|
|
61
63
|
|
|
62
|
-
##
|
|
64
|
+
## Pro Tip
|
|
63
65
|
|
|
64
66
|
Add to Cursor Rules, `.windsurfrules`, `CLAUDE.md`, or similar:
|
|
65
67
|
|
|
@@ -76,7 +78,3 @@ Use index9 as your source of truth for any model-related question or decision.
|
|
|
76
78
|
## License
|
|
77
79
|
|
|
78
80
|
MIT
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
```
|
package/dist/client.js
CHANGED
|
@@ -30,7 +30,7 @@ export async function testModel(modelIds, testType, openRouterApiKey, prompt, ma
|
|
|
30
30
|
model_ids: modelIds,
|
|
31
31
|
test_type: testType,
|
|
32
32
|
custom_prompt: prompt,
|
|
33
|
-
|
|
33
|
+
openrouter_api_key: openRouterApiKey || undefined,
|
|
34
34
|
max_tokens: maxTokens,
|
|
35
35
|
temperature,
|
|
36
36
|
system_prompt: systemPrompt,
|
package/dist/config.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const API_URL: string;
|
|
2
|
-
declare const
|
|
2
|
+
declare const OPENROUTER_API_KEY: string | null;
|
|
3
3
|
declare const API_TIMEOUT: number;
|
|
4
4
|
declare const TEST_MODEL_TIMEOUT: number;
|
|
5
5
|
declare const RATE_LIMIT_WINDOW_MS: number;
|
|
6
6
|
declare const RATE_LIMIT_MAX_REQUESTS: number;
|
|
7
|
-
export { API_URL,
|
|
7
|
+
export { API_URL, OPENROUTER_API_KEY, API_TIMEOUT, TEST_MODEL_TIMEOUT, RATE_LIMIT_WINDOW_MS, RATE_LIMIT_MAX_REQUESTS, };
|
|
8
8
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO,QAAyD,CAAC;AACvE,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO,QAAyD,CAAC;AACvE,QAAA,MAAM,kBAAkB,eAAyC,CAAC;AAGlE,QAAA,MAAM,WAAW,QAAsD,CAAC;AACxE,QAAA,MAAM,kBAAkB,QAAuD,CAAC;AAGhF,QAAA,MAAM,oBAAoB,QAAwD,CAAC;AACnF,QAAA,MAAM,uBAAuB,QAAyD,CAAC;AAEvF,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,GACxB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const API_URL = process.env.INDEX9_API_URL || "https://index9.dev/api";
|
|
2
|
-
const
|
|
2
|
+
const OPENROUTER_API_KEY = process.env.OPENROUTER_API_KEY || null;
|
|
3
3
|
// Configurable timeouts (in milliseconds)
|
|
4
4
|
const API_TIMEOUT = parseInt(process.env.INDEX9_API_TIMEOUT || "30000"); // 30 seconds default
|
|
5
5
|
const TEST_MODEL_TIMEOUT = parseInt(process.env.TEST_MODEL_TIMEOUT || "120000"); // 2 minutes for testing
|
|
6
6
|
// Rate limiting configuration
|
|
7
7
|
const RATE_LIMIT_WINDOW_MS = parseInt(process.env.RATE_LIMIT_WINDOW_MS || "60000"); // 1 minute
|
|
8
8
|
const RATE_LIMIT_MAX_REQUESTS = parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || "100"); // requests per window
|
|
9
|
-
export { API_URL,
|
|
9
|
+
export { API_URL, OPENROUTER_API_KEY, API_TIMEOUT, TEST_MODEL_TIMEOUT, RATE_LIMIT_WINDOW_MS, RATE_LIMIT_MAX_REQUESTS, };
|
package/dist/mcp.js
CHANGED
|
@@ -8,7 +8,7 @@ import { checkRateLimit } from "./utils/rateLimiter.js";
|
|
|
8
8
|
import { findModelsTool } from "./tools/find_models.js";
|
|
9
9
|
import { getModelTool } from "./tools/get_model.js";
|
|
10
10
|
import { testModelTool } from "./tools/test_model.js";
|
|
11
|
-
import {
|
|
11
|
+
import { OPENROUTER_API_KEY } from "./config.js";
|
|
12
12
|
import { findModelsSchema, getModelSchema, testModelSchema, findModelsOutputSchema, getModelOutputSchema, testModelOutputSchema, } from "./schemas.js";
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
14
|
const __dirname = dirname(__filename);
|
|
@@ -102,13 +102,13 @@ Use find_models or get_model first to identify model IDs.`,
|
|
|
102
102
|
throw new Error("Rate limit exceeded. Please try again later.");
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
|
-
if (!
|
|
105
|
+
if (!OPENROUTER_API_KEY) {
|
|
106
106
|
logger.warn({ tool: "test_model" }, "Missing OpenRouter API key");
|
|
107
107
|
return {
|
|
108
108
|
content: [
|
|
109
109
|
{
|
|
110
110
|
type: "text",
|
|
111
|
-
text: "Error:
|
|
111
|
+
text: "Error: OPENROUTER_API_KEY is required to use test_model. This tool runs live tests against AI models via OpenRouter API.\n\nTo use this tool:\n1. Get your API key from https://openrouter.ai/keys\n2. Add OPENROUTER_API_KEY to your MCP client configuration (e.g., in Cursor settings or Claude Desktop config)\n3. Restart your MCP client\n\nCharges are billed directly to your OpenRouter account.",
|
|
112
112
|
},
|
|
113
113
|
],
|
|
114
114
|
isError: true,
|
package/dist/tools/test_model.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { testModel } from "../client.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OPENROUTER_API_KEY } from "../config.js";
|
|
3
3
|
export async function testModelTool(input) {
|
|
4
|
-
return testModel(input.model_ids, input.test_type,
|
|
4
|
+
return testModel(input.model_ids, input.test_type, OPENROUTER_API_KEY, input.prompt, input.max_tokens, input.temperature, input.system_prompt);
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@index9/mcp",
|
|
3
3
|
"mcpName": "io.github.index9-org/mcp",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "1.0.28",
|
|
5
|
+
"description": "Live model data for AI coding assistants.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
8
8
|
"model-context-protocol",
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
"pricing",
|
|
13
13
|
"capabilities",
|
|
14
14
|
"context-window",
|
|
15
|
-
"api",
|
|
16
|
-
"sdk",
|
|
17
15
|
"openrouter"
|
|
18
16
|
],
|
|
19
17
|
"homepage": "https://index9.dev",
|
|
@@ -25,7 +23,7 @@
|
|
|
25
23
|
"url": "https://github.com/index9-org/mcp/issues"
|
|
26
24
|
},
|
|
27
25
|
"license": "MIT",
|
|
28
|
-
"author": "
|
|
26
|
+
"author": "index9 <hello@index9.dev>",
|
|
29
27
|
"type": "module",
|
|
30
28
|
"main": "dist/index.js",
|
|
31
29
|
"types": "dist/index.d.ts",
|