scholar-sidekick-mcp 0.3.4 → 0.4.0
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.
- package/dist/mcp-server.mjs +52 -6
- package/package.json +1 -1
package/dist/mcp-server.mjs
CHANGED
|
@@ -30087,6 +30087,22 @@ function errorResult(result) {
|
|
|
30087
30087
|
isError: true
|
|
30088
30088
|
};
|
|
30089
30089
|
}
|
|
30090
|
+
var MISSING_KEY_MESSAGE = [
|
|
30091
|
+
"Scholar Sidekick is not configured. Set the RAPIDAPI_KEY environment variable to use this tool.",
|
|
30092
|
+
"",
|
|
30093
|
+
"Get a free key:",
|
|
30094
|
+
" 1. Sign up at https://rapidapi.com/scholar-sidekick-scholar-sidekick-api/api/scholar-sidekick",
|
|
30095
|
+
" 2. Subscribe to the free tier and copy your RapidAPI key",
|
|
30096
|
+
" 3. Restart this MCP server with RAPIDAPI_KEY set",
|
|
30097
|
+
"",
|
|
30098
|
+
"If you installed via Claude Desktop, open the Scholar Sidekick extension settings and paste the key there."
|
|
30099
|
+
].join("\n");
|
|
30100
|
+
function missingKeyResult() {
|
|
30101
|
+
return {
|
|
30102
|
+
content: [{ type: "text", text: MISSING_KEY_MESSAGE }],
|
|
30103
|
+
isError: true
|
|
30104
|
+
};
|
|
30105
|
+
}
|
|
30090
30106
|
function buildMetadata(result) {
|
|
30091
30107
|
const meta3 = {};
|
|
30092
30108
|
if (result.requestId) meta3.requestId = result.requestId;
|
|
@@ -30108,6 +30124,7 @@ function registerExportTool(server, config2) {
|
|
|
30108
30124
|
inputSchema: ExportCitationInput
|
|
30109
30125
|
},
|
|
30110
30126
|
async (input) => {
|
|
30127
|
+
if (!config2.rapidApiKey) return missingKeyResult();
|
|
30111
30128
|
const result = await exportCitation(config2, {
|
|
30112
30129
|
text: normalizeIdentifiers(input.text),
|
|
30113
30130
|
format: input.format,
|
|
@@ -30134,6 +30151,7 @@ function registerFormatTool(server, config2) {
|
|
|
30134
30151
|
inputSchema: FormatCitationInput
|
|
30135
30152
|
},
|
|
30136
30153
|
async (input) => {
|
|
30154
|
+
if (!config2.rapidApiKey) return missingKeyResult();
|
|
30137
30155
|
const result = await formatCitation(config2, {
|
|
30138
30156
|
text: normalizeIdentifiers(input.text),
|
|
30139
30157
|
style: input.style ?? void 0,
|
|
@@ -30170,6 +30188,7 @@ function registerResolveTool(server, config2) {
|
|
|
30170
30188
|
inputSchema: ResolveIdentifierInput
|
|
30171
30189
|
},
|
|
30172
30190
|
async (input) => {
|
|
30191
|
+
if (!config2.rapidApiKey) return missingKeyResult();
|
|
30173
30192
|
const result = await formatCitation(config2, {
|
|
30174
30193
|
text: normalizeIdentifiers(input.text),
|
|
30175
30194
|
output: "json"
|
|
@@ -30194,13 +30213,34 @@ function registerResolveTool(server, config2) {
|
|
|
30194
30213
|
|
|
30195
30214
|
// src/server.ts
|
|
30196
30215
|
var SERVER_NAME = "scholar-sidekick";
|
|
30197
|
-
var SERVER_VERSION = "0.
|
|
30216
|
+
var SERVER_VERSION = "0.4.0";
|
|
30217
|
+
var SERVER_INSTRUCTIONS = `Scholar Sidekick MCP turns academic identifiers into clean citations.
|
|
30218
|
+
|
|
30219
|
+
When to use this server:
|
|
30220
|
+
- The user mentions a bibliographic identifier \u2014 DOI, PMID, PMCID, ISBN, arXiv ID, ISSN, or ADS bibcode
|
|
30221
|
+
- The user asks to format references in a citation style (Vancouver, APA, AMA, IEEE, Chicago, Harvard, MLA, Nature, BMJ, Lancet, or any of 10,000+ CSL styles)
|
|
30222
|
+
- The user asks to export a bibliography to BibTeX, RIS, EndNote, RefWorks, MEDLINE, Zotero RDF, CSL JSON, or CSV
|
|
30223
|
+
|
|
30224
|
+
Tool selection:
|
|
30225
|
+
- resolveIdentifier \u2014 when the user wants raw structured metadata (returns CSL JSON: title, authors, journal, year, identifiers)
|
|
30226
|
+
- formatCitation \u2014 when the user wants a human-readable citation in a specific style (returns text, HTML, or JSON)
|
|
30227
|
+
- exportCitation \u2014 when the user wants a downloadable bibliography file (returns the file contents as a string)
|
|
30228
|
+
|
|
30229
|
+
Tips:
|
|
30230
|
+
- All tools accept multiple identifiers separated by newlines or commas \u2014 batch when possible to save calls
|
|
30231
|
+
- Pass identifiers verbatim. The server tolerates DOI URLs (https://doi.org/...), "PMID:" / "PMC" prefixes, "arXiv:" prefixes, and ISBN hyphens
|
|
30232
|
+
- Default style for formatCitation is Vancouver. If the user does not name a style, ask before defaulting`;
|
|
30198
30233
|
function createMcpServer(config2) {
|
|
30199
30234
|
const cfg = config2 ?? createConfig();
|
|
30200
|
-
const server = new McpServer(
|
|
30201
|
-
|
|
30202
|
-
|
|
30203
|
-
|
|
30235
|
+
const server = new McpServer(
|
|
30236
|
+
{
|
|
30237
|
+
name: SERVER_NAME,
|
|
30238
|
+
version: SERVER_VERSION
|
|
30239
|
+
},
|
|
30240
|
+
{
|
|
30241
|
+
instructions: SERVER_INSTRUCTIONS
|
|
30242
|
+
}
|
|
30243
|
+
);
|
|
30204
30244
|
registerFormatTool(server, cfg);
|
|
30205
30245
|
registerExportTool(server, cfg);
|
|
30206
30246
|
registerResolveTool(server, cfg);
|
|
@@ -30230,7 +30270,13 @@ async function checkConnection(baseUrl) {
|
|
|
30230
30270
|
}
|
|
30231
30271
|
async function main() {
|
|
30232
30272
|
const config2 = createConfig();
|
|
30233
|
-
|
|
30273
|
+
if (config2.rapidApiKey) {
|
|
30274
|
+
await checkConnection(config2.baseUrl);
|
|
30275
|
+
} else {
|
|
30276
|
+
process.stderr.write(
|
|
30277
|
+
"Scholar Sidekick MCP started without RAPIDAPI_KEY \u2014 tools will return a configuration message until a key is set. Get one at https://rapidapi.com/scholar-sidekick-scholar-sidekick-api/api/scholar-sidekick\n"
|
|
30278
|
+
);
|
|
30279
|
+
}
|
|
30234
30280
|
const server = createMcpServer(config2);
|
|
30235
30281
|
const transport = new StdioServerTransport();
|
|
30236
30282
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scholar-sidekick-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"mcpName": "io.github.mlava/scholar-sidekick-mcp",
|
|
5
5
|
"description": "MCP server for Scholar Sidekick — resolve, format, and export academic citations from any AI assistant",
|
|
6
6
|
"license": "MIT",
|