cds-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.
cds_mcp-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,287 @@
1
+ Metadata-Version: 2.4
2
+ Name: cds-mcp
3
+ Version: 0.1.0
4
+ Summary: Model Context Protocol server for CERN Document Server (CDS)
5
+ Author-email: Mohamed Elashri <melashri@cern.ch>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/MohamedElashri/cds-mcp
8
+ Project-URL: Repository, https://github.com/MohamedElashri/cds-mcp
9
+ Project-URL: Issues, https://github.com/MohamedElashri/cds-mcp/issues
10
+ Project-URL: Documentation, https://github.com/MohamedElashri/cds-mcp#readme
11
+ Keywords: mcp,model-context-protocol,cern,cds,document-server,physics,research,hep
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
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 :: Scientific/Engineering :: Physics
20
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: requests>=2.31.0
24
+ Requires-Dist: pydantic>=2.5.0
25
+ Requires-Dist: mcp>=1.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
28
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
29
+ Requires-Dist: responses>=0.24.0; extra == "dev"
30
+ Requires-Dist: mypy>=1.7.0; extra == "dev"
31
+ Requires-Dist: black>=23.0.0; extra == "dev"
32
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
33
+
34
+ # CDS MCP Server
35
+
36
+ A Model Context Protocol (MCP) server for integrating with CERN Document Server (CDS), built on the Invenio digital library framework.
37
+
38
+ ## Features
39
+
40
+ - **Search CDS documents** with filters for experiments, document types, and date ranges
41
+ - **Get detailed document information** including full abstracts, authors, and metadata
42
+ - **Access document files** with download URLs and file metadata
43
+ - **Browse experiments and document types** for better search filtering
44
+
45
+
46
+ ## Installation
47
+
48
+ Requires Python 3.10+.
49
+
50
+ ### Quickstart (recommended)
51
+
52
+ No installation needed, just use [uvx](https://docs.astral.sh/uv/) to run directly:
53
+
54
+ ```bash
55
+ uvx cds-mcp
56
+ ```
57
+
58
+ ### From PyPI
59
+
60
+ ```bash
61
+ pip install cds-mcp
62
+ ```
63
+
64
+ ### From source
65
+
66
+ ```bash
67
+ git clone https://github.com/MohamedElashri/cds-mcp
68
+ cd cds-mcp
69
+ uv sync
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ### Claude Desktop
75
+
76
+ Add to your `claude_desktop_config.json`:
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "cds": {
82
+ "command": "uvx",
83
+ "args": ["cds-mcp"],
84
+ "env": {
85
+ "CDS_SESSION_COOKIE": "session_cookie_here"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ For **public access only**, omit the `CDS_SESSION_COOKIE`:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "cds": {
98
+ "command": "uvx",
99
+ "args": ["cds-mcp"],
100
+ "env": {}
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ Note for macOS users: If you see an error about `uvx` not being found, you may need to provide the absolute path. Claude Desktop does not support `~` or `$HOME` expansion.
107
+
108
+ 1. Run `which uvx` in your terminal to find the path (e.g., `/Users/yourusername/.local/bin/uvx`).
109
+ 2. Use that absolute path in the `command` field:
110
+
111
+ ```json
112
+ "command": "/Users/yourusername/.local/bin/uvx"
113
+ ```
114
+
115
+ ### Claude Code
116
+
117
+ Project-specific (default) — installs in the current directory's configuration:
118
+
119
+ ```bash
120
+ claude mcp add cds-mcp -- uvx cds-mcp
121
+ ```
122
+
123
+ Global — installs for your user account (works in all projects):
124
+
125
+ ```bash
126
+ claude mcp add --scope user cds-mcp -- uvx cds-mcp
127
+ ```
128
+
129
+ To include authentication, add `-e CDS_SESSION_COOKIE=your_session_cookie_here` before the `--`:
130
+
131
+ ```bash
132
+ # Example: Global installation with authentication
133
+ claude mcp add --scope user -e CDS_SESSION_COOKIE=your_session_cookie_here cds-mcp -- uvx cds-mcp
134
+ ```
135
+
136
+ Manual Configuration — you can also manually edit your global config at `~/.claude.json` (on Linux/macOS) or `%APPDATA%\Claude\claude.json` (on Windows):
137
+
138
+ ```json
139
+ {
140
+ "mcpServers": {
141
+ "cds": {
142
+ "command": "uvx",
143
+ "args": ["cds-mcp"],
144
+ "env": {
145
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
146
+ }
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### GitHub Copilot
153
+
154
+ Add to your VS Code `settings.json`:
155
+
156
+ ```json
157
+ {
158
+ "mcp": {
159
+ "servers": {
160
+ "cds": {
161
+ "command": "uvx",
162
+ "args": ["cds-mcp"],
163
+ "env": {
164
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ Or add a `.vscode/mcp.json` to your project:
173
+
174
+ ```json
175
+ {
176
+ "servers": {
177
+ "cds": {
178
+ "command": "uvx",
179
+ "args": ["cds-mcp"],
180
+ "env": {
181
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
182
+ }
183
+ }
184
+ }
185
+ }
186
+ ```
187
+
188
+ ### Gemini CLI
189
+
190
+ Add to your `~/.gemini/settings.json`:
191
+
192
+ ```json
193
+ {
194
+ "mcpServers": {
195
+ "cds": {
196
+ "command": "uvx",
197
+ "args": ["cds-mcp"],
198
+ "env": {
199
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
200
+ }
201
+ }
202
+ }
203
+ }
204
+ ```
205
+
206
+ ### Direct usage
207
+
208
+ ```bash
209
+ # Run with uvx (no install needed)
210
+ uvx cds-mcp
211
+
212
+ # Or if installed from PyPI
213
+ cds-mcp
214
+
215
+ # Or from source
216
+ uv run cds-mcp
217
+
218
+ # With authentication
219
+ CDS_SESSION_COOKIE=your_session_cookie_here uvx cds-mcp
220
+ ```
221
+
222
+
223
+ ## Access Limitations & Authentication
224
+
225
+ **⚠️ Current Status: Public Access Only**
226
+
227
+ This MCP server currently **only accesses public CDS records**. Experiment-specific restricted content (ATLAS/CMS/LHC Internal Notes, etc.) requires authentication that is not yet fully supported.
228
+
229
+ ### Restricted Collections
230
+
231
+ The following collections in particular require experiment membership and authentication:
232
+ - **ATLAS**: Internal Notes, Communications, Conference Slides
233
+ - **CMS**: Internal Notes, Analysis Notes
234
+ - **LHCb**: Internal Notes, Analysis Notes
235
+ - **ALICE**: Internal Notes, Analysis Notes
236
+
237
+ ### Workaround for Restricted Access
238
+
239
+ **⚠️ TEMPORARY SOLUTION**: If you need access to restricted content, you can use your browser session cookie as a workaround:
240
+
241
+ 1. **Log into CDS** in your browser (https://cds.cern.ch)
242
+ 2. **Extract your session cookie**:
243
+ - **Chrome/Edge**: Open Developer Tools (F12) → Application → Cookies → https://cds.cern.ch → Copy `INVENIOSESSION` value
244
+ - **Firefox**: Open Developer Tools (F12) → Storage → Cookies → https://cds.cern.ch → Copy `INVENIOSESSION` value
245
+ - **Safari**: Develop menu → Show Web Inspector → Storage → Cookies → https://cds.cern.ch → Copy `INVENIOSESSION` value
246
+ 3. **Set the environment variable**:
247
+ ```bash
248
+ export CDS_SESSION_COOKIE="session_cookie_here"
249
+ ```
250
+
251
+ **Important Notes**:
252
+ - This is a **temporary workaround** while we develop proper authentication
253
+ - Session cookies **expire** and need to be refreshed periodically
254
+ - This method requires **manual cookie management**
255
+ - **Proper CERN SSO integration** is planned for future releases
256
+
257
+ I'm not sure how happy CERN IT will be happy about this approach. So please be carefull while doing it. Deal with this session cookie as a secret and don't share it with anyone.
258
+
259
+ ### Future Authentication
260
+
261
+ We are working on implementing proper authentication through:
262
+ - CERN Single Sign-On (SSO) integration
263
+ - OAuth/SAML authentication flows
264
+ - Automatic session management
265
+
266
+
267
+ ## Tools
268
+
269
+ 1. **`search_cds_documents`** — Search CDS with various filters
270
+ 2. **`get_cds_document_details`** — Get detailed information about a specific document
271
+ 3. **`get_cds_document_files`** — Get file information and download URLs
272
+ 4. **`get_cds_experiments`** — List available CERN experiments for filtering
273
+ 5. **`get_cds_document_types`** — List available document types for filtering
274
+
275
+ ## Development
276
+
277
+ ```bash
278
+ git clone https://github.com/MohamedElashri/cds-mcp
279
+ cd cds-mcp
280
+ uv sync
281
+ uv run python test_integration.py # Test real CDS API integration
282
+ uv run python test_mcp_server.py # Test MCP server functionality
283
+ ```
284
+
285
+ ## License
286
+
287
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,254 @@
1
+ # CDS MCP Server
2
+
3
+ A Model Context Protocol (MCP) server for integrating with CERN Document Server (CDS), built on the Invenio digital library framework.
4
+
5
+ ## Features
6
+
7
+ - **Search CDS documents** with filters for experiments, document types, and date ranges
8
+ - **Get detailed document information** including full abstracts, authors, and metadata
9
+ - **Access document files** with download URLs and file metadata
10
+ - **Browse experiments and document types** for better search filtering
11
+
12
+
13
+ ## Installation
14
+
15
+ Requires Python 3.10+.
16
+
17
+ ### Quickstart (recommended)
18
+
19
+ No installation needed, just use [uvx](https://docs.astral.sh/uv/) to run directly:
20
+
21
+ ```bash
22
+ uvx cds-mcp
23
+ ```
24
+
25
+ ### From PyPI
26
+
27
+ ```bash
28
+ pip install cds-mcp
29
+ ```
30
+
31
+ ### From source
32
+
33
+ ```bash
34
+ git clone https://github.com/MohamedElashri/cds-mcp
35
+ cd cds-mcp
36
+ uv sync
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ### Claude Desktop
42
+
43
+ Add to your `claude_desktop_config.json`:
44
+
45
+ ```json
46
+ {
47
+ "mcpServers": {
48
+ "cds": {
49
+ "command": "uvx",
50
+ "args": ["cds-mcp"],
51
+ "env": {
52
+ "CDS_SESSION_COOKIE": "session_cookie_here"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ For **public access only**, omit the `CDS_SESSION_COOKIE`:
60
+
61
+ ```json
62
+ {
63
+ "mcpServers": {
64
+ "cds": {
65
+ "command": "uvx",
66
+ "args": ["cds-mcp"],
67
+ "env": {}
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ Note for macOS users: If you see an error about `uvx` not being found, you may need to provide the absolute path. Claude Desktop does not support `~` or `$HOME` expansion.
74
+
75
+ 1. Run `which uvx` in your terminal to find the path (e.g., `/Users/yourusername/.local/bin/uvx`).
76
+ 2. Use that absolute path in the `command` field:
77
+
78
+ ```json
79
+ "command": "/Users/yourusername/.local/bin/uvx"
80
+ ```
81
+
82
+ ### Claude Code
83
+
84
+ Project-specific (default) — installs in the current directory's configuration:
85
+
86
+ ```bash
87
+ claude mcp add cds-mcp -- uvx cds-mcp
88
+ ```
89
+
90
+ Global — installs for your user account (works in all projects):
91
+
92
+ ```bash
93
+ claude mcp add --scope user cds-mcp -- uvx cds-mcp
94
+ ```
95
+
96
+ To include authentication, add `-e CDS_SESSION_COOKIE=your_session_cookie_here` before the `--`:
97
+
98
+ ```bash
99
+ # Example: Global installation with authentication
100
+ claude mcp add --scope user -e CDS_SESSION_COOKIE=your_session_cookie_here cds-mcp -- uvx cds-mcp
101
+ ```
102
+
103
+ Manual Configuration — you can also manually edit your global config at `~/.claude.json` (on Linux/macOS) or `%APPDATA%\Claude\claude.json` (on Windows):
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "cds": {
109
+ "command": "uvx",
110
+ "args": ["cds-mcp"],
111
+ "env": {
112
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
113
+ }
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### GitHub Copilot
120
+
121
+ Add to your VS Code `settings.json`:
122
+
123
+ ```json
124
+ {
125
+ "mcp": {
126
+ "servers": {
127
+ "cds": {
128
+ "command": "uvx",
129
+ "args": ["cds-mcp"],
130
+ "env": {
131
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ ```
138
+
139
+ Or add a `.vscode/mcp.json` to your project:
140
+
141
+ ```json
142
+ {
143
+ "servers": {
144
+ "cds": {
145
+ "command": "uvx",
146
+ "args": ["cds-mcp"],
147
+ "env": {
148
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
149
+ }
150
+ }
151
+ }
152
+ }
153
+ ```
154
+
155
+ ### Gemini CLI
156
+
157
+ Add to your `~/.gemini/settings.json`:
158
+
159
+ ```json
160
+ {
161
+ "mcpServers": {
162
+ "cds": {
163
+ "command": "uvx",
164
+ "args": ["cds-mcp"],
165
+ "env": {
166
+ "CDS_SESSION_COOKIE": "your_session_cookie_here"
167
+ }
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### Direct usage
174
+
175
+ ```bash
176
+ # Run with uvx (no install needed)
177
+ uvx cds-mcp
178
+
179
+ # Or if installed from PyPI
180
+ cds-mcp
181
+
182
+ # Or from source
183
+ uv run cds-mcp
184
+
185
+ # With authentication
186
+ CDS_SESSION_COOKIE=your_session_cookie_here uvx cds-mcp
187
+ ```
188
+
189
+
190
+ ## Access Limitations & Authentication
191
+
192
+ **⚠️ Current Status: Public Access Only**
193
+
194
+ This MCP server currently **only accesses public CDS records**. Experiment-specific restricted content (ATLAS/CMS/LHC Internal Notes, etc.) requires authentication that is not yet fully supported.
195
+
196
+ ### Restricted Collections
197
+
198
+ The following collections in particular require experiment membership and authentication:
199
+ - **ATLAS**: Internal Notes, Communications, Conference Slides
200
+ - **CMS**: Internal Notes, Analysis Notes
201
+ - **LHCb**: Internal Notes, Analysis Notes
202
+ - **ALICE**: Internal Notes, Analysis Notes
203
+
204
+ ### Workaround for Restricted Access
205
+
206
+ **⚠️ TEMPORARY SOLUTION**: If you need access to restricted content, you can use your browser session cookie as a workaround:
207
+
208
+ 1. **Log into CDS** in your browser (https://cds.cern.ch)
209
+ 2. **Extract your session cookie**:
210
+ - **Chrome/Edge**: Open Developer Tools (F12) → Application → Cookies → https://cds.cern.ch → Copy `INVENIOSESSION` value
211
+ - **Firefox**: Open Developer Tools (F12) → Storage → Cookies → https://cds.cern.ch → Copy `INVENIOSESSION` value
212
+ - **Safari**: Develop menu → Show Web Inspector → Storage → Cookies → https://cds.cern.ch → Copy `INVENIOSESSION` value
213
+ 3. **Set the environment variable**:
214
+ ```bash
215
+ export CDS_SESSION_COOKIE="session_cookie_here"
216
+ ```
217
+
218
+ **Important Notes**:
219
+ - This is a **temporary workaround** while we develop proper authentication
220
+ - Session cookies **expire** and need to be refreshed periodically
221
+ - This method requires **manual cookie management**
222
+ - **Proper CERN SSO integration** is planned for future releases
223
+
224
+ I'm not sure how happy CERN IT will be happy about this approach. So please be carefull while doing it. Deal with this session cookie as a secret and don't share it with anyone.
225
+
226
+ ### Future Authentication
227
+
228
+ We are working on implementing proper authentication through:
229
+ - CERN Single Sign-On (SSO) integration
230
+ - OAuth/SAML authentication flows
231
+ - Automatic session management
232
+
233
+
234
+ ## Tools
235
+
236
+ 1. **`search_cds_documents`** — Search CDS with various filters
237
+ 2. **`get_cds_document_details`** — Get detailed information about a specific document
238
+ 3. **`get_cds_document_files`** — Get file information and download URLs
239
+ 4. **`get_cds_experiments`** — List available CERN experiments for filtering
240
+ 5. **`get_cds_document_types`** — List available document types for filtering
241
+
242
+ ## Development
243
+
244
+ ```bash
245
+ git clone https://github.com/MohamedElashri/cds-mcp
246
+ cd cds-mcp
247
+ uv sync
248
+ uv run python test_integration.py # Test real CDS API integration
249
+ uv run python test_mcp_server.py # Test MCP server functionality
250
+ ```
251
+
252
+ ## License
253
+
254
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,5 @@
1
+ """CDS MCP Server - Model Context Protocol server for CERN Document Server."""
2
+
3
+ __version__ = "0.1.0"
4
+ __author__ = "Mohamed Elashri"
5
+ __email__ = "mohamed.elashri@cern.ch"