rosh-mcp 0.1.0__tar.gz
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.
- rosh_mcp-0.1.0/.gitignore +7 -0
- rosh_mcp-0.1.0/LICENSE +21 -0
- rosh_mcp-0.1.0/PKG-INFO +113 -0
- rosh_mcp-0.1.0/README.md +92 -0
- rosh_mcp-0.1.0/pyproject.toml +34 -0
- rosh_mcp-0.1.0/server.json +20 -0
- rosh_mcp-0.1.0/src/rosh_mcp/__init__.py +3 -0
- rosh_mcp-0.1.0/src/rosh_mcp/__main__.py +5 -0
- rosh_mcp-0.1.0/src/rosh_mcp/server.py +191 -0
rosh_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rosh Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
rosh_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rosh-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Rosh — give any AI the power to create interactive web apps, games, and 3D scenes
|
|
5
|
+
Project-URL: Homepage, https://rosh.cloud
|
|
6
|
+
Project-URL: Repository, https://github.com/rosh-studio/rosh-mcp
|
|
7
|
+
Project-URL: Documentation, https://rosh.cloud/api
|
|
8
|
+
Author-email: Rosh Studio <hello@rosh.cloud>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: 3d,ai,creative-coding,game-development,mcp,rosh
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Games/Entertainment
|
|
16
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: httpx>=0.25.0
|
|
19
|
+
Requires-Dist: mcp>=1.0.0
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# Rosh MCP Server
|
|
23
|
+
|
|
24
|
+
<!-- mcp-name: io.github.rosh-studio/rosh-mcp -->
|
|
25
|
+
|
|
26
|
+
Give any AI the power to create and publish interactive web apps, games, and 3D scenes using [Rosh](https://rosh.cloud) — a plain-English programming language.
|
|
27
|
+
|
|
28
|
+
## What is Rosh?
|
|
29
|
+
|
|
30
|
+
Rosh lets you write programs in plain English:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
create box called player at 400 300
|
|
34
|
+
set player color "blue"
|
|
35
|
+
on key "ArrowRight" then set player x to player x + 5
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This compiles to a runnable HTML5 canvas app, a Phaser game, or a Three.js 3D scene — depending on the target.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### Claude Desktop / Claude Code
|
|
43
|
+
|
|
44
|
+
Add to your MCP config (`~/.claude/mcp.json` or Claude Desktop settings):
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"rosh": {
|
|
50
|
+
"command": "uvx",
|
|
51
|
+
"args": ["rosh-mcp"],
|
|
52
|
+
"env": {
|
|
53
|
+
"ROSH_API_KEY": "rosh_k1_your_key_here"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Cursor / Windsurf
|
|
61
|
+
|
|
62
|
+
Same config format — add to your MCP settings file.
|
|
63
|
+
|
|
64
|
+
### Get an API Key
|
|
65
|
+
|
|
66
|
+
1. Create an account at [rosh.cloud](https://rosh.cloud)
|
|
67
|
+
2. Go to Settings → API Keys
|
|
68
|
+
3. Create a key with `read,write` scopes
|
|
69
|
+
|
|
70
|
+
> **Note:** `rosh_docs` and `rosh_compile` work without an API key. You only need a key for publishing.
|
|
71
|
+
|
|
72
|
+
## Tools
|
|
73
|
+
|
|
74
|
+
| Tool | Description | Auth Required |
|
|
75
|
+
|------|-------------|---------------|
|
|
76
|
+
| `rosh_docs` | Get the full Rosh language reference | No |
|
|
77
|
+
| `rosh_compile` | Compile Rosh code to HTML | No |
|
|
78
|
+
| `rosh_publish` | Publish a program to rosh.cloud | Yes (write) |
|
|
79
|
+
| `rosh_list_programs` | List your programs | Yes (read) |
|
|
80
|
+
| `rosh_get_program` | Get program details by ID | Yes (read) |
|
|
81
|
+
| `rosh_update_program` | Update an existing program | Yes (write) |
|
|
82
|
+
| `rosh_delete_program` | Delete a program | Yes (write) |
|
|
83
|
+
| `rosh_hide_program` | Hide a program (moderation) | Yes (moderate) |
|
|
84
|
+
| `rosh_show_program` | Unhide a program | Yes (moderate) |
|
|
85
|
+
|
|
86
|
+
## Example Prompts
|
|
87
|
+
|
|
88
|
+
Try these with any MCP-capable AI:
|
|
89
|
+
|
|
90
|
+
- **"Build me a space shooter game"** — AI reads docs, writes Rosh code, compiles to Phaser
|
|
91
|
+
- **"Create a 3D rotating sculpture"** — compiles to Three.js
|
|
92
|
+
- **"Make an interactive dashboard with buttons and counters"** — compiles to web
|
|
93
|
+
- **"Show me what Rosh can do"** — AI calls `rosh_docs` and explores
|
|
94
|
+
|
|
95
|
+
## Environment Variables
|
|
96
|
+
|
|
97
|
+
| Variable | Required | Default | Description |
|
|
98
|
+
|----------|----------|---------|-------------|
|
|
99
|
+
| `ROSH_API_KEY` | For publishing | — | Your rosh.cloud API key |
|
|
100
|
+
| `ROSH_API_BASE` | No | `https://rosh.cloud` | API base URL |
|
|
101
|
+
|
|
102
|
+
## Development
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git clone https://github.com/rosh-studio/rosh-mcp.git
|
|
106
|
+
cd rosh-mcp
|
|
107
|
+
pip install -e .
|
|
108
|
+
rosh-mcp # runs the stdio server
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
rosh_mcp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Rosh MCP Server
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.rosh-studio/rosh-mcp -->
|
|
4
|
+
|
|
5
|
+
Give any AI the power to create and publish interactive web apps, games, and 3D scenes using [Rosh](https://rosh.cloud) — a plain-English programming language.
|
|
6
|
+
|
|
7
|
+
## What is Rosh?
|
|
8
|
+
|
|
9
|
+
Rosh lets you write programs in plain English:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
create box called player at 400 300
|
|
13
|
+
set player color "blue"
|
|
14
|
+
on key "ArrowRight" then set player x to player x + 5
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This compiles to a runnable HTML5 canvas app, a Phaser game, or a Three.js 3D scene — depending on the target.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### Claude Desktop / Claude Code
|
|
22
|
+
|
|
23
|
+
Add to your MCP config (`~/.claude/mcp.json` or Claude Desktop settings):
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"rosh": {
|
|
29
|
+
"command": "uvx",
|
|
30
|
+
"args": ["rosh-mcp"],
|
|
31
|
+
"env": {
|
|
32
|
+
"ROSH_API_KEY": "rosh_k1_your_key_here"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Cursor / Windsurf
|
|
40
|
+
|
|
41
|
+
Same config format — add to your MCP settings file.
|
|
42
|
+
|
|
43
|
+
### Get an API Key
|
|
44
|
+
|
|
45
|
+
1. Create an account at [rosh.cloud](https://rosh.cloud)
|
|
46
|
+
2. Go to Settings → API Keys
|
|
47
|
+
3. Create a key with `read,write` scopes
|
|
48
|
+
|
|
49
|
+
> **Note:** `rosh_docs` and `rosh_compile` work without an API key. You only need a key for publishing.
|
|
50
|
+
|
|
51
|
+
## Tools
|
|
52
|
+
|
|
53
|
+
| Tool | Description | Auth Required |
|
|
54
|
+
|------|-------------|---------------|
|
|
55
|
+
| `rosh_docs` | Get the full Rosh language reference | No |
|
|
56
|
+
| `rosh_compile` | Compile Rosh code to HTML | No |
|
|
57
|
+
| `rosh_publish` | Publish a program to rosh.cloud | Yes (write) |
|
|
58
|
+
| `rosh_list_programs` | List your programs | Yes (read) |
|
|
59
|
+
| `rosh_get_program` | Get program details by ID | Yes (read) |
|
|
60
|
+
| `rosh_update_program` | Update an existing program | Yes (write) |
|
|
61
|
+
| `rosh_delete_program` | Delete a program | Yes (write) |
|
|
62
|
+
| `rosh_hide_program` | Hide a program (moderation) | Yes (moderate) |
|
|
63
|
+
| `rosh_show_program` | Unhide a program | Yes (moderate) |
|
|
64
|
+
|
|
65
|
+
## Example Prompts
|
|
66
|
+
|
|
67
|
+
Try these with any MCP-capable AI:
|
|
68
|
+
|
|
69
|
+
- **"Build me a space shooter game"** — AI reads docs, writes Rosh code, compiles to Phaser
|
|
70
|
+
- **"Create a 3D rotating sculpture"** — compiles to Three.js
|
|
71
|
+
- **"Make an interactive dashboard with buttons and counters"** — compiles to web
|
|
72
|
+
- **"Show me what Rosh can do"** — AI calls `rosh_docs` and explores
|
|
73
|
+
|
|
74
|
+
## Environment Variables
|
|
75
|
+
|
|
76
|
+
| Variable | Required | Default | Description |
|
|
77
|
+
|----------|----------|---------|-------------|
|
|
78
|
+
| `ROSH_API_KEY` | For publishing | — | Your rosh.cloud API key |
|
|
79
|
+
| `ROSH_API_BASE` | No | `https://rosh.cloud` | API base URL |
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git clone https://github.com/rosh-studio/rosh-mcp.git
|
|
85
|
+
cd rosh-mcp
|
|
86
|
+
pip install -e .
|
|
87
|
+
rosh-mcp # runs the stdio server
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rosh-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server for Rosh — give any AI the power to create interactive web apps, games, and 3D scenes"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Rosh Studio", email = "hello@rosh.cloud" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "rosh", "ai", "creative-coding", "game-development", "3d"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Topic :: Software Development :: Code Generators",
|
|
20
|
+
"Topic :: Games/Entertainment",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"mcp>=1.0.0",
|
|
25
|
+
"httpx>=0.25.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
rosh-mcp = "rosh_mcp.server:main"
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://rosh.cloud"
|
|
33
|
+
Repository = "https://github.com/rosh-studio/rosh-mcp"
|
|
34
|
+
Documentation = "https://rosh.cloud/api"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.rosh-studio/rosh-mcp",
|
|
4
|
+
"description": "Give any AI the power to create interactive web apps, games, and 3D scenes using Rosh — a plain-English programming language",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/rosh-studio/rosh-mcp",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "0.1.0",
|
|
10
|
+
"packages": [
|
|
11
|
+
{
|
|
12
|
+
"registryType": "pypi",
|
|
13
|
+
"identifier": "rosh-mcp",
|
|
14
|
+
"version": "0.1.0",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Rosh MCP Server — Model Context Protocol wrapper for the rosh.cloud API.
|
|
4
|
+
|
|
5
|
+
Lets any MCP-capable AI tool (Claude Desktop, Claude Code, Cursor, Windsurf,
|
|
6
|
+
etc.) compile, publish, browse, and moderate Rosh programs directly.
|
|
7
|
+
|
|
8
|
+
Environment variables:
|
|
9
|
+
ROSH_API_KEY — rosh.cloud API key (required for publishing; optional for compile/docs)
|
|
10
|
+
ROSH_API_BASE — API base URL (default: https://rosh.cloud)
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import json
|
|
14
|
+
import os
|
|
15
|
+
from typing import Optional
|
|
16
|
+
|
|
17
|
+
import httpx
|
|
18
|
+
from mcp.server.fastmcp import FastMCP
|
|
19
|
+
|
|
20
|
+
mcp = FastMCP("Rosh")
|
|
21
|
+
|
|
22
|
+
# ── Config ──
|
|
23
|
+
|
|
24
|
+
API_BASE = os.environ.get("ROSH_API_BASE", "https://rosh.cloud").rstrip("/")
|
|
25
|
+
API_KEY = os.environ.get("ROSH_API_KEY", "")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _headers() -> dict[str, str]:
|
|
29
|
+
h = {
|
|
30
|
+
"User-Agent": "RoshMCP/0.1",
|
|
31
|
+
"Content-Type": "application/json",
|
|
32
|
+
}
|
|
33
|
+
if API_KEY:
|
|
34
|
+
h["Authorization"] = f"Bearer {API_KEY}"
|
|
35
|
+
return h
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _api(method: str, path: str, data: dict | None = None) -> dict:
|
|
39
|
+
"""Make an authenticated request to the Rosh API."""
|
|
40
|
+
url = f"{API_BASE}{path}"
|
|
41
|
+
with httpx.Client(timeout=30) as client:
|
|
42
|
+
resp = client.request(method, url, headers=_headers(), json=data)
|
|
43
|
+
resp.raise_for_status()
|
|
44
|
+
return resp.json()
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _api_safe(method: str, path: str, data: dict | None = None) -> str:
|
|
48
|
+
"""Like _api but returns a formatted string, handling errors gracefully."""
|
|
49
|
+
try:
|
|
50
|
+
result = _api(method, path, data)
|
|
51
|
+
return json.dumps(result, indent=2)
|
|
52
|
+
except httpx.HTTPStatusError as e:
|
|
53
|
+
body = e.response.text
|
|
54
|
+
try:
|
|
55
|
+
detail = json.loads(body)
|
|
56
|
+
return json.dumps({"error": True, "status": e.response.status_code, "detail": detail}, indent=2)
|
|
57
|
+
except json.JSONDecodeError:
|
|
58
|
+
return json.dumps({"error": True, "status": e.response.status_code, "detail": body[:500]}, indent=2)
|
|
59
|
+
except Exception as e:
|
|
60
|
+
return json.dumps({"error": True, "detail": str(e)}, indent=2)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# ── Tools ──
|
|
64
|
+
|
|
65
|
+
@mcp.tool()
|
|
66
|
+
def rosh_docs() -> str:
|
|
67
|
+
"""Get the Rosh language documentation — keywords, widgets, targets, and examples.
|
|
68
|
+
|
|
69
|
+
Returns the full language reference including all 25 keywords, available widgets,
|
|
70
|
+
compile targets (web, phaser, threejs), and example programs. No API key needed.
|
|
71
|
+
"""
|
|
72
|
+
return _api_safe("GET", "/api/v1/docs")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@mcp.tool()
|
|
76
|
+
def rosh_compile(code: str, target: str = "web") -> str:
|
|
77
|
+
"""Compile Rosh code into a runnable HTML page. No API key needed.
|
|
78
|
+
|
|
79
|
+
Rosh is a plain-English programming language. Example:
|
|
80
|
+
create box called player at 400 300
|
|
81
|
+
set player color "blue"
|
|
82
|
+
on key "ArrowRight" then set player x to player x + 5
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
code: Rosh source code to compile
|
|
86
|
+
target: Target platform — "web" (HTML5 canvas), "phaser" (game engine), or "threejs" (3D)
|
|
87
|
+
"""
|
|
88
|
+
return _api_safe("POST", "/api/v1/compile", {"code": code, "target": target})
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@mcp.tool()
|
|
92
|
+
def rosh_publish(title: str, slug: str, code: str, target: str = "web",
|
|
93
|
+
description: str = "") -> str:
|
|
94
|
+
"""Compile and publish a Rosh program to rosh.cloud. Requires API key with write scope.
|
|
95
|
+
|
|
96
|
+
The published program gets a public URL at https://rosh.cloud/p/{username}/{slug}
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
title: Display title for the program
|
|
100
|
+
slug: URL-safe identifier (lowercase, hyphens only, e.g. "space-shooter")
|
|
101
|
+
code: Rosh source code
|
|
102
|
+
target: Target platform — "web", "phaser", or "threejs"
|
|
103
|
+
description: One-line description of what the program does
|
|
104
|
+
"""
|
|
105
|
+
return _api_safe("POST", "/api/v1/programs", {
|
|
106
|
+
"title": title,
|
|
107
|
+
"slug": slug,
|
|
108
|
+
"code": code,
|
|
109
|
+
"target": target,
|
|
110
|
+
"description": description,
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@mcp.tool()
|
|
115
|
+
def rosh_list_programs() -> str:
|
|
116
|
+
"""List all programs owned by the authenticated user. Requires API key."""
|
|
117
|
+
return _api_safe("GET", "/api/v1/programs")
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@mcp.tool()
|
|
121
|
+
def rosh_get_program(program_id: int) -> str:
|
|
122
|
+
"""Get details of a specific program by ID. Requires API key.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
program_id: The numeric program ID
|
|
126
|
+
"""
|
|
127
|
+
return _api_safe("GET", f"/api/v1/programs/{program_id}")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@mcp.tool()
|
|
131
|
+
def rosh_update_program(program_id: int, title: Optional[str] = None,
|
|
132
|
+
description: Optional[str] = None, code: Optional[str] = None,
|
|
133
|
+
target: Optional[str] = None) -> str:
|
|
134
|
+
"""Update an existing program. Only provided fields are changed. Requires API key with write scope.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
program_id: The numeric program ID
|
|
138
|
+
title: New title (optional)
|
|
139
|
+
description: New description (optional)
|
|
140
|
+
code: New source code (optional)
|
|
141
|
+
target: New target platform (optional)
|
|
142
|
+
"""
|
|
143
|
+
data = {}
|
|
144
|
+
if title is not None:
|
|
145
|
+
data["title"] = title
|
|
146
|
+
if description is not None:
|
|
147
|
+
data["description"] = description
|
|
148
|
+
if code is not None:
|
|
149
|
+
data["code"] = code
|
|
150
|
+
if target is not None:
|
|
151
|
+
data["target"] = target
|
|
152
|
+
return _api_safe("PUT", f"/api/v1/programs/{program_id}", data)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@mcp.tool()
|
|
156
|
+
def rosh_delete_program(program_id: int) -> str:
|
|
157
|
+
"""Permanently delete a program. Requires API key with write scope.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
program_id: The numeric program ID
|
|
161
|
+
"""
|
|
162
|
+
return _api_safe("DELETE", f"/api/v1/programs/{program_id}")
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
@mcp.tool()
|
|
166
|
+
def rosh_hide_program(identifier: str) -> str:
|
|
167
|
+
"""Hide a program from public view (moderation). Requires API key with moderate scope.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
identifier: Program ID (numeric) or slug (string)
|
|
171
|
+
"""
|
|
172
|
+
return _api_safe("POST", f"/api/v1/programs/{identifier}/hide")
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@mcp.tool()
|
|
176
|
+
def rosh_show_program(identifier: str) -> str:
|
|
177
|
+
"""Make a hidden program visible again. Requires API key with moderate scope.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
identifier: Program ID (numeric) or slug (string)
|
|
181
|
+
"""
|
|
182
|
+
return _api_safe("POST", f"/api/v1/programs/{identifier}/show")
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def main():
|
|
186
|
+
"""Entry point for the MCP server."""
|
|
187
|
+
mcp.run(transport="stdio")
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
if __name__ == "__main__":
|
|
191
|
+
main()
|