@2kw/ai-mcp-server 6.3.0-dev.84 → 6.3.0-dev.89
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 +3 -54
- package/dist/tools/index.d.ts +21 -0
- package/dist/tools/index.js +190 -0
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -6,32 +6,7 @@ import { createServer } from "node:http";
|
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { createApiClient } from "./client.js";
|
|
8
8
|
const pkg = createRequire(import.meta.url)("../package.json");
|
|
9
|
-
import
|
|
10
|
-
import * as extraction from "./tools/extraction.js";
|
|
11
|
-
import * as aiGateway from "./tools/ai-gateway.js";
|
|
12
|
-
import * as transcription from "./tools/transcription.js";
|
|
13
|
-
import * as schemas from "./tools/schemas.js";
|
|
14
|
-
import * as schemaLabels from "./tools/schema-labels.js";
|
|
15
|
-
import * as schemaVersions from "./tools/schema-versions.js";
|
|
16
|
-
import * as schemaTesting from "./tools/schema-testing.js";
|
|
17
|
-
import * as datasets from "./tools/datasets.js";
|
|
18
|
-
import * as experiments from "./tools/experiments.js";
|
|
19
|
-
import * as evaluators from "./tools/evaluators.js";
|
|
20
|
-
import * as prompts from "./tools/prompts.js";
|
|
21
|
-
import * as skills from "./tools/skills.js";
|
|
22
|
-
import * as plugins from "./tools/plugins.js";
|
|
23
|
-
import * as providers from "./tools/providers.js";
|
|
24
|
-
import * as billing from "./tools/billing.js";
|
|
25
|
-
import * as scores from "./tools/scores.js";
|
|
26
|
-
import * as annotationQueues from "./tools/annotation-queues.js";
|
|
27
|
-
import * as tracing from "./tools/tracing.js";
|
|
28
|
-
import * as analytics from "./tools/analytics.js";
|
|
29
|
-
import * as docs from "./tools/docs.js";
|
|
30
|
-
import * as agents from "./tools/agents.js";
|
|
31
|
-
import * as conversations from "./tools/conversations.js";
|
|
32
|
-
import * as knowledge from "./tools/knowledge.js";
|
|
33
|
-
import * as files from "./tools/files.js";
|
|
34
|
-
import * as memory from "./tools/memory.js";
|
|
9
|
+
import { registerAllTools } from "./tools/index.js";
|
|
35
10
|
// Read the canonical KW_* env var; fall back to legacy BACKBONE_* for
|
|
36
11
|
// backwards compatibility. Warn once on stderr when the legacy name supplied
|
|
37
12
|
// the value.
|
|
@@ -62,7 +37,7 @@ function requireEnv(canonical, legacy) {
|
|
|
62
37
|
}
|
|
63
38
|
const DEFAULT_BASE_URL = process.env.AI_2KW_DEFAULT_BASE_URL ??
|
|
64
39
|
process.env.BACKBONE_DEFAULT_BASE_URL ??
|
|
65
|
-
"https://
|
|
40
|
+
"https://api.2kw.ai";
|
|
66
41
|
async function main() {
|
|
67
42
|
const apiKey = requireEnv("AI_2KW_API_KEY", "BACKBONE_API_KEY");
|
|
68
43
|
const baseUrl = readEnv("AI_2KW_BASE_URL", "BACKBONE_BASE_URL") ?? DEFAULT_BASE_URL;
|
|
@@ -74,33 +49,7 @@ async function main() {
|
|
|
74
49
|
name: "2kw",
|
|
75
50
|
version: pkg.version,
|
|
76
51
|
});
|
|
77
|
-
|
|
78
|
-
conversion.register(server, client);
|
|
79
|
-
extraction.register(server, client);
|
|
80
|
-
aiGateway.register(server, client);
|
|
81
|
-
transcription.register(server, client);
|
|
82
|
-
schemas.register(server, client);
|
|
83
|
-
schemaLabels.register(server, client);
|
|
84
|
-
schemaVersions.register(server, client);
|
|
85
|
-
schemaTesting.register(server, client);
|
|
86
|
-
datasets.register(server, client);
|
|
87
|
-
experiments.register(server, client);
|
|
88
|
-
evaluators.register(server, client);
|
|
89
|
-
prompts.register(server, client);
|
|
90
|
-
skills.register(server, client);
|
|
91
|
-
plugins.register(server, client);
|
|
92
|
-
providers.register(server, client);
|
|
93
|
-
billing.register(server, client);
|
|
94
|
-
scores.register(server, client);
|
|
95
|
-
annotationQueues.register(server, client);
|
|
96
|
-
tracing.register(server, client);
|
|
97
|
-
analytics.register(server, client);
|
|
98
|
-
docs.register(server, client, baseUrl, apiKey);
|
|
99
|
-
agents.register(server, client);
|
|
100
|
-
conversations.register(server, client);
|
|
101
|
-
knowledge.register(server, client);
|
|
102
|
-
files.register(server, client);
|
|
103
|
-
memory.register(server, client);
|
|
52
|
+
registerAllTools(server, { client, baseUrl, apiKey });
|
|
104
53
|
if (transport === "http") {
|
|
105
54
|
const httpTransport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
|
|
106
55
|
const httpServer = createServer(async (req, res) => {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { ApiClient } from "../client.js";
|
|
3
|
+
export interface ToolDeps {
|
|
4
|
+
client: ApiClient;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One tool module. `id` is its file name under src/tools; `title` and `summary` head its table on
|
|
10
|
+
* the public docs page, which `npm run docs:tools` generates from this list (#1148).
|
|
11
|
+
*/
|
|
12
|
+
export interface ToolGroup {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
summary: string;
|
|
16
|
+
register(server: McpServer, deps: ToolDeps): void;
|
|
17
|
+
}
|
|
18
|
+
/** Every tool module, in the order the docs page lists them. A new module must be added here. */
|
|
19
|
+
export declare const TOOL_GROUPS: readonly ToolGroup[];
|
|
20
|
+
export declare function registerAllTools(server: McpServer, deps: ToolDeps): void;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as agents from "./agents.js";
|
|
2
|
+
import * as aiGateway from "./ai-gateway.js";
|
|
3
|
+
import * as analytics from "./analytics.js";
|
|
4
|
+
import * as annotationQueues from "./annotation-queues.js";
|
|
5
|
+
import * as billing from "./billing.js";
|
|
6
|
+
import * as conversations from "./conversations.js";
|
|
7
|
+
import * as conversion from "./conversion.js";
|
|
8
|
+
import * as datasets from "./datasets.js";
|
|
9
|
+
import * as docs from "./docs.js";
|
|
10
|
+
import * as evaluators from "./evaluators.js";
|
|
11
|
+
import * as experiments from "./experiments.js";
|
|
12
|
+
import * as extraction from "./extraction.js";
|
|
13
|
+
import * as files from "./files.js";
|
|
14
|
+
import * as knowledge from "./knowledge.js";
|
|
15
|
+
import * as memory from "./memory.js";
|
|
16
|
+
import * as plugins from "./plugins.js";
|
|
17
|
+
import * as prompts from "./prompts.js";
|
|
18
|
+
import * as providers from "./providers.js";
|
|
19
|
+
import * as schemaLabels from "./schema-labels.js";
|
|
20
|
+
import * as schemaTesting from "./schema-testing.js";
|
|
21
|
+
import * as schemaVersions from "./schema-versions.js";
|
|
22
|
+
import * as schemas from "./schemas.js";
|
|
23
|
+
import * as scores from "./scores.js";
|
|
24
|
+
import * as skills from "./skills.js";
|
|
25
|
+
import * as tracing from "./tracing.js";
|
|
26
|
+
import * as transcription from "./transcription.js";
|
|
27
|
+
/** Every tool module, in the order the docs page lists them. A new module must be added here. */
|
|
28
|
+
export const TOOL_GROUPS = [
|
|
29
|
+
{
|
|
30
|
+
id: "ai-gateway",
|
|
31
|
+
title: "AI Gateway",
|
|
32
|
+
summary: "Call models through the gateway — chat completions, the Responses endpoint (including stored agents) and the model list.",
|
|
33
|
+
register: (s, d) => aiGateway.register(s, d.client),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "agents",
|
|
37
|
+
title: "Agents",
|
|
38
|
+
summary: "Manage agents, their versions, labels and tool catalogs, and decide paused approvals. See [Running agents](#running-agents).",
|
|
39
|
+
register: (s, d) => agents.register(s, d.client),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "conversations",
|
|
43
|
+
title: "Conversations",
|
|
44
|
+
summary: "Create, read, rename and delete conversations, list their items and cancel a running turn.",
|
|
45
|
+
register: (s, d) => conversations.register(s, d.client),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "memory",
|
|
49
|
+
title: "Memory",
|
|
50
|
+
summary: "Read and edit your own agent memory, and see or erase a member's memory as an admin.",
|
|
51
|
+
register: (s, d) => memory.register(s, d.client),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "knowledge",
|
|
55
|
+
title: "Knowledge Bases",
|
|
56
|
+
summary: "Manage knowledge bases and their documents, search them and resolve citations.",
|
|
57
|
+
register: (s, d) => knowledge.register(s, d.client),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "files",
|
|
61
|
+
title: "Files",
|
|
62
|
+
summary: "Upload, list, download and delete files.",
|
|
63
|
+
register: (s, d) => files.register(s, d.client),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "skills",
|
|
67
|
+
title: "Skills",
|
|
68
|
+
summary: "Import, read, resolve and delete skills, with their versions and labels.",
|
|
69
|
+
register: (s, d) => skills.register(s, d.client),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "plugins",
|
|
73
|
+
title: "Plugins",
|
|
74
|
+
summary: "Install, sync, update and remove plugins.",
|
|
75
|
+
register: (s, d) => plugins.register(s, d.client),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "prompts",
|
|
79
|
+
title: "Prompts",
|
|
80
|
+
summary: "Manage prompts, their versions and labels, and resolve, compile or test them.",
|
|
81
|
+
register: (s, d) => prompts.register(s, d.client),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "schemas",
|
|
85
|
+
title: "Schemas",
|
|
86
|
+
summary: "Define extraction schemas within your organization.",
|
|
87
|
+
register: (s, d) => schemas.register(s, d.client),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "schema-versions",
|
|
91
|
+
title: "Schema Versions",
|
|
92
|
+
summary: "Manage versioned snapshots of schema definitions.",
|
|
93
|
+
register: (s, d) => schemaVersions.register(s, d.client),
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "schema-labels",
|
|
97
|
+
title: "Schema Labels",
|
|
98
|
+
summary: "Point named labels at schema versions.",
|
|
99
|
+
register: (s, d) => schemaLabels.register(s, d.client),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "schema-testing",
|
|
103
|
+
title: "Schema Testing",
|
|
104
|
+
summary: "Validate schemas and test extractions without persisting data.",
|
|
105
|
+
register: (s, d) => schemaTesting.register(s, d.client),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: "extraction",
|
|
109
|
+
title: "Extractions",
|
|
110
|
+
summary: "Extract structured data from text using schemas and AI models.",
|
|
111
|
+
register: (s, d) => extraction.register(s, d.client),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "conversion",
|
|
115
|
+
title: "Document Conversion",
|
|
116
|
+
summary: "Convert documents (PDF, DOCX and more) to Markdown, text, HTML or JSON.",
|
|
117
|
+
register: (s, d) => conversion.register(s, d.client),
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "transcription",
|
|
121
|
+
title: "Audio Transcription",
|
|
122
|
+
summary: "Transcribe audio files using AI models.",
|
|
123
|
+
register: (s, d) => transcription.register(s, d.client),
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "datasets",
|
|
127
|
+
title: "Datasets",
|
|
128
|
+
summary: "Manage evaluation datasets, their versions and items.",
|
|
129
|
+
register: (s, d) => datasets.register(s, d.client),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "experiments",
|
|
133
|
+
title: "Experiments",
|
|
134
|
+
summary: "Run experiments over datasets, compare variants and track regressions against a baseline.",
|
|
135
|
+
register: (s, d) => experiments.register(s, d.client),
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "evaluators",
|
|
139
|
+
title: "Evaluators",
|
|
140
|
+
summary: "List evaluator types and manage evaluator templates.",
|
|
141
|
+
register: (s, d) => evaluators.register(s, d.client),
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: "scores",
|
|
145
|
+
title: "Scores",
|
|
146
|
+
summary: "Record and list human scores.",
|
|
147
|
+
register: (s, d) => scores.register(s, d.client),
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: "annotation-queues",
|
|
151
|
+
title: "Annotation Queues",
|
|
152
|
+
summary: "Manage annotation queues and work through their items.",
|
|
153
|
+
register: (s, d) => annotationQueues.register(s, d.client),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "tracing",
|
|
157
|
+
title: "Tracing",
|
|
158
|
+
summary: "Read traces and trace sessions, and change the tracing settings.",
|
|
159
|
+
register: (s, d) => tracing.register(s, d.client),
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: "analytics",
|
|
163
|
+
title: "Analytics",
|
|
164
|
+
summary: "Usage, error and quality analytics for your organization.",
|
|
165
|
+
register: (s, d) => analytics.register(s, d.client),
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "providers",
|
|
169
|
+
title: "Providers",
|
|
170
|
+
summary: "Manage AI providers and list their models.",
|
|
171
|
+
register: (s, d) => providers.register(s, d.client),
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "billing",
|
|
175
|
+
title: "Billing",
|
|
176
|
+
summary: "Read your billing tier and limits, and check available budget.",
|
|
177
|
+
register: (s, d) => billing.register(s, d.client),
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: "docs",
|
|
181
|
+
title: "API Documentation",
|
|
182
|
+
summary: "Browse the backend's OpenAPI documentation by section.",
|
|
183
|
+
register: (s, d) => docs.register(s, d.client, d.baseUrl, d.apiKey),
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
export function registerAllTools(server, deps) {
|
|
187
|
+
for (const group of TOOL_GROUPS)
|
|
188
|
+
group.register(server, deps);
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai-mcp-server",
|
|
3
|
-
"version": "6.3.0-dev.
|
|
3
|
+
"version": "6.3.0-dev.89",
|
|
4
4
|
"description": "MCP server for 2kw.ai — EU-hosted AI platform: OpenAI-compatible LLM gateway, schema-driven document extraction, transcription, agents with a knowledge base, and cost observability. 158 tools for Claude Code, Cursor, and Windsurf.",
|
|
5
5
|
"mcpName": "ai.2kw/mcp-server",
|
|
6
6
|
"keywords": [
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"check:generated": "tsx openapi/scripts/check-generated.ts",
|
|
42
42
|
"fix:generated": "tsx openapi/scripts/check-generated.ts --write",
|
|
43
43
|
"check:coverage": "tsx ../cli/openapi/scripts/check-coverage.ts",
|
|
44
|
+
"docs:tools": "tsx scripts/tool-docs.ts",
|
|
45
|
+
"check:tool-docs": "tsx scripts/tool-docs.ts --check",
|
|
44
46
|
"test": "tsx --test tests/*.test.ts",
|
|
45
47
|
"typecheck": "tsc --noEmit"
|
|
46
48
|
},
|