@cyanheads/pubmed-mcp-server 1.0.13 → 1.0.14
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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.typescriptlang.org/)
|
|
4
4
|
[](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
5
5
|
[](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-03-26/changelog.mdx)
|
|
6
|
-
[](./CHANGELOG.md)
|
|
7
7
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
8
8
|
[](https://github.com/cyanheads/pubmed-mcp-server/issues)
|
|
9
9
|
[](https://github.com/cyanheads/pubmed-mcp-server)
|
|
@@ -6,71 +6,73 @@ import { logger, requestContextService, sanitizeInputForLogging, } from "../../.
|
|
|
6
6
|
export const GeneratePubMedChartInputSchema = z.object({
|
|
7
7
|
chartType: z
|
|
8
8
|
.enum(["bar", "line", "scatter"])
|
|
9
|
-
.describe("
|
|
10
|
-
title: z
|
|
9
|
+
.describe("Required. Specifies the type of chart to generate. Options: 'bar', 'line', 'scatter'."),
|
|
10
|
+
title: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Optional. The main title displayed above the chart. If omitted, no title is shown."),
|
|
11
14
|
width: z
|
|
12
15
|
.number()
|
|
13
16
|
.int()
|
|
14
17
|
.positive()
|
|
15
18
|
.optional()
|
|
16
19
|
.default(400)
|
|
17
|
-
.describe("
|
|
20
|
+
.describe("Optional. The width of the chart canvas in pixels. Must be a positive integer. Default: 400."),
|
|
18
21
|
height: z
|
|
19
22
|
.number()
|
|
20
23
|
.int()
|
|
21
24
|
.positive()
|
|
22
25
|
.optional()
|
|
23
26
|
.default(300)
|
|
24
|
-
.describe("
|
|
27
|
+
.describe("Optional. The height of the chart canvas in pixels. Must be a positive integer. Default: 300."),
|
|
25
28
|
dataValues: z
|
|
26
29
|
.array(z.record(z.string(), z.any()))
|
|
27
30
|
.min(1)
|
|
28
|
-
.describe("
|
|
31
|
+
.describe("Required. An array of data objects used to plot the chart. Each object represents a data point or bar, structured as key-value pairs (e.g., [{ 'year': '2020', 'articles': 150 }, { 'year': '2021', 'articles': 180 }]). Must contain at least one data object."),
|
|
29
32
|
outputFormat: z
|
|
30
33
|
.enum(["svg"])
|
|
31
34
|
.default("svg")
|
|
32
|
-
.describe("Specifies the
|
|
33
|
-
"Currently, only 'svg' (Scalable Vector Graphics) is supported."),
|
|
35
|
+
.describe("Specifies the output format for the chart. Currently, only 'svg' (Scalable Vector Graphics) is supported and is the default."),
|
|
34
36
|
xField: z
|
|
35
37
|
.string()
|
|
36
|
-
.describe("
|
|
38
|
+
.describe("Required. The name of the field in `dataValues` to be used for the X-axis (horizontal). This field determines the categories or values along the bottom of the chart (e.g., 'year', 'geneName', 'publicationCount')."),
|
|
37
39
|
yField: z
|
|
38
40
|
.string()
|
|
39
|
-
.describe("
|
|
41
|
+
.describe("Required. The name of the field in `dataValues` to be used for the Y-axis (vertical). This field determines the values plotted upwards on the chart (e.g., 'articles', 'expressionLevel', 'citationCount')."),
|
|
40
42
|
xFieldType: z
|
|
41
43
|
.enum(["nominal", "ordinal", "quantitative", "temporal"])
|
|
42
44
|
.optional()
|
|
43
|
-
.describe("
|
|
45
|
+
.describe("Optional. Specifies the data type of the X-axis field. Options: 'nominal' (categories), 'ordinal' (ordered categories), 'quantitative' (numerical), 'temporal' (dates/times). If omitted, a suitable default is chosen based on `chartType` (e.g., 'nominal' for bar charts, 'temporal' for line charts, 'quantitative' for scatter plots)."),
|
|
44
46
|
yFieldType: z
|
|
45
47
|
.enum(["nominal", "ordinal", "quantitative", "temporal"])
|
|
46
48
|
.optional()
|
|
47
|
-
.describe("
|
|
49
|
+
.describe("Optional. Specifies the data type of the Y-axis field. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'quantitative' if omitted."),
|
|
48
50
|
// Optional fields for various chart types
|
|
49
51
|
colorField: z
|
|
50
52
|
.string()
|
|
51
53
|
.optional()
|
|
52
|
-
.describe("Optional
|
|
54
|
+
.describe("Optional. The name of the field in `dataValues` to use for color encoding. This can differentiate bars, lines, or points by color based on the values in this field (e.g., 'studyType', 'country')."),
|
|
53
55
|
colorFieldType: z
|
|
54
56
|
.enum(["nominal", "ordinal", "quantitative", "temporal"])
|
|
55
57
|
.optional()
|
|
56
|
-
.describe("
|
|
58
|
+
.describe("Optional. Specifies the data type of the `colorField`. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'nominal' if `colorField` is provided and this is omitted."),
|
|
57
59
|
seriesField: z
|
|
58
60
|
.string()
|
|
59
61
|
.optional()
|
|
60
|
-
.describe("Optional
|
|
62
|
+
.describe("Optional. Primarily for line charts. The name of the field in `dataValues` used to create multiple distinct lines (series) on the same chart. Each unique value in this field will correspond to a separate line (e.g., 'drugName' to plot different drug efficacy trends). Often used with `colorField` implicitly or explicitly."),
|
|
61
63
|
seriesFieldType: z
|
|
62
64
|
.enum(["nominal", "ordinal", "quantitative", "temporal"])
|
|
63
65
|
.optional()
|
|
64
|
-
.describe("
|
|
66
|
+
.describe("Optional. Specifies the data type of the `seriesField`. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'nominal' if `seriesField` is provided and this is omitted."),
|
|
65
67
|
// Scatter plot specific optional fields (can be expanded)
|
|
66
68
|
sizeField: z
|
|
67
69
|
.string()
|
|
68
70
|
.optional()
|
|
69
|
-
.describe("Optional field for encoding
|
|
71
|
+
.describe("Optional. For scatter plots. The name of the field in `dataValues` to use for encoding the size of the points. Larger values in this field will result in larger points on the scatter plot (e.g., 'sampleSize', 'effectMagnitude')."),
|
|
70
72
|
sizeFieldType: z
|
|
71
73
|
.enum(["quantitative", "ordinal"])
|
|
72
74
|
.optional()
|
|
73
|
-
.describe("
|
|
75
|
+
.describe("Optional. Specifies the data type of the `sizeField`. Options: 'quantitative', 'ordinal'. Defaults to 'quantitative' if `sizeField` is provided and this is omitted."),
|
|
74
76
|
// shapeField: z.string().optional().describe("Optional field for encoding point shape in scatter plots."), // Future enhancement
|
|
75
77
|
// shapeFieldType: z.enum(["nominal", "ordinal"]).optional().describe("Type of the shape field."), // Future enhancement
|
|
76
78
|
});
|
|
@@ -5,10 +5,11 @@ export function registerGeneratePubMedChartTool(server) {
|
|
|
5
5
|
const operation = "registerGeneratePubMedChartTool";
|
|
6
6
|
const regContext = requestContextService.createRequestContext({ operation });
|
|
7
7
|
try {
|
|
8
|
-
server.tool("generate_pubmed_chart", "Generates a chart
|
|
9
|
-
"Supports
|
|
10
|
-
"
|
|
11
|
-
"
|
|
8
|
+
server.tool("generate_pubmed_chart", "Generates a customizable chart (SVG) from structured data. " +
|
|
9
|
+
"Supports 'bar', 'line', and 'scatter' plots. " +
|
|
10
|
+
"Requires data values and field mappings for axes. " +
|
|
11
|
+
"Optional parameters allow for titles, dimensions, and color/size/series encoding. " +
|
|
12
|
+
"Internally uses Vega-Lite to produce an SVG image.", GeneratePubMedChartInputSchema.shape, async (validatedInput, mcpProvidedContext) => {
|
|
12
13
|
const handlerRequestContext = requestContextService.createRequestContext({
|
|
13
14
|
parentRequestId: regContext.requestId,
|
|
14
15
|
operation: "generatePubMedChartToolHandler",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/pubmed-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "A Model Context Protocol (MCP) server enabling AI agents to intelligently search, retrieve, and analyze biomedical literature from PubMed via NCBI E-utilities. Built on the mcp-ts-template for robust, production-ready performance.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|