mcp-server-kaggle 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.
@@ -0,0 +1,33 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+
8
+ # Virtual environments
9
+ .venv
10
+ venv/
11
+ env/
12
+
13
+ # Environment variables
14
+ .env
15
+ .env.local
16
+
17
+ # IDE
18
+ .vscode/
19
+ .idea/
20
+ *.swp
21
+ *.swo
22
+ *~
23
+
24
+ # OS
25
+ .DS_Store
26
+ Thumbs.db
27
+
28
+ # Testing
29
+ .pytest_cache/
30
+ .coverage
31
+ htmlcov/
32
+
33
+ uv.lock
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Seif Eldeen Sameh
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.
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-server-kaggle
3
+ Version: 0.1.0
4
+ Summary: A Model Context Protocol (MCP) server for the Kaggle API
5
+ Project-URL: Homepage, https://github.com/Seif-Sameh/Kaggle-mcp
6
+ Project-URL: Repository, https://github.com/Seif-Sameh/Kaggle-mcp
7
+ Project-URL: Issues, https://github.com/Seif-Sameh/Kaggle-mcp/issues
8
+ Author-email: Seif Sameh <seifsameh2626@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,kaggle,llm,mcp,model-context-protocol
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: fastmcp>=0.1.0
22
+ Requires-Dist: kaggle>=1.7.4.5
23
+ Requires-Dist: python-dotenv>=1.0.0
24
+ Description-Content-Type: text/markdown
25
+
26
+ # Kaggle MCP Server
27
+
28
+ A Model Context Protocol (MCP) server that provides seamless integration with the Kaggle API. Interact with Kaggle competitions, datasets, kernels, and models through MCP-compatible clients like Claude Desktop.
29
+
30
+ ## Features
31
+
32
+ - **Competitions**: List, download files, submit, view leaderboards and submissions
33
+ - **Datasets**: Search, download, create, and manage datasets with version control
34
+ - **Kernels**: List, push, pull, and manage Kaggle notebooks and scripts
35
+ - **Models**: Create, update, and manage ML models and instances with full version control
36
+
37
+ ## Installation
38
+
39
+ ### Prerequisites
40
+
41
+ - Python 3.10 or higher
42
+ - A Kaggle account with API credentials
43
+
44
+
45
+ ### Install from Source
46
+
47
+ ```bash
48
+ git clone https://github.com/Seif-Sameh/Kaggle-mcp.git
49
+ cd Kaggle-mcp
50
+ ```
51
+
52
+ ## Setup
53
+
54
+ ### 1. Get Your Kaggle API Credentials
55
+
56
+ 1. Go to [https://www.kaggle.com/account](https://www.kaggle.com/account)
57
+ 2. Scroll to the "API" section
58
+ 3. Click "Create New Token"
59
+ 4. This downloads `kaggle.json` with your credentials
60
+
61
+ ### 2. Configure Credentials
62
+
63
+ **Option A: Environment Variables (Recommended)**
64
+
65
+ ```bash
66
+ export KAGGLE_USERNAME=your_username
67
+ export KAGGLE_API_KEY=your_api_key
68
+ ```
69
+
70
+ Or add to your `~/.zshrc` or `~/.bashrc`:
71
+
72
+ ```bash
73
+ echo 'export KAGGLE_USERNAME=your_username' >> ~/.zshrc
74
+ echo 'export KAGGLE_API_KEY=your_api_key' >> ~/.zshrc
75
+ source ~/.zshrc
76
+ ```
77
+
78
+ **Option B: Using .env File**
79
+
80
+ Create a `.env` file in your project directory:
81
+
82
+ ```env
83
+ KAGGLE_USERNAME=your_username
84
+ KAGGLE_API_KEY=your_api_key
85
+ ```
86
+
87
+ ## Usage
88
+
89
+ ### With Claude Desktop
90
+
91
+ The recommended way to use Kaggle MCP is with Claude Desktop.
92
+
93
+ 1. **Locate your Claude Desktop config file:**
94
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
95
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
96
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
97
+
98
+ 2. **Add the Kaggle MCP server configuration:**
99
+
100
+ ```json
101
+ {
102
+ "mcpServers": {
103
+ "kaggle": {
104
+ "command": "uv",
105
+ "args": [
106
+ "--directory",
107
+ "/ABSOLUTE/PATH/TO/Kaggle-mcp",
108
+ "run",
109
+ "kaggle_mcp/server.py"
110
+ ],
111
+ "env":{
112
+ "KAGGLE_USERNAME": "YOUR_KAGGLE_USERNAME",
113
+ "KAGGLE_API_KEY": "YOUR_KAGGLE_API_KEY"
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ 3. **Restart Claude Desktop**
121
+
122
+ 4. **Start using Kaggle through Claude!**
123
+
124
+ Try asking Claude:
125
+ - "List the latest Kaggle competitions"
126
+ - "Download the Titanic dataset"
127
+ - "Show me my recent competition submissions"
128
+ - "Search for NLP datasets"
129
+
130
+ ### Standalone Usage
131
+
132
+ Run the MCP server directly:
133
+
134
+ ```bash
135
+ kaggle-mcp
136
+ ```
137
+
138
+ Or as a Python module:
139
+
140
+ ```bash
141
+ python -m kaggle_mcp
142
+ ```
143
+
144
+
145
+ ## Available Tools
146
+
147
+ ### Competitions (8 tools)
148
+
149
+ | Tool | Description |
150
+ |------|-------------|
151
+ | `competitions_list` | List and search available competitions |
152
+ | `competition_list_files` | List all files in a competition |
153
+ | `competition_download_file` | Download a specific competition file |
154
+ | `competition_download_files` | Download all competition files |
155
+ | `competition_submit` | Submit predictions to a competition |
156
+ | `competition_submissions` | View your submission history |
157
+ | `competition_leaderboard_view` | View the competition leaderboard |
158
+ | `competition_leaderboard_download` | Download leaderboard data |
159
+
160
+ ### Datasets (10 tools)
161
+
162
+ | Tool | Description |
163
+ |------|-------------|
164
+ | `datasets_list` | Search and filter datasets |
165
+ | `dataset_metadata` | Get dataset metadata |
166
+ | `dataset_list_files` | List files in a dataset |
167
+ | `dataset_status` | Check dataset processing status |
168
+ | `dataset_download_file` | Download a specific dataset file |
169
+ | `dataset_download_files` | Download all dataset files |
170
+ | `dataset_create` | Create a new dataset |
171
+ | `dataset_initialize` | Initialize dataset metadata |
172
+ | `dataset_create_version` | Create a new dataset version |
173
+
174
+ ### Kernels (7 tools)
175
+
176
+ | Tool | Description |
177
+ |------|-------------|
178
+ | `kernels_list` | Search and filter kernels |
179
+ | `kernel_list_files` | List files in a kernel |
180
+ | `kernel_initialize` | Initialize kernel metadata |
181
+ | `kernel_push` | Push a kernel to Kaggle |
182
+ | `kernel_pull` | Download a kernel |
183
+ | `kernel_output` | Download kernel output files |
184
+ | `kernel_status` | Check kernel execution status |
185
+
186
+ ### Models (14 tools)
187
+
188
+ | Tool | Description |
189
+ |------|-------------|
190
+ | `models_list` | Search and filter models |
191
+ | `model_get` | Get model details and metadata |
192
+ | `model_initialize` | Initialize model metadata |
193
+ | `model_create` | Create a new model |
194
+ | `model_update` | Update model information |
195
+ | `model_delete` | Delete a model |
196
+ | `model_instance_get` | Get model instance details |
197
+ | `model_instance_initialize` | Initialize model instance metadata |
198
+ | `model_instance_create` | Create a new model instance |
199
+ | `model_instance_update` | Update a model instance |
200
+ | `model_instance_delete` | Delete a model instance |
201
+ | `model_instance_version_create` | Create a new model version |
202
+ | `model_instance_version_download` | Download a model version |
203
+ | `model_instance_version_delete` | Delete a model version |
204
+
205
+ ## Examples
206
+
207
+ ### Example 1: Working with Competitions
208
+
209
+ Ask Claude:
210
+ ```
211
+ "List active Kaggle competitions about computer vision"
212
+ ```
213
+
214
+ Claude will use the `competitions_list` tool to search and display relevant competitions.
215
+
216
+ ### Example 2: Downloading Datasets
217
+
218
+ Ask Claude:
219
+ ```
220
+ "Download the Titanic dataset to my Downloads folder"
221
+ ```
222
+
223
+ Claude will use `dataset_download_files` to fetch all dataset files.
224
+
225
+ ### Example 3: Submitting to Competitions
226
+
227
+ Ask Claude:
228
+ ```
229
+ "Submit my predictions.csv to the Titanic competition with the message 'Initial baseline model'"
230
+ ```
231
+
232
+ Claude will use `competition_submit` to upload your submission.
233
+
234
+
235
+ ## License
236
+
237
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,212 @@
1
+ # Kaggle MCP Server
2
+
3
+ A Model Context Protocol (MCP) server that provides seamless integration with the Kaggle API. Interact with Kaggle competitions, datasets, kernels, and models through MCP-compatible clients like Claude Desktop.
4
+
5
+ ## Features
6
+
7
+ - **Competitions**: List, download files, submit, view leaderboards and submissions
8
+ - **Datasets**: Search, download, create, and manage datasets with version control
9
+ - **Kernels**: List, push, pull, and manage Kaggle notebooks and scripts
10
+ - **Models**: Create, update, and manage ML models and instances with full version control
11
+
12
+ ## Installation
13
+
14
+ ### Prerequisites
15
+
16
+ - Python 3.10 or higher
17
+ - A Kaggle account with API credentials
18
+
19
+
20
+ ### Install from Source
21
+
22
+ ```bash
23
+ git clone https://github.com/Seif-Sameh/Kaggle-mcp.git
24
+ cd Kaggle-mcp
25
+ ```
26
+
27
+ ## Setup
28
+
29
+ ### 1. Get Your Kaggle API Credentials
30
+
31
+ 1. Go to [https://www.kaggle.com/account](https://www.kaggle.com/account)
32
+ 2. Scroll to the "API" section
33
+ 3. Click "Create New Token"
34
+ 4. This downloads `kaggle.json` with your credentials
35
+
36
+ ### 2. Configure Credentials
37
+
38
+ **Option A: Environment Variables (Recommended)**
39
+
40
+ ```bash
41
+ export KAGGLE_USERNAME=your_username
42
+ export KAGGLE_API_KEY=your_api_key
43
+ ```
44
+
45
+ Or add to your `~/.zshrc` or `~/.bashrc`:
46
+
47
+ ```bash
48
+ echo 'export KAGGLE_USERNAME=your_username' >> ~/.zshrc
49
+ echo 'export KAGGLE_API_KEY=your_api_key' >> ~/.zshrc
50
+ source ~/.zshrc
51
+ ```
52
+
53
+ **Option B: Using .env File**
54
+
55
+ Create a `.env` file in your project directory:
56
+
57
+ ```env
58
+ KAGGLE_USERNAME=your_username
59
+ KAGGLE_API_KEY=your_api_key
60
+ ```
61
+
62
+ ## Usage
63
+
64
+ ### With Claude Desktop
65
+
66
+ The recommended way to use Kaggle MCP is with Claude Desktop.
67
+
68
+ 1. **Locate your Claude Desktop config file:**
69
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
70
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
71
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
72
+
73
+ 2. **Add the Kaggle MCP server configuration:**
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "kaggle": {
79
+ "command": "uv",
80
+ "args": [
81
+ "--directory",
82
+ "/ABSOLUTE/PATH/TO/Kaggle-mcp",
83
+ "run",
84
+ "kaggle_mcp/server.py"
85
+ ],
86
+ "env":{
87
+ "KAGGLE_USERNAME": "YOUR_KAGGLE_USERNAME",
88
+ "KAGGLE_API_KEY": "YOUR_KAGGLE_API_KEY"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ 3. **Restart Claude Desktop**
96
+
97
+ 4. **Start using Kaggle through Claude!**
98
+
99
+ Try asking Claude:
100
+ - "List the latest Kaggle competitions"
101
+ - "Download the Titanic dataset"
102
+ - "Show me my recent competition submissions"
103
+ - "Search for NLP datasets"
104
+
105
+ ### Standalone Usage
106
+
107
+ Run the MCP server directly:
108
+
109
+ ```bash
110
+ kaggle-mcp
111
+ ```
112
+
113
+ Or as a Python module:
114
+
115
+ ```bash
116
+ python -m kaggle_mcp
117
+ ```
118
+
119
+
120
+ ## Available Tools
121
+
122
+ ### Competitions (8 tools)
123
+
124
+ | Tool | Description |
125
+ |------|-------------|
126
+ | `competitions_list` | List and search available competitions |
127
+ | `competition_list_files` | List all files in a competition |
128
+ | `competition_download_file` | Download a specific competition file |
129
+ | `competition_download_files` | Download all competition files |
130
+ | `competition_submit` | Submit predictions to a competition |
131
+ | `competition_submissions` | View your submission history |
132
+ | `competition_leaderboard_view` | View the competition leaderboard |
133
+ | `competition_leaderboard_download` | Download leaderboard data |
134
+
135
+ ### Datasets (10 tools)
136
+
137
+ | Tool | Description |
138
+ |------|-------------|
139
+ | `datasets_list` | Search and filter datasets |
140
+ | `dataset_metadata` | Get dataset metadata |
141
+ | `dataset_list_files` | List files in a dataset |
142
+ | `dataset_status` | Check dataset processing status |
143
+ | `dataset_download_file` | Download a specific dataset file |
144
+ | `dataset_download_files` | Download all dataset files |
145
+ | `dataset_create` | Create a new dataset |
146
+ | `dataset_initialize` | Initialize dataset metadata |
147
+ | `dataset_create_version` | Create a new dataset version |
148
+
149
+ ### Kernels (7 tools)
150
+
151
+ | Tool | Description |
152
+ |------|-------------|
153
+ | `kernels_list` | Search and filter kernels |
154
+ | `kernel_list_files` | List files in a kernel |
155
+ | `kernel_initialize` | Initialize kernel metadata |
156
+ | `kernel_push` | Push a kernel to Kaggle |
157
+ | `kernel_pull` | Download a kernel |
158
+ | `kernel_output` | Download kernel output files |
159
+ | `kernel_status` | Check kernel execution status |
160
+
161
+ ### Models (14 tools)
162
+
163
+ | Tool | Description |
164
+ |------|-------------|
165
+ | `models_list` | Search and filter models |
166
+ | `model_get` | Get model details and metadata |
167
+ | `model_initialize` | Initialize model metadata |
168
+ | `model_create` | Create a new model |
169
+ | `model_update` | Update model information |
170
+ | `model_delete` | Delete a model |
171
+ | `model_instance_get` | Get model instance details |
172
+ | `model_instance_initialize` | Initialize model instance metadata |
173
+ | `model_instance_create` | Create a new model instance |
174
+ | `model_instance_update` | Update a model instance |
175
+ | `model_instance_delete` | Delete a model instance |
176
+ | `model_instance_version_create` | Create a new model version |
177
+ | `model_instance_version_download` | Download a model version |
178
+ | `model_instance_version_delete` | Delete a model version |
179
+
180
+ ## Examples
181
+
182
+ ### Example 1: Working with Competitions
183
+
184
+ Ask Claude:
185
+ ```
186
+ "List active Kaggle competitions about computer vision"
187
+ ```
188
+
189
+ Claude will use the `competitions_list` tool to search and display relevant competitions.
190
+
191
+ ### Example 2: Downloading Datasets
192
+
193
+ Ask Claude:
194
+ ```
195
+ "Download the Titanic dataset to my Downloads folder"
196
+ ```
197
+
198
+ Claude will use `dataset_download_files` to fetch all dataset files.
199
+
200
+ ### Example 3: Submitting to Competitions
201
+
202
+ Ask Claude:
203
+ ```
204
+ "Submit my predictions.csv to the Titanic competition with the message 'Initial baseline model'"
205
+ ```
206
+
207
+ Claude will use `competition_submit` to upload your submission.
208
+
209
+
210
+ ## License
211
+
212
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,11 @@
1
+ """
2
+ Kaggle MCP - Model Context Protocol server for Kaggle API
3
+ """
4
+
5
+ __version__ = "0.1.0"
6
+ __author__ = "Seif Sameh"
7
+ __email__ = "seifsameh2626@gmail.com"
8
+
9
+ from .server import mcp
10
+
11
+ __all__ = ["mcp"]
@@ -0,0 +1,4 @@
1
+ from kaggle_mcp.server import main
2
+
3
+ if __name__ == "__main__":
4
+ main()