@kontyra/mcp-server 0.0.0-stage → 1.0.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 (3) hide show
  1. package/README.md +84 -2
  2. package/dist/index.js +127 -0
  3. package/package.json +37 -4
package/README.md CHANGED
@@ -1,3 +1,85 @@
1
- # Temporary Holding Version
1
+ # @kontyra/mcp-server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Official **Model Context Protocol (MCP)** server for the **Kontyra Cloud Platform** and **DevOS Code Execution Engine**.
4
+
5
+ Connect external AI agents (Claude Desktop, Cursor, Antigravity, ChatGPT, Windsurf) directly to your Kontyra ecosystem via a single API token.
6
+
7
+ ---
8
+
9
+ ## Capabilities & Tools
10
+
11
+ | Tool | Description |
12
+ |---|---|
13
+ | `devos_list_projects` | List all cloud projects in your DevOS workspace |
14
+ | `devos_create_project` | Scaffold a new project (static, Vite React, Next.js) |
15
+ | `devos_delete_project` | Delete a project and its workspace files |
16
+ | `devos_list_files` | List files within a DevOS project |
17
+ | `devos_write_file` | Create or update code files in a project |
18
+ | `devos_delete_file` | Delete an individual project file |
19
+ | `devos_run_terminal` | Execute commands inside the ephemeral cloud sandbox |
20
+ | `devos_get_deploy_logs` | Retrieve live deployment and build logs |
21
+ | `kora_chat` | Send prompts to KORA neural models (`kora-3.6-pro`, `kora-coder-0.5b`) |
22
+
23
+ ---
24
+
25
+ ## Installation & Setup
26
+
27
+ ### 1. Direct Execution via `npx`
28
+ ```bash
29
+ npx -y @kontyra/mcp-server
30
+ ```
31
+
32
+ ### 2. Configuration in Claude Desktop / Cursor / Antigravity
33
+
34
+ Add the following to your `claude_desktop_config.json` or MCP settings:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "kontyra": {
40
+ "command": "npx",
41
+ "args": ["-y", "@kontyra/mcp-server"],
42
+ "env": {
43
+ "KONTYRA_API_KEY": "kontyra_ai_your_token_here"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ Or for local development:
51
+
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "kontyra": {
56
+ "command": "node",
57
+ "args": ["<path-to-repo>/dist/index.js"],
58
+ "env": {
59
+ "KONTYRA_API_KEY": "kontyra_ai_your_token_here"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Getting an API Key
69
+
70
+ 1. Log in to [Kontyra Accounts](https://accounts.kontyra.name.ng).
71
+ 2. Go to **Developer Settings** &rarr; **API Keys**.
72
+ 3. Generate a key with `devos:workspaces`, `devos:execute`, and `kora:chat` scopes.
73
+ 4. Set the token as `KONTYRA_API_KEY`.
74
+
75
+ ---
76
+
77
+ ## Development & Build
78
+
79
+ ```bash
80
+ npm install
81
+ npm run build
82
+ ```
83
+
84
+ ## License
85
+ MIT
package/dist/index.js ADDED
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+ const API_BASE = (process.env.KONTYRA_API_URL || "https://api.kontyra.name.ng").replace(/\/+$/, "");
6
+ const API_KEY = process.env.KONTYRA_API_KEY || "";
7
+ async function kontyraFetch(path, options = {}) {
8
+ if (!API_KEY) {
9
+ throw new Error("KONTYRA_API_KEY environment variable is not set.");
10
+ }
11
+ const headers = {
12
+ "Content-Type": "application/json",
13
+ "Authorization": `Bearer ${API_KEY}`,
14
+ ...(options.headers || {}),
15
+ };
16
+ const res = await fetch(`${API_BASE}${path}`, {
17
+ ...options,
18
+ headers,
19
+ });
20
+ const text = await res.text();
21
+ let data;
22
+ try {
23
+ data = JSON.parse(text);
24
+ }
25
+ catch {
26
+ data = { raw: text };
27
+ }
28
+ if (!res.ok) {
29
+ throw new Error(`HTTP ${res.status}: ${JSON.stringify(data)}`);
30
+ }
31
+ return data;
32
+ }
33
+ const server = new McpServer({
34
+ name: "kontyra-mcp",
35
+ version: "1.0.0",
36
+ });
37
+ server.tool("devos_list_projects", "List all DevOS projects owned by the authenticated Kontyra user.", {}, async () => {
38
+ const data = await kontyraFetch("/v1/devos/projects");
39
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
40
+ });
41
+ server.tool("devos_create_project", "Create a new DevOS project.", {
42
+ name: z.string().describe("Project name"),
43
+ description: z.string().optional().describe("Project description"),
44
+ framework: z.string().optional().describe("Framework (e.g. static, vite-react, nextjs)"),
45
+ }, async ({ name, description, framework }) => {
46
+ const data = await kontyraFetch("/v1/devos/projects", {
47
+ method: "POST",
48
+ body: JSON.stringify({ name, description, framework }),
49
+ });
50
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
51
+ });
52
+ server.tool("devos_delete_project", "Delete a DevOS project by ID.", {
53
+ projectId: z.string().describe("DevOS Project ID"),
54
+ }, async ({ projectId }) => {
55
+ const data = await kontyraFetch(`/v1/devos/projects/${projectId}`, {
56
+ method: "DELETE",
57
+ });
58
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
59
+ });
60
+ server.tool("devos_list_files", "List all files in a DevOS project.", {
61
+ projectId: z.string().describe("DevOS Project ID"),
62
+ }, async ({ projectId }) => {
63
+ const data = await kontyraFetch(`/v1/devos/projects/${projectId}/files`);
64
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
65
+ });
66
+ server.tool("devos_write_file", "Create or update a file inside a DevOS project.", {
67
+ projectId: z.string().describe("DevOS Project ID"),
68
+ path: z.string().describe("File path (e.g. src/index.js)"),
69
+ content: z.string().describe("File contents"),
70
+ language: z.string().optional().describe("Programming language (e.g. javascript, typescript, html)"),
71
+ }, async ({ projectId, path, content, language }) => {
72
+ const data = await kontyraFetch(`/v1/devos/projects/${projectId}/files`, {
73
+ method: "POST",
74
+ body: JSON.stringify({ path, content, language }),
75
+ });
76
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
77
+ });
78
+ server.tool("devos_delete_file", "Delete a file from a DevOS project.", {
79
+ projectId: z.string().describe("DevOS Project ID"),
80
+ fileId: z.string().describe("File ID"),
81
+ }, async ({ projectId, fileId }) => {
82
+ const data = await kontyraFetch(`/v1/devos/projects/${projectId}/files/${fileId}`, {
83
+ method: "DELETE",
84
+ });
85
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
86
+ });
87
+ server.tool("devos_run_terminal", "Execute a shell command in a DevOS cloud sandbox.", {
88
+ command: z.string().describe("Shell command to execute"),
89
+ projectId: z.string().optional().describe("Optional DevOS Project ID"),
90
+ }, async ({ command, projectId }) => {
91
+ const data = await kontyraFetch("/v1/devos/terminal", {
92
+ method: "POST",
93
+ body: JSON.stringify({ command, projectId }),
94
+ });
95
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
96
+ });
97
+ server.tool("devos_get_deploy_logs", "Fetch Vercel deployment logs for a DevOS project.", {
98
+ projectId: z.string().describe("DevOS Project ID"),
99
+ deploymentId: z.string().optional().describe("Optional Deployment ID"),
100
+ }, async ({ projectId, deploymentId }) => {
101
+ const qs = new URLSearchParams({ projectId });
102
+ if (deploymentId)
103
+ qs.set("deploymentId", deploymentId);
104
+ const data = await kontyraFetch(`/v1/devos/deploy/logs?${qs.toString()}`);
105
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
106
+ });
107
+ server.tool("kora_chat", "Send a chat completion prompt to KORA AI.", {
108
+ prompt: z.string().describe("User prompt for KORA AI"),
109
+ model: z.string().optional().default("kora-3.6-pro").describe("Model ID (e.g. kora-3.6-pro, kora-coder-0.5b)"),
110
+ }, async ({ prompt, model }) => {
111
+ const data = await kontyraFetch("/v1/chat/completions", {
112
+ method: "POST",
113
+ body: JSON.stringify({
114
+ model,
115
+ messages: [{ role: "user", content: prompt }],
116
+ }),
117
+ });
118
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
119
+ });
120
+ async function main() {
121
+ const transport = new StdioServerTransport();
122
+ await server.connect(transport);
123
+ }
124
+ main().catch((err) => {
125
+ console.error("Kontyra MCP Server error:", err);
126
+ process.exit(1);
127
+ });
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@kontyra/mcp-server",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Official Model Context Protocol (MCP) server for Kontyra & DevOS",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "kontyra-mcp": "dist/index.js"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/RayBen445/kontyra-mcp.git"
13
+ },
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "prepublishOnly": "npm run build",
17
+ "start": "node dist/index.js"
18
+ },
19
+ "keywords": [
20
+ "kontyra",
21
+ "devos",
22
+ "mcp",
23
+ "model-context-protocol",
24
+ "ai",
25
+ "kora",
26
+ "claude",
27
+ "cursor"
28
+ ],
29
+ "author": "Kontyra Team <support@kontyra.name.ng>",
30
+ "license": "MIT",
31
+ "dependencies": {
32
+ "@modelcontextprotocol/sdk": "^1.0.0",
33
+ "zod": "^3.23.8"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "^22.0.0",
37
+ "typescript": "^5.6.0"
38
+ }
39
+ }