Skip to content

Commit 3124465

Browse files
authored
Merge pull request #137 from sitamgithub-MSIT/kitops-mcp
Changes Suggested in KitOps MCP
2 parents 63e0e0d + def7428 commit 3124465

File tree

5 files changed

+80
-7
lines changed

5 files changed

+80
-7
lines changed

kitops-mcp/README.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# KitOps MCP Server
1+
# KitOps MCP Server
2+
3+
We are going to implement an MCP server to orchestrate KitOps for managing and distributing machine learning models. Agents will be able to connect to discover tools for creating, inspecting, pushing, pulling, and removing ModelKits from remote registries like Jozu Hub.
4+
5+
We use:
6+
7+
- [KitOps](https://kitops.org/) for versioning, packaging, and distributing ML models
8+
- Cursor (MCP Host)
9+
10+
## Set Up
11+
12+
Follow these steps one by one:
13+
14+
### Install Kit CLI
15+
16+
Here is the documentation for downloading and installing the Kit CLI: [Kit CLI Installation](https://kitops.org/docs/cli/installation/) for your operating system.
17+
18+
After installing the Kit CLI, you can verify the installation by running:
19+
20+
```bash
21+
kit version
22+
```
23+
24+
### Create .env File
25+
26+
Create a `.env` file in the root directory of your project with the following content:
27+
28+
```env
29+
JOZU_USERNAME=<your_jozu_hub_email>
30+
JOZU_PASSWORD=<your_jozu_hub_account_password>
31+
JOZU_NAMESPACE=<name_of_repository_in_jozu_hub>
32+
```
33+
34+
All the values are associated with your Jozu Hub account. If you don't have a Jozu account, you can create one at [Jozu Hub](https://jozu.ml/).
35+
36+
### Install Dependencies
37+
38+
```bash
39+
uv sync
40+
```
41+
42+
## Use MCP Server
43+
44+
Run the MCP server with the created configuration file as `mcp.json` either globally or in the current project directory. Here's the code of configuring MCP globally to run the server:
45+
46+
```json
47+
{
48+
"mcpServers": {
49+
"kitops_mcp": {
50+
"command": "uv",
51+
"args": [
52+
"--directory",
53+
"/Users/akshay/Eigen/ai-engineering-hub/kitops-mcp",
54+
"run",
55+
"--with",
56+
"mcp",
57+
"server.py"
58+
]
59+
}
60+
}
61+
}
62+
```
63+
64+
## 📬 Stay Updated with Our Newsletter!
65+
66+
**Get a FREE Data Science eBook** 📖 with 150+ essential lessons in Data Science when you subscribe to our newsletter! Stay in the loop with the latest tutorials, insights, and exclusive resources. [Subscribe now!](https://join.dailydoseofds.com)
67+
68+
[![Daily Dose of Data Science Newsletter](https://github.com/patchy631/ai-engineering/blob/main/resources/join_ddods.png)](https://join.dailydoseofds.com)
69+
70+
## Contribution
71+
72+
Contributions are welcome! Feel free to fork this repository and submit pull requests with your improvements.

kitops-mcp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "kitops-mcp"
33
version = "0.1.0"
4-
description = "Add your description here"
4+
description = "MCP server for managing KitOps ModelKits remotely"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [

kitops-mcp/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def remove_modelkit(modelkit_tag: str) -> str:
108108
This operation cannot be undone, so use it with caution.
109109
110110
Args:
111-
modelkit_tag: The tag of the ModelKit to remove in the format 'owner/name:tag'.
111+
modelkit_tag: The tag of the ModelKit to remove in the format 'registry/namespace/repository:tag'.
112112
113113
Returns:
114114
A message confirming the ModelKit was removed successfully.

kitops-mcp/tools.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,15 @@ def push_and_pack(modelkit_tag: str, working_dir: str) -> str:
8080
validate_modelkit_tag(modelkit_tag)
8181

8282
try:
83-
# Create a ModelKitManager instance and pack and push the ModelKit
84-
kitfile = Kitfile(path=os.path.join(working_dir, "Kitfile"))
85-
if not os.path.exists(os.path.join(working_dir, "Kitfile")):
83+
# Check if Kitfile exists before creating instance
84+
kitfile_path = os.path.join(working_dir, "Kitfile")
85+
if not os.path.exists(kitfile_path):
8686
raise FileNotFoundError(
8787
f"Kitfile not found in the working directory '{working_dir}'"
8888
)
89+
kitfile = Kitfile(path=kitfile_path)
8990

91+
# Create a ModelKitManager instance and pack and push the ModelKit
9092
manager = ModelKitManager(
9193
working_directory=working_dir, modelkit_tag=modelkit_tag
9294
)

kitops-mcp/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def validate_modelkit_tag(modelkit_tag: str) -> bool:
1111
)
1212

1313
# Split the tag to check individual components
14-
path, tag_part = modelkit_tag.split(":")
14+
path, tag_part = modelkit_tag.rsplit(":", 1)
1515
path_parts = path.split("/")
1616

1717
# Ensure all parts are non-empty

0 commit comments

Comments
 (0)