@thenextgennexus/academic-research-mcp-server 1.0.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/README.md +73 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +187 -0
- package/package.json +40 -0
- package/smithery.yaml +13 -0
- package/src/index.ts +220 -0
- package/tsconfig.json +16 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Academic Research MCP Server
|
|
2
|
+
|
|
3
|
+
Search arXiv, Google Scholar, and Wikipedia for academic papers and knowledge — powered by [nexgendata](https://apify.com/nexgendata) on Apify.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Using npx (recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @nexgendata/academic-research-mcp-server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Install globally
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @nexgendata/academic-research-mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configure with Claude Desktop
|
|
20
|
+
|
|
21
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"academic-research-mcp-server": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": [
|
|
29
|
+
"-y",
|
|
30
|
+
"@nexgendata/academic-research-mcp-server"
|
|
31
|
+
],
|
|
32
|
+
"env": {
|
|
33
|
+
"APIFY_TOKEN": "your-apify-token-optional"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Configure with Cline
|
|
41
|
+
|
|
42
|
+
Add the same configuration to your Cline MCP settings.
|
|
43
|
+
|
|
44
|
+
## Available Tools
|
|
45
|
+
|
|
46
|
+
| Tool | Description |
|
|
47
|
+
|------|-------------|
|
|
48
|
+
| `search_arxiv` | Search arXiv for academic papers |
|
|
49
|
+
| `search_google_scholar` | Search Google Scholar for academic papers |
|
|
50
|
+
| `search_wikipedia` | Search Wikipedia for articles |
|
|
51
|
+
| `get_paper_metadata` | Get detailed metadata for an academic paper |
|
|
52
|
+
| `get_citation_metrics` | Get citation metrics for a paper or author |
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Environment Variables
|
|
56
|
+
|
|
57
|
+
| Variable | Required | Description |
|
|
58
|
+
|----------|----------|-------------|
|
|
59
|
+
| `APIFY_TOKEN` | No | Your Apify API token for authenticated access. Without it, the server uses the public endpoint (rate-limited). |
|
|
60
|
+
|
|
61
|
+
## How It Works
|
|
62
|
+
|
|
63
|
+
This MCP server acts as a local stdio bridge to the [nexgendata Apify MCP endpoint](https://nexgendata--academic-research-mcp-server.apify.actor/mcp). When you call a tool, it forwards the request to Apify and returns the results.
|
|
64
|
+
|
|
65
|
+
## Links
|
|
66
|
+
|
|
67
|
+
- [Apify Store](https://apify.com/nexgendata/academic-research-mcp-server)
|
|
68
|
+
- [GitHub Repository](https://github.com/TheNextGenNexus/web-intelligence-mcp-servers)
|
|
69
|
+
- [nexgendata Blog](https://thenextgennexus.com)
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const APIFY_ENDPOINT = "https://nexgendata--academic-research-mcp-server.apify.actor/mcp";
|
|
6
|
+
const APIFY_TOKEN = process.env.APIFY_TOKEN || "";
|
|
7
|
+
async function callApifyTool(toolName, args) {
|
|
8
|
+
const url = new URL(APIFY_ENDPOINT);
|
|
9
|
+
if (APIFY_TOKEN) {
|
|
10
|
+
url.searchParams.set("token", APIFY_TOKEN);
|
|
11
|
+
}
|
|
12
|
+
const body = {
|
|
13
|
+
jsonrpc: "2.0",
|
|
14
|
+
id: 1,
|
|
15
|
+
method: "tools/call",
|
|
16
|
+
params: {
|
|
17
|
+
name: toolName,
|
|
18
|
+
arguments: args
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const response = await fetch(url.toString(), {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: { "Content-Type": "application/json" },
|
|
24
|
+
body: JSON.stringify(body)
|
|
25
|
+
});
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
const errorText = await response.text();
|
|
28
|
+
throw new Error(`Apify API error (${response.status}): ${errorText}`);
|
|
29
|
+
}
|
|
30
|
+
const data = await response.json();
|
|
31
|
+
if (data.error) {
|
|
32
|
+
throw new Error(`Tool error: ${JSON.stringify(data.error)}`);
|
|
33
|
+
}
|
|
34
|
+
// Extract text content from MCP response
|
|
35
|
+
const result = data.result;
|
|
36
|
+
if (result?.content && Array.isArray(result.content)) {
|
|
37
|
+
return result.content
|
|
38
|
+
.filter((c) => c.type === "text")
|
|
39
|
+
.map((c) => c.text)
|
|
40
|
+
.join("\n");
|
|
41
|
+
}
|
|
42
|
+
return JSON.stringify(data.result, null, 2);
|
|
43
|
+
}
|
|
44
|
+
const server = new McpServer({
|
|
45
|
+
name: "academic-research-mcp-server",
|
|
46
|
+
version: "1.0.0"
|
|
47
|
+
});
|
|
48
|
+
server.registerTool("search_arxiv", {
|
|
49
|
+
title: "Search Arxiv",
|
|
50
|
+
description: "Search arXiv papers",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
query: z.string().describe('Search query'),
|
|
53
|
+
maxItems: z.number().default(10).describe('Maximum papers')
|
|
54
|
+
},
|
|
55
|
+
annotations: {
|
|
56
|
+
readOnlyHint: true,
|
|
57
|
+
destructiveHint: false,
|
|
58
|
+
openWorldHint: true
|
|
59
|
+
}
|
|
60
|
+
}, async (args) => {
|
|
61
|
+
try {
|
|
62
|
+
const result = await callApifyTool("search_arxiv", args);
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: "text", text: result }]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
return {
|
|
70
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
71
|
+
isError: true
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
server.registerTool("search_google_scholar", {
|
|
76
|
+
title: "Search Google Scholar",
|
|
77
|
+
description: "Search Google Scholar",
|
|
78
|
+
inputSchema: {
|
|
79
|
+
query: z.string().describe('Search query'),
|
|
80
|
+
maxItems: z.number().default(10).describe('Maximum results')
|
|
81
|
+
},
|
|
82
|
+
annotations: {
|
|
83
|
+
readOnlyHint: true,
|
|
84
|
+
destructiveHint: false,
|
|
85
|
+
openWorldHint: true
|
|
86
|
+
}
|
|
87
|
+
}, async (args) => {
|
|
88
|
+
try {
|
|
89
|
+
const result = await callApifyTool("search_google_scholar", args);
|
|
90
|
+
return {
|
|
91
|
+
content: [{ type: "text", text: result }]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
96
|
+
return {
|
|
97
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
98
|
+
isError: true
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
server.registerTool("search_wikipedia", {
|
|
103
|
+
title: "Search Wikipedia",
|
|
104
|
+
description: "Search Wikipedia articles",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
query: z.string().describe('Search query'),
|
|
107
|
+
maxItems: z.number().default(5).describe('Maximum articles')
|
|
108
|
+
},
|
|
109
|
+
annotations: {
|
|
110
|
+
readOnlyHint: true,
|
|
111
|
+
destructiveHint: false,
|
|
112
|
+
openWorldHint: true
|
|
113
|
+
}
|
|
114
|
+
}, async (args) => {
|
|
115
|
+
try {
|
|
116
|
+
const result = await callApifyTool("search_wikipedia", args);
|
|
117
|
+
return {
|
|
118
|
+
content: [{ type: "text", text: result }]
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
125
|
+
isError: true
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
server.registerTool("get_paper_metadata", {
|
|
130
|
+
title: "Get Paper Metadata",
|
|
131
|
+
description: "Get paper metadata",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
paperUrl: z.string().describe('URL or DOI of the paper')
|
|
134
|
+
},
|
|
135
|
+
annotations: {
|
|
136
|
+
readOnlyHint: true,
|
|
137
|
+
destructiveHint: false,
|
|
138
|
+
openWorldHint: true
|
|
139
|
+
}
|
|
140
|
+
}, async (args) => {
|
|
141
|
+
try {
|
|
142
|
+
const result = await callApifyTool("get_paper_metadata", args);
|
|
143
|
+
return {
|
|
144
|
+
content: [{ type: "text", text: result }]
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
149
|
+
return {
|
|
150
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
151
|
+
isError: true
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
server.registerTool("get_citation_metrics", {
|
|
156
|
+
title: "Get Citation Metrics",
|
|
157
|
+
description: "Get citation metrics",
|
|
158
|
+
inputSchema: {
|
|
159
|
+
query: z.string().describe('Paper title or author'),
|
|
160
|
+
maxItems: z.number().default(10).describe('Maximum results')
|
|
161
|
+
},
|
|
162
|
+
annotations: {
|
|
163
|
+
readOnlyHint: true,
|
|
164
|
+
destructiveHint: false,
|
|
165
|
+
openWorldHint: true
|
|
166
|
+
}
|
|
167
|
+
}, async (args) => {
|
|
168
|
+
try {
|
|
169
|
+
const result = await callApifyTool("get_citation_metrics", args);
|
|
170
|
+
return {
|
|
171
|
+
content: [{ type: "text", text: result }]
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
176
|
+
return {
|
|
177
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
178
|
+
isError: true
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
async function main() {
|
|
183
|
+
const transport = new StdioServerTransport();
|
|
184
|
+
await server.connect(transport);
|
|
185
|
+
console.error("Academic Research MCP Server running on stdio");
|
|
186
|
+
}
|
|
187
|
+
main().catch(console.error);
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thenextgennexus/academic-research-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Search arXiv, Google Scholar, and Wikipedia for academic papers and knowledge",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"academic-research-mcp-server": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"start": "node dist/index.js",
|
|
12
|
+
"dev": "tsx src/index.ts"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
16
|
+
"zod": "^3.22.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^5.3.0",
|
|
20
|
+
"tsx": "^4.7.0",
|
|
21
|
+
"@types/node": "^20.11.0"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mcp",
|
|
28
|
+
"model-context-protocol",
|
|
29
|
+
"ai",
|
|
30
|
+
"apify",
|
|
31
|
+
"nexgendata"
|
|
32
|
+
],
|
|
33
|
+
"author": "nexgendata",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/TheNextGenNexus/web-intelligence-mcp-servers"
|
|
38
|
+
},
|
|
39
|
+
"mcpName": "io.github.thenextgennexus/academic-research-mcp-server"
|
|
40
|
+
}
|
package/smithery.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
startCommand:
|
|
2
|
+
type: stdio
|
|
3
|
+
configSchema:
|
|
4
|
+
type: object
|
|
5
|
+
required:
|
|
6
|
+
- apifyToken
|
|
7
|
+
properties:
|
|
8
|
+
apifyToken:
|
|
9
|
+
type: string
|
|
10
|
+
description: Your Apify API token. Get one free at https://apify.com
|
|
11
|
+
commandFunction:
|
|
12
|
+
|-
|
|
13
|
+
(config) => ({{ command: 'npx', args: ['tsx', 'src/index.ts'], env: {{ APIFY_TOKEN: config.apifyToken }} }})
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
const APIFY_ENDPOINT = "https://nexgendata--academic-research-mcp-server.apify.actor/mcp";
|
|
7
|
+
const APIFY_TOKEN = process.env.APIFY_TOKEN || "";
|
|
8
|
+
|
|
9
|
+
async function callApifyTool(toolName: string, args: Record<string, unknown>): Promise<string> {
|
|
10
|
+
const url = new URL(APIFY_ENDPOINT);
|
|
11
|
+
if (APIFY_TOKEN) {
|
|
12
|
+
url.searchParams.set("token", APIFY_TOKEN);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const body = {
|
|
16
|
+
jsonrpc: "2.0",
|
|
17
|
+
id: 1,
|
|
18
|
+
method: "tools/call",
|
|
19
|
+
params: {
|
|
20
|
+
name: toolName,
|
|
21
|
+
arguments: args
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const response = await fetch(url.toString(), {
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers: { "Content-Type": "application/json" },
|
|
28
|
+
body: JSON.stringify(body)
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const errorText = await response.text();
|
|
33
|
+
throw new Error(`Apify API error (${response.status}): ${errorText}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const data = await response.json();
|
|
37
|
+
|
|
38
|
+
if (data.error) {
|
|
39
|
+
throw new Error(`Tool error: ${JSON.stringify(data.error)}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Extract text content from MCP response
|
|
43
|
+
const result = data.result;
|
|
44
|
+
if (result?.content && Array.isArray(result.content)) {
|
|
45
|
+
return result.content
|
|
46
|
+
.filter((c: { type: string }) => c.type === "text")
|
|
47
|
+
.map((c: { text: string }) => c.text)
|
|
48
|
+
.join("\n");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return JSON.stringify(data.result, null, 2);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const server = new McpServer({
|
|
55
|
+
name: "academic-research-mcp-server",
|
|
56
|
+
version: "1.0.0"
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
server.registerTool(
|
|
60
|
+
"search_arxiv",
|
|
61
|
+
{
|
|
62
|
+
title: "Search Arxiv",
|
|
63
|
+
description: "Search arXiv papers",
|
|
64
|
+
inputSchema: {
|
|
65
|
+
query: z.string().describe('Search query'),
|
|
66
|
+
maxItems: z.number().default(10).describe('Maximum papers')
|
|
67
|
+
},
|
|
68
|
+
annotations: {
|
|
69
|
+
readOnlyHint: true,
|
|
70
|
+
destructiveHint: false,
|
|
71
|
+
openWorldHint: true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
async (args) => {
|
|
75
|
+
try {
|
|
76
|
+
const result = await callApifyTool("search_arxiv", args);
|
|
77
|
+
return {
|
|
78
|
+
content: [{ type: "text", text: result }]
|
|
79
|
+
};
|
|
80
|
+
} catch (error) {
|
|
81
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
82
|
+
return {
|
|
83
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
84
|
+
isError: true
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
server.registerTool(
|
|
91
|
+
"search_google_scholar",
|
|
92
|
+
{
|
|
93
|
+
title: "Search Google Scholar",
|
|
94
|
+
description: "Search Google Scholar",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
query: z.string().describe('Search query'),
|
|
97
|
+
maxItems: z.number().default(10).describe('Maximum results')
|
|
98
|
+
},
|
|
99
|
+
annotations: {
|
|
100
|
+
readOnlyHint: true,
|
|
101
|
+
destructiveHint: false,
|
|
102
|
+
openWorldHint: true
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
async (args) => {
|
|
106
|
+
try {
|
|
107
|
+
const result = await callApifyTool("search_google_scholar", args);
|
|
108
|
+
return {
|
|
109
|
+
content: [{ type: "text", text: result }]
|
|
110
|
+
};
|
|
111
|
+
} catch (error) {
|
|
112
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
113
|
+
return {
|
|
114
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
115
|
+
isError: true
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
server.registerTool(
|
|
122
|
+
"search_wikipedia",
|
|
123
|
+
{
|
|
124
|
+
title: "Search Wikipedia",
|
|
125
|
+
description: "Search Wikipedia articles",
|
|
126
|
+
inputSchema: {
|
|
127
|
+
query: z.string().describe('Search query'),
|
|
128
|
+
maxItems: z.number().default(5).describe('Maximum articles')
|
|
129
|
+
},
|
|
130
|
+
annotations: {
|
|
131
|
+
readOnlyHint: true,
|
|
132
|
+
destructiveHint: false,
|
|
133
|
+
openWorldHint: true
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
async (args) => {
|
|
137
|
+
try {
|
|
138
|
+
const result = await callApifyTool("search_wikipedia", args);
|
|
139
|
+
return {
|
|
140
|
+
content: [{ type: "text", text: result }]
|
|
141
|
+
};
|
|
142
|
+
} catch (error) {
|
|
143
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
144
|
+
return {
|
|
145
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
146
|
+
isError: true
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
server.registerTool(
|
|
153
|
+
"get_paper_metadata",
|
|
154
|
+
{
|
|
155
|
+
title: "Get Paper Metadata",
|
|
156
|
+
description: "Get paper metadata",
|
|
157
|
+
inputSchema: {
|
|
158
|
+
paperUrl: z.string().describe('URL or DOI of the paper')
|
|
159
|
+
},
|
|
160
|
+
annotations: {
|
|
161
|
+
readOnlyHint: true,
|
|
162
|
+
destructiveHint: false,
|
|
163
|
+
openWorldHint: true
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
async (args) => {
|
|
167
|
+
try {
|
|
168
|
+
const result = await callApifyTool("get_paper_metadata", args);
|
|
169
|
+
return {
|
|
170
|
+
content: [{ type: "text", text: result }]
|
|
171
|
+
};
|
|
172
|
+
} catch (error) {
|
|
173
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
174
|
+
return {
|
|
175
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
176
|
+
isError: true
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
server.registerTool(
|
|
183
|
+
"get_citation_metrics",
|
|
184
|
+
{
|
|
185
|
+
title: "Get Citation Metrics",
|
|
186
|
+
description: "Get citation metrics",
|
|
187
|
+
inputSchema: {
|
|
188
|
+
query: z.string().describe('Paper title or author'),
|
|
189
|
+
maxItems: z.number().default(10).describe('Maximum results')
|
|
190
|
+
},
|
|
191
|
+
annotations: {
|
|
192
|
+
readOnlyHint: true,
|
|
193
|
+
destructiveHint: false,
|
|
194
|
+
openWorldHint: true
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
async (args) => {
|
|
198
|
+
try {
|
|
199
|
+
const result = await callApifyTool("get_citation_metrics", args);
|
|
200
|
+
return {
|
|
201
|
+
content: [{ type: "text", text: result }]
|
|
202
|
+
};
|
|
203
|
+
} catch (error) {
|
|
204
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
205
|
+
return {
|
|
206
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
207
|
+
isError: true
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
async function main() {
|
|
215
|
+
const transport = new StdioServerTransport();
|
|
216
|
+
await server.connect(transport);
|
|
217
|
+
console.error("Academic Research MCP Server running on stdio");
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
main().catch(console.error);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": [
|
|
14
|
+
"src/**/*"
|
|
15
|
+
]
|
|
16
|
+
}
|