paper-search-mcp-nodejs
Version:
A Node.js MCP server for searching and downloading academic papers from multiple sources, including arXiv, PubMed, bioRxiv, Web of Science, and more.
30 lines • 892 B
JavaScript
export function isMCPMode() {
return (process.argv.includes('--mcp') ||
process.env.MCP_SERVER === 'true' ||
// Fallback: when running under MCP via stdio, stdin is typically not a TTY.
// Do NOT treat CI as MCP to preserve warning/error logs in pipelines.
(process.stdin?.isTTY === false && process.env.CI !== 'true'));
}
export function logDebug(...args) {
if (isMCPMode())
return;
if (process.env.NODE_ENV === 'development' || process.env.CI === 'true') {
console.error(...args);
}
}
export function logInfo(...args) {
if (isMCPMode())
return;
console.error(...args);
}
export function logWarn(...args) {
if (isMCPMode())
return;
console.error(...args);
}
export function logError(...args) {
if (isMCPMode())
return;
console.error(...args);
}
//# sourceMappingURL=Logger.js.map