s2_mcp_server 1.0.0__py3-none-any.whl

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,476 @@
1
+ Metadata-Version: 2.4
2
+ Name: s2-mcp-server
3
+ Version: 1.0.0
4
+ Summary: MCP server for Semantic Scholar — 200M+ academic papers in Claude Desktop
5
+ Project-URL: Homepage, https://topologica.ai
6
+ Project-URL: Repository, https://github.com/smaniches/semantic-scholar-mcp
7
+ Project-URL: Issues, https://github.com/smaniches/semantic-scholar-mcp/issues
8
+ Project-URL: Changelog, https://github.com/smaniches/semantic-scholar-mcp/blob/main/CHANGELOG.md
9
+ Project-URL: Semantic Scholar API, https://www.semanticscholar.org/product/api
10
+ Author-email: Santiago Maniches <santiago@topologica.ai>
11
+ Maintainer-email: TOPOLOGICA LLC <support@topologica.ai>
12
+ License: MIT
13
+ License-File: LICENSE
14
+ Keywords: academic-research,claude,llm,mcp,model-context-protocol,python,research-tools,semantic-scholar
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Scientific/Engineering
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: httpx>=0.25.0
28
+ Requires-Dist: mcp<2,>=1.25.0
29
+ Requires-Dist: pydantic>=2.0.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: hypothesis>=6.0.0; extra == 'dev'
32
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
33
+ Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
34
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
35
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
36
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
37
+ Requires-Dist: respx>=0.20.0; extra == 'dev'
38
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # Semantic Scholar MCP Server
42
+
43
+ [![CI](https://github.com/smaniches/semantic-scholar-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/smaniches/semantic-scholar-mcp/actions/workflows/ci.yml)
44
+ [![codecov](https://codecov.io/gh/smaniches/semantic-scholar-mcp/graph/badge.svg)](https://codecov.io/gh/smaniches/semantic-scholar-mcp)
45
+ [![PyPI version](https://img.shields.io/pypi/v/s2-mcp-server)](https://pypi.org/project/s2-mcp-server/)
46
+ [![GitHub Release](https://img.shields.io/github/v/release/smaniches/semantic-scholar-mcp)](https://github.com/smaniches/semantic-scholar-mcp/releases)
47
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
48
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)
49
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
50
+
51
+ **The most comprehensive MCP server for academic research.** Direct access to 200M+ papers from [Semantic Scholar](https://www.semanticscholar.org/) within Claude Desktop.
52
+
53
+ ---
54
+
55
+ ## Installation
56
+
57
+ ### Option 1: One-Line Install (Recommended)
58
+ ```bash
59
+ # No cloning needed — runs directly from PyPI
60
+ uvx s2-mcp-server
61
+ ```
62
+
63
+ ### Option 2: Claude Code
64
+ ```bash
65
+ claude mcp add semantic-scholar -- uvx s2-mcp-server
66
+ ```
67
+
68
+ ### Option 3: Claude Desktop (Windows)
69
+
70
+ Add to `%APPDATA%\Claude\claude_desktop_config.json`:
71
+
72
+ ```json
73
+ {
74
+ "mcpServers": {
75
+ "semantic-scholar": {
76
+ "command": "uvx",
77
+ "args": ["s2-mcp-server"],
78
+ "env": {
79
+ "SEMANTIC_SCHOLAR_API_KEY": "your-key-here"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### Option 4: Claude Desktop (macOS)
87
+
88
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "semantic-scholar": {
94
+ "command": "uvx",
95
+ "args": ["s2-mcp-server"],
96
+ "env": {
97
+ "SEMANTIC_SCHOLAR_API_KEY": "your-key-here"
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ ### Option 5: pip / From Source
105
+ ```bash
106
+ pip install s2-mcp-server
107
+ # or
108
+ git clone https://github.com/smaniches/semantic-scholar-mcp.git
109
+ cd semantic-scholar-mcp && pip install -e .
110
+ ```
111
+
112
+ > **Note:** Get a free API key at [semanticscholar.org/product/api](https://www.semanticscholar.org/product/api). Without a key, you get rate-limited public access (1 req/sec).
113
+
114
+ ---
115
+
116
+ ## Configuration
117
+
118
+ ### API Key Options
119
+
120
+ You can provide your API key in two ways:
121
+
122
+ 1. **Environment Variable** (recommended for persistent use):
123
+ ```bash
124
+ export SEMANTIC_SCHOLAR_API_KEY="your-api-key-here"
125
+ ```
126
+
127
+ 2. **Per-Request Parameter** (overrides env var):
128
+ ```json
129
+ {
130
+ "api_key": "your-api-key-here"
131
+ }
132
+ ```
133
+
134
+ Get a free API key at: https://www.semanticscholar.org/product/api
135
+
136
+ ### Claude Desktop Setup
137
+
138
+ Add to your Claude Desktop config file:
139
+
140
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
141
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
142
+ **Linux:** `~/.config/Claude/claude_desktop_config.json`
143
+
144
+ ```json
145
+ {
146
+ "mcpServers": {
147
+ "semantic-scholar": {
148
+ "command": "python",
149
+ "args": ["-m", "semantic_scholar_mcp"],
150
+ "env": {
151
+ "SEMANTIC_SCHOLAR_API_KEY": "your-api-key-here"
152
+ }
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ Then **restart Claude Desktop**.
159
+
160
+ ---
161
+
162
+ ## Supported ID Formats
163
+
164
+ The server accepts the following paper identifier formats:
165
+
166
+ | Format | Pattern | Example |
167
+ |--------|---------|---------|
168
+ | Semantic Scholar ID | 40-character hex | `649def34f8be52c8b66281af98ae884c09aef38b` |
169
+ | DOI | `DOI:xxx` | `DOI:10.1038/s41586-021-03819-2` |
170
+ | ArXiv | `ARXIV:xxx` | `ARXIV:2106.15928` or `ARXIV:2106.15928v2` |
171
+ | PubMed | `PMID:xxx` | `PMID:32908142` |
172
+ | Corpus ID | `CorpusId:xxx` | `CorpusId:215416146` |
173
+ | ACL | `ACL:xxx` | `ACL:P19-1285` |
174
+ | URL | `URL:xxx` | `URL:https://arxiv.org/abs/2106.15928` |
175
+
176
+ ---
177
+
178
+ ## Tools Reference
179
+
180
+ ### 1. `semantic_scholar_search_papers`
181
+
182
+ Search for academic papers with advanced filters.
183
+
184
+ **Parameters:**
185
+ | Parameter | Type | Required | Description |
186
+ |-----------|------|----------|-------------|
187
+ | `query` | string | Yes | Search query (supports AND, OR, NOT operators and "phrase search") |
188
+ | `year` | string | No | Year filter: `"2024"`, `"2020-2024"`, or `"2020-"` |
189
+ | `fields_of_study` | string[] | No | Filter by fields: `["Computer Science", "Biology"]` |
190
+ | `publication_types` | string[] | No | Filter by type: `["Review", "JournalArticle"]` |
191
+ | `open_access_only` | boolean | No | Only return open access papers (default: false) |
192
+ | `min_citation_count` | integer | No | Minimum citation count |
193
+ | `limit` | integer | No | Max results 1-100 (default: 10) |
194
+ | `offset` | integer | No | Pagination offset (default: 0) |
195
+ | `response_format` | string | No | `"markdown"` or `"json"` (default: markdown) |
196
+ | `api_key` | string | No | Override environment API key |
197
+
198
+ **Example:**
199
+ ```
200
+ Search for "transformer attention mechanism" papers from 2023 with at least 100 citations
201
+ ```
202
+
203
+ **JSON Example:**
204
+ ```json
205
+ {
206
+ "query": "transformer attention mechanism",
207
+ "year": "2023",
208
+ "min_citation_count": 100,
209
+ "fields_of_study": ["Computer Science"],
210
+ "limit": 20
211
+ }
212
+ ```
213
+
214
+ ---
215
+
216
+ ### 2. `semantic_scholar_get_paper`
217
+
218
+ Get detailed information about a specific paper.
219
+
220
+ **Parameters:**
221
+ | Parameter | Type | Required | Description |
222
+ |-----------|------|----------|-------------|
223
+ | `paper_id` | string | Yes | Paper ID in any supported format |
224
+ | `include_citations` | boolean | No | Include citing papers (default: false) |
225
+ | `include_references` | boolean | No | Include referenced papers (default: false) |
226
+ | `citations_limit` | integer | No | Max citations to return 1-100 (default: 10) |
227
+ | `references_limit` | integer | No | Max references to return 1-100 (default: 10) |
228
+ | `response_format` | string | No | `"markdown"` or `"json"` (default: markdown) |
229
+ | `api_key` | string | No | Override environment API key |
230
+
231
+ **Example:**
232
+ ```
233
+ Get details for DOI:10.1038/s41586-021-03819-2 including its top 20 citations
234
+ ```
235
+
236
+ **JSON Example:**
237
+ ```json
238
+ {
239
+ "paper_id": "DOI:10.1038/s41586-021-03819-2",
240
+ "include_citations": true,
241
+ "citations_limit": 20
242
+ }
243
+ ```
244
+
245
+ ---
246
+
247
+ ### 3. `semantic_scholar_search_authors`
248
+
249
+ Search for academic authors by name.
250
+
251
+ **Parameters:**
252
+ | Parameter | Type | Required | Description |
253
+ |-----------|------|----------|-------------|
254
+ | `query` | string | Yes | Author name to search |
255
+ | `limit` | integer | No | Max results 1-100 (default: 10) |
256
+ | `offset` | integer | No | Pagination offset (default: 0) |
257
+ | `response_format` | string | No | `"markdown"` or `"json"` (default: markdown) |
258
+ | `api_key` | string | No | Override environment API key |
259
+
260
+ **Example:**
261
+ ```
262
+ Find author "Yoshua Bengio"
263
+ ```
264
+
265
+ **JSON Example:**
266
+ ```json
267
+ {
268
+ "query": "Yoshua Bengio",
269
+ "limit": 5
270
+ }
271
+ ```
272
+
273
+ ---
274
+
275
+ ### 4. `semantic_scholar_get_author`
276
+
277
+ Get author profile with publications.
278
+
279
+ **Parameters:**
280
+ | Parameter | Type | Required | Description |
281
+ |-----------|------|----------|-------------|
282
+ | `author_id` | string | Yes | Semantic Scholar author ID |
283
+ | `include_papers` | boolean | No | Include publications (default: true) |
284
+ | `papers_limit` | integer | No | Max papers to return 1-100 (default: 20) |
285
+ | `response_format` | string | No | `"markdown"` or `"json"` (default: markdown) |
286
+ | `api_key` | string | No | Override environment API key |
287
+
288
+ **Example:**
289
+ ```
290
+ Get author profile for author ID 1741101 with their top 50 publications
291
+ ```
292
+
293
+ **JSON Example:**
294
+ ```json
295
+ {
296
+ "author_id": "1741101",
297
+ "include_papers": true,
298
+ "papers_limit": 50
299
+ }
300
+ ```
301
+
302
+ ---
303
+
304
+ ### 5. `semantic_scholar_recommendations`
305
+
306
+ Get AI-powered paper recommendations based on a seed paper.
307
+
308
+ **Parameters:**
309
+ | Parameter | Type | Required | Description |
310
+ |-----------|------|----------|-------------|
311
+ | `paper_id` | string | Yes | Seed paper ID in any supported format |
312
+ | `limit` | integer | No | Max recommendations 1-100 (default: 10) |
313
+ | `response_format` | string | No | `"markdown"` or `"json"` (default: markdown) |
314
+ | `api_key` | string | No | Override environment API key |
315
+
316
+ **Example:**
317
+ ```
318
+ Get recommendations based on paper 649def34f8be52c8b66281af98ae884c09aef38b
319
+ ```
320
+
321
+ **JSON Example:**
322
+ ```json
323
+ {
324
+ "paper_id": "ARXIV:1706.03762",
325
+ "limit": 15
326
+ }
327
+ ```
328
+
329
+ ---
330
+
331
+ ### 6. `semantic_scholar_bulk_papers`
332
+
333
+ Retrieve multiple papers in a single request (max 500).
334
+
335
+ **Parameters:**
336
+ | Parameter | Type | Required | Description |
337
+ |-----------|------|----------|-------------|
338
+ | `paper_ids` | string[] | Yes | List of paper IDs (max 500) |
339
+ | `response_format` | string | No | `"markdown"` or `"json"` (default: json) |
340
+ | `api_key` | string | No | Override environment API key |
341
+
342
+ **Example:**
343
+ ```
344
+ Retrieve these papers: DOI:10.1038/nature12373, ARXIV:2106.15928, PMID:32908142
345
+ ```
346
+
347
+ **JSON Example:**
348
+ ```json
349
+ {
350
+ "paper_ids": [
351
+ "DOI:10.1038/nature12373",
352
+ "ARXIV:2106.15928",
353
+ "PMID:32908142"
354
+ ]
355
+ }
356
+ ```
357
+
358
+ ---
359
+
360
+ ### 7. `semantic_scholar_status`
361
+
362
+ Check server health and API connectivity status.
363
+
364
+ **Parameters:** None
365
+
366
+ **Example:**
367
+ ```
368
+ Check Semantic Scholar API status
369
+ ```
370
+
371
+ **Response:**
372
+ ```json
373
+ {
374
+ "server": "semantic-scholar-mcp",
375
+ "version": "1.0.0",
376
+ "api_key_configured": true,
377
+ "timestamp": "2025-01-15T12:00:00.000000+00:00",
378
+ "api_reachable": true
379
+ }
380
+ ```
381
+
382
+ ---
383
+
384
+ ## Rate Limits
385
+
386
+ | Tier | Requests/Second | How to Get |
387
+ |------|-----------------|------------|
388
+ | No API Key | 1 req/sec | Default |
389
+ | Free API Key | 1 req/sec | [Sign up](https://www.semanticscholar.org/product/api) |
390
+ | Academic Partner | 10-100 req/sec | Apply via S2 |
391
+
392
+ The server automatically handles rate limiting with:
393
+ - Request serialization to enforce minimum intervals
394
+ - Exponential backoff retry for 429 (rate limit) and 503 (service unavailable) errors
395
+ - Maximum 3 retries with jitter
396
+
397
+ ---
398
+
399
+ ## Architecture
400
+
401
+ ```
402
+ +-----------------+ +----------------------+ +-----------------+
403
+ | Claude Desktop |---->| semantic-scholar-mcp |---->| Semantic Scholar|
404
+ | (MCP Client) |<----| (This Server) |<----+ API |
405
+ +-----------------+ +----------------------+ +-----------------+
406
+ | | |
407
+ | stdio (JSON-RPC) | Your API Key | HTTPS
408
+ | Local process | Local machine | 200M+ papers
409
+ ```
410
+
411
+ **Your API key never leaves your machine.** The MCP server runs locally.
412
+
413
+ ---
414
+
415
+ ## Development
416
+
417
+ ```bash
418
+ # Clone
419
+ git clone https://github.com/smaniches/semantic-scholar-mcp.git
420
+ cd semantic-scholar-mcp
421
+
422
+ # Install dev dependencies
423
+ pip install -e ".[dev]"
424
+
425
+ # Run tests
426
+ pytest
427
+
428
+ # Run tests with coverage
429
+ pytest --cov=src/semantic_scholar_mcp --cov-report=term-missing
430
+
431
+ # Type checking
432
+ mypy src/
433
+ ```
434
+
435
+ ---
436
+
437
+ ## Security
438
+
439
+ API keys are never stored in code — environment variables only. See [SECURITY.md](.github/SECURITY.md) for vulnerability reporting. All API communication uses HTTPS.
440
+
441
+ ---
442
+
443
+ ## License
444
+
445
+ MIT License - see [LICENSE](LICENSE) file.
446
+
447
+ ---
448
+
449
+ ## Author
450
+
451
+ **Santiago Maniches**
452
+ - Founder & CEO, [TOPOLOGICA LLC](https://topologica.ai)
453
+ - ORCID: [0009-0005-6480-1987](https://orcid.org/0009-0005-6480-1987)
454
+ - LinkedIn: [santiago-maniches](https://www.linkedin.com/in/santiagomaniches/)
455
+ - Website: [topologica.ai](https://topologica.ai)
456
+
457
+ ---
458
+
459
+ ## Contributing
460
+
461
+ Contributions welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md).
462
+
463
+ ---
464
+
465
+ ## Support
466
+
467
+ - Issues: [GitHub Issues](https://github.com/smaniches/semantic-scholar-mcp/issues)
468
+ - Discussions: [GitHub Discussions](https://github.com/smaniches/semantic-scholar-mcp/discussions)
469
+ - Contact: santiago@topologica.ai
470
+
471
+ ---
472
+
473
+ <p align="center">
474
+ <b>Built by <a href="https://topologica.ai">TOPOLOGICA LLC</a></b><br>
475
+ <i>Advancing computational research through topological intelligence</i>
476
+ </p>
@@ -0,0 +1,9 @@
1
+ semantic_scholar_mcp/__init__.py,sha256=W636-5kdM-_hMbrCFuNZ_rQ2sMSdrJMSgr9VHT6lPHo,934
2
+ semantic_scholar_mcp/__main__.py,sha256=yHBntxuwGpoqMvEcgOXQqyen-OP49YWv-4qHWFCJPcg,248
3
+ semantic_scholar_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ semantic_scholar_mcp/server.py,sha256=wnHAVc8VrUaNKvuG0guzuvvj0b5fHW3x7A4t-nfCtB4,40074
5
+ s2_mcp_server-1.0.0.dist-info/METADATA,sha256=Lb56t2tjrT0y-S2q4Et6pFaNgAa9_1NUgM-mTFCznX4,13492
6
+ s2_mcp_server-1.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
7
+ s2_mcp_server-1.0.0.dist-info/entry_points.txt,sha256=PaJwx6ElHSAmTGqEoXmbxXhylm6uksnNCfv8WNwbd-s,67
8
+ s2_mcp_server-1.0.0.dist-info/licenses/LICENSE,sha256=qVrrCPTVNbhUJ7eh5mUX2LKX3HhQ1MoyBUCTEG0vXC0,1208
9
+ s2_mcp_server-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ semantic-scholar-mcp = semantic_scholar_mcp:main
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 TOPOLOGICA LLC
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.
22
+
23
+ ---
24
+
25
+ Author: Santiago Maniches
26
+ Organization: TOPOLOGICA LLC
27
+ Website: https://topologica.ai
28
+ ORCID: https://orcid.org/0009-0005-6480-1987
@@ -0,0 +1,43 @@
1
+ """
2
+ Semantic Scholar MCP Server
3
+ ===========================
4
+
5
+ MCP (Model Context Protocol) server for accessing Semantic Scholar's
6
+ academic paper database directly within Claude Desktop.
7
+
8
+ Author: Santiago Maniches (ORCID: 0009-0005-6480-1987)
9
+ Organization: TOPOLOGICA LLC (https://topologica.ai)
10
+ License: MIT
11
+
12
+ For documentation: https://github.com/smaniches/semantic-scholar-mcp
13
+ """
14
+
15
+ from .server import (
16
+ AuthenticationError,
17
+ NotFoundError,
18
+ RateLimitError,
19
+ SemanticScholarError,
20
+ ServerError,
21
+ ValidationError,
22
+ __version__,
23
+ main,
24
+ mcp,
25
+ )
26
+
27
+ __author__ = "Santiago Maniches"
28
+ __email__ = "santiago@topologica.ai"
29
+ __org__ = "TOPOLOGICA LLC"
30
+ __url__ = "https://topologica.ai"
31
+ __orcid__ = "0009-0005-6480-1987"
32
+
33
+ __all__ = [
34
+ "mcp",
35
+ "main",
36
+ "__version__",
37
+ "SemanticScholarError",
38
+ "AuthenticationError",
39
+ "RateLimitError",
40
+ "NotFoundError",
41
+ "ValidationError",
42
+ "ServerError",
43
+ ]
@@ -0,0 +1,11 @@
1
+ """
2
+ Entry point for running as module: python -m semantic_scholar_mcp
3
+
4
+ Author: Santiago Maniches (ORCID: 0009-0005-6480-1987)
5
+ Organization: TOPOLOGICA LLC (https://topologica.ai)
6
+ """
7
+
8
+ from .server import main
9
+
10
+ if __name__ == "__main__":
11
+ main()
File without changes