@daanrongen/grafana-mcp 1.1.0 → 1.2.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.
Files changed (2) hide show
  1. package/dist/main.js +116 -18
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -36769,7 +36769,7 @@ class AlertInstance extends exports_Schema.Class("AlertInstance")({
36769
36769
  class Folder extends exports_Schema.Class("Folder")({
36770
36770
  uid: exports_Schema.String,
36771
36771
  title: exports_Schema.String,
36772
- url: exports_Schema.String
36772
+ url: exports_Schema.optional(exports_Schema.String)
36773
36773
  }) {
36774
36774
  }
36775
36775
 
@@ -36841,7 +36841,7 @@ var AlertInstanceSchema = exports_Schema.Struct({
36841
36841
  var FolderSchema = exports_Schema.Struct({
36842
36842
  uid: exports_Schema.String,
36843
36843
  title: exports_Schema.String,
36844
- url: exports_Schema.String
36844
+ url: exports_Schema.optional(exports_Schema.String)
36845
36845
  });
36846
36846
  var AnnotationSchema = exports_Schema.Struct({
36847
36847
  id: exports_Schema.Number,
@@ -44647,17 +44647,35 @@ var runTool = async (runtime5, effect2) => {
44647
44647
 
44648
44648
  // src/mcp/tools/alerts.ts
44649
44649
  var registerAlertTools = (server, runtime5) => {
44650
- server.tool("list_alert_rules", "List all Grafana alert rules. Returns uid, title, condition, folder, rule group, and state settings.", {}, { title: "List Alert Rules", readOnlyHint: true, openWorldHint: true }, () => runTool(runtime5, exports_Effect.gen(function* () {
44650
+ server.tool("list_alert_rules", "List all Grafana alert rules. Returns uid, title, condition, folder, rule group, and state settings.", {}, {
44651
+ title: "List Alert Rules",
44652
+ readOnlyHint: true,
44653
+ destructiveHint: false,
44654
+ idempotentHint: true,
44655
+ openWorldHint: true
44656
+ }, () => runTool(runtime5, exports_Effect.gen(function* () {
44651
44657
  const client = yield* GrafanaClient;
44652
44658
  return yield* client.listAlertRules();
44653
44659
  })));
44654
44660
  server.tool("get_alert_rule", "Get a Grafana alert rule by UID.", {
44655
44661
  uid: exports_external.string().describe("Alert rule UID")
44656
- }, { title: "Get Alert Rule", readOnlyHint: true, openWorldHint: true }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44662
+ }, {
44663
+ title: "Get Alert Rule",
44664
+ readOnlyHint: true,
44665
+ destructiveHint: false,
44666
+ idempotentHint: true,
44667
+ openWorldHint: true
44668
+ }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44657
44669
  const client = yield* GrafanaClient;
44658
44670
  return yield* client.getAlertRule(uid);
44659
44671
  })));
44660
- server.tool("list_alert_instances", "List currently firing Grafana alert instances from Alertmanager. Returns labels, state, and activeAt.", {}, { title: "List Alert Instances", readOnlyHint: true, openWorldHint: true }, () => runTool(runtime5, exports_Effect.gen(function* () {
44672
+ server.tool("list_alert_instances", "List currently firing Grafana alert instances from Alertmanager. Returns labels, state, and activeAt.", {}, {
44673
+ title: "List Alert Instances",
44674
+ readOnlyHint: true,
44675
+ destructiveHint: false,
44676
+ idempotentHint: true,
44677
+ openWorldHint: true
44678
+ }, () => runTool(runtime5, exports_Effect.gen(function* () {
44661
44679
  const client = yield* GrafanaClient;
44662
44680
  return yield* client.listAlertInstances();
44663
44681
  })));
@@ -44668,7 +44686,13 @@ var registerAnnotationTools = (server, runtime5) => {
44668
44686
  server.tool("list_annotations", "List Grafana annotations, optionally filtered by dashboard UID.", {
44669
44687
  dashboardUid: exports_external.string().optional().describe("Filter annotations by dashboard UID"),
44670
44688
  limit: exports_external.number().optional().describe("Maximum number of results (default: 100)")
44671
- }, { title: "List Annotations", readOnlyHint: true, openWorldHint: true }, ({ dashboardUid, limit }) => runTool(runtime5, exports_Effect.gen(function* () {
44689
+ }, {
44690
+ title: "List Annotations",
44691
+ readOnlyHint: true,
44692
+ destructiveHint: false,
44693
+ idempotentHint: true,
44694
+ openWorldHint: true
44695
+ }, ({ dashboardUid, limit }) => runTool(runtime5, exports_Effect.gen(function* () {
44672
44696
  const client = yield* GrafanaClient;
44673
44697
  return yield* client.listAnnotations(dashboardUid, limit);
44674
44698
  })));
@@ -44682,6 +44706,7 @@ var registerAnnotationTools = (server, runtime5) => {
44682
44706
  title: "Create Annotation",
44683
44707
  readOnlyHint: false,
44684
44708
  destructiveHint: false,
44709
+ idempotentHint: false,
44685
44710
  openWorldHint: true
44686
44711
  }, ({ text, tags, dashboardUid, time: time3, timeEnd }) => runTool(runtime5, exports_Effect.gen(function* () {
44687
44712
  const client = yield* GrafanaClient;
@@ -44694,13 +44719,25 @@ var registerDashboardTools = (server, runtime5) => {
44694
44719
  server.tool("list_dashboards", "Search and list Grafana dashboards. Returns uid, title, url, folderTitle, and tags.", {
44695
44720
  query: exports_external.string().optional().describe("Search query to filter dashboards by title"),
44696
44721
  limit: exports_external.number().optional().describe("Maximum number of results (default: 100)")
44697
- }, { title: "List Dashboards", readOnlyHint: true, openWorldHint: true }, ({ query, limit }) => runTool(runtime5, exports_Effect.gen(function* () {
44722
+ }, {
44723
+ title: "List Dashboards",
44724
+ readOnlyHint: true,
44725
+ destructiveHint: false,
44726
+ idempotentHint: true,
44727
+ openWorldHint: true
44728
+ }, ({ query, limit }) => runTool(runtime5, exports_Effect.gen(function* () {
44698
44729
  const client = yield* GrafanaClient;
44699
44730
  return yield* client.listDashboards(query, limit);
44700
44731
  })));
44701
44732
  server.tool("get_dashboard", "Get a Grafana dashboard by UID. Returns full dashboard JSON, version, and folder.", {
44702
44733
  uid: exports_external.string().describe("Dashboard UID")
44703
- }, { title: "Get Dashboard", readOnlyHint: true, openWorldHint: true }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44734
+ }, {
44735
+ title: "Get Dashboard",
44736
+ readOnlyHint: true,
44737
+ destructiveHint: false,
44738
+ idempotentHint: true,
44739
+ openWorldHint: true
44740
+ }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44704
44741
  const client = yield* GrafanaClient;
44705
44742
  return yield* client.getDashboard(uid);
44706
44743
  })));
@@ -44708,7 +44745,13 @@ var registerDashboardTools = (server, runtime5) => {
44708
44745
  dashboardJson: exports_external.string().describe("Dashboard JSON as a string (must include at minimum a 'title' field)"),
44709
44746
  folderUid: exports_external.string().optional().describe("UID of the folder to place the dashboard in"),
44710
44747
  message: exports_external.string().optional().describe("Commit message for the dashboard version")
44711
- }, { title: "Create Dashboard", readOnlyHint: false, destructiveHint: false, openWorldHint: true }, ({ dashboardJson, folderUid, message }) => runTool(runtime5, exports_Effect.gen(function* () {
44748
+ }, {
44749
+ title: "Create Dashboard",
44750
+ readOnlyHint: false,
44751
+ destructiveHint: false,
44752
+ idempotentHint: false,
44753
+ openWorldHint: true
44754
+ }, ({ dashboardJson, folderUid, message }) => runTool(runtime5, exports_Effect.gen(function* () {
44712
44755
  const client = yield* GrafanaClient;
44713
44756
  return yield* client.createDashboard(dashboardJson, folderUid, message);
44714
44757
  })));
@@ -44716,13 +44759,25 @@ var registerDashboardTools = (server, runtime5) => {
44716
44759
  uid: exports_external.string().describe("Dashboard UID"),
44717
44760
  dashboardJson: exports_external.string().describe("Updated dashboard JSON as a string"),
44718
44761
  message: exports_external.string().optional().describe("Commit message for the new version")
44719
- }, { title: "Update Dashboard", readOnlyHint: false, destructiveHint: false, openWorldHint: true }, ({ uid, dashboardJson, message }) => runTool(runtime5, exports_Effect.gen(function* () {
44762
+ }, {
44763
+ title: "Update Dashboard",
44764
+ readOnlyHint: false,
44765
+ destructiveHint: false,
44766
+ idempotentHint: false,
44767
+ openWorldHint: true
44768
+ }, ({ uid, dashboardJson, message }) => runTool(runtime5, exports_Effect.gen(function* () {
44720
44769
  const client = yield* GrafanaClient;
44721
44770
  return yield* client.updateDashboard(uid, dashboardJson, message);
44722
44771
  })));
44723
44772
  server.tool("delete_dashboard", "Delete a Grafana dashboard by UID.", {
44724
44773
  uid: exports_external.string().describe("Dashboard UID")
44725
- }, { title: "Delete Dashboard", readOnlyHint: false, destructiveHint: true, openWorldHint: true }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44774
+ }, {
44775
+ title: "Delete Dashboard",
44776
+ readOnlyHint: false,
44777
+ destructiveHint: true,
44778
+ idempotentHint: true,
44779
+ openWorldHint: true
44780
+ }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44726
44781
  const client = yield* GrafanaClient;
44727
44782
  yield* client.deleteDashboard(uid);
44728
44783
  return { ok: true };
@@ -44731,13 +44786,25 @@ var registerDashboardTools = (server, runtime5) => {
44731
44786
 
44732
44787
  // src/mcp/tools/datasources.ts
44733
44788
  var registerDatasourceTools = (server, runtime5) => {
44734
- server.tool("list_datasources", "List all configured Grafana datasources. Returns id, uid, name, type, url, and isDefault.", {}, { title: "List Datasources", readOnlyHint: true, openWorldHint: true }, () => runTool(runtime5, exports_Effect.gen(function* () {
44789
+ server.tool("list_datasources", "List all configured Grafana datasources. Returns id, uid, name, type, url, and isDefault.", {}, {
44790
+ title: "List Datasources",
44791
+ readOnlyHint: true,
44792
+ destructiveHint: false,
44793
+ idempotentHint: true,
44794
+ openWorldHint: true
44795
+ }, () => runTool(runtime5, exports_Effect.gen(function* () {
44735
44796
  const client = yield* GrafanaClient;
44736
44797
  return yield* client.listDatasources();
44737
44798
  })));
44738
44799
  server.tool("get_datasource", "Get a Grafana datasource by UID.", {
44739
44800
  uid: exports_external.string().describe("Datasource UID")
44740
- }, { title: "Get Datasource", readOnlyHint: true, openWorldHint: true }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44801
+ }, {
44802
+ title: "Get Datasource",
44803
+ readOnlyHint: true,
44804
+ destructiveHint: false,
44805
+ idempotentHint: true,
44806
+ openWorldHint: true
44807
+ }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44741
44808
  const client = yield* GrafanaClient;
44742
44809
  return yield* client.getDatasource(uid);
44743
44810
  })));
@@ -44750,6 +44817,7 @@ var registerDatasourceTools = (server, runtime5) => {
44750
44817
  title: "Create Datasource",
44751
44818
  readOnlyHint: false,
44752
44819
  destructiveHint: false,
44820
+ idempotentHint: false,
44753
44821
  openWorldHint: true
44754
44822
  }, ({ name, type, url: url3, isDefault }) => runTool(runtime5, exports_Effect.gen(function* () {
44755
44823
  const client = yield* GrafanaClient;
@@ -44757,7 +44825,13 @@ var registerDatasourceTools = (server, runtime5) => {
44757
44825
  })));
44758
44826
  server.tool("delete_datasource", "Delete a Grafana datasource by UID.", {
44759
44827
  uid: exports_external.string().describe("Datasource UID")
44760
- }, { title: "Delete Datasource", readOnlyHint: false, destructiveHint: true, openWorldHint: true }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44828
+ }, {
44829
+ title: "Delete Datasource",
44830
+ readOnlyHint: false,
44831
+ destructiveHint: true,
44832
+ idempotentHint: true,
44833
+ openWorldHint: true
44834
+ }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44761
44835
  const client = yield* GrafanaClient;
44762
44836
  yield* client.deleteDatasource(uid);
44763
44837
  return { ok: true };
@@ -44766,20 +44840,38 @@ var registerDatasourceTools = (server, runtime5) => {
44766
44840
 
44767
44841
  // src/mcp/tools/folders.ts
44768
44842
  var registerFolderTools = (server, runtime5) => {
44769
- server.tool("list_folders", "List all Grafana folders. Returns uid, title, and url.", {}, { title: "List Folders", readOnlyHint: true, openWorldHint: true }, () => runTool(runtime5, exports_Effect.gen(function* () {
44843
+ server.tool("list_folders", "List all Grafana folders. Returns uid, title, and url.", {}, {
44844
+ title: "List Folders",
44845
+ readOnlyHint: true,
44846
+ destructiveHint: false,
44847
+ idempotentHint: true,
44848
+ openWorldHint: true
44849
+ }, () => runTool(runtime5, exports_Effect.gen(function* () {
44770
44850
  const client = yield* GrafanaClient;
44771
44851
  return yield* client.listFolders();
44772
44852
  })));
44773
44853
  server.tool("create_folder", "Create a new Grafana folder for organising dashboards.", {
44774
44854
  title: exports_external.string().describe("Folder title"),
44775
44855
  uid: exports_external.string().optional().describe("Optional custom UID for the folder")
44776
- }, { title: "Create Folder", readOnlyHint: false, destructiveHint: false, openWorldHint: true }, ({ title, uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44856
+ }, {
44857
+ title: "Create Folder",
44858
+ readOnlyHint: false,
44859
+ destructiveHint: false,
44860
+ idempotentHint: false,
44861
+ openWorldHint: true
44862
+ }, ({ title, uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44777
44863
  const client = yield* GrafanaClient;
44778
44864
  return yield* client.createFolder(title, uid);
44779
44865
  })));
44780
44866
  server.tool("delete_folder", "Delete a Grafana folder by UID. Deleting a folder also deletes all dashboards within it.", {
44781
44867
  uid: exports_external.string().describe("Folder UID")
44782
- }, { title: "Delete Folder", readOnlyHint: false, destructiveHint: true, openWorldHint: true }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44868
+ }, {
44869
+ title: "Delete Folder",
44870
+ readOnlyHint: false,
44871
+ destructiveHint: true,
44872
+ idempotentHint: true,
44873
+ openWorldHint: true
44874
+ }, ({ uid }) => runTool(runtime5, exports_Effect.gen(function* () {
44783
44875
  const client = yield* GrafanaClient;
44784
44876
  yield* client.deleteFolder(uid);
44785
44877
  return { ok: true };
@@ -44788,7 +44880,13 @@ var registerFolderTools = (server, runtime5) => {
44788
44880
 
44789
44881
  // src/mcp/tools/health.ts
44790
44882
  var registerHealthTools = (server, runtime5) => {
44791
- server.tool("health_check", "Check the health of the Grafana instance. Returns version, database status, and commit hash.", {}, { title: "Health Check", readOnlyHint: true, openWorldHint: true }, () => runTool(runtime5, exports_Effect.gen(function* () {
44883
+ server.tool("health_check", "Check the health of the Grafana instance. Returns version, database status, and commit hash.", {}, {
44884
+ title: "Health Check",
44885
+ readOnlyHint: true,
44886
+ destructiveHint: false,
44887
+ idempotentHint: true,
44888
+ openWorldHint: true
44889
+ }, () => runTool(runtime5, exports_Effect.gen(function* () {
44792
44890
  const client = yield* GrafanaClient;
44793
44891
  return yield* client.healthCheck();
44794
44892
  })));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daanrongen/grafana-mcp",
3
- "version": "1.1.0",
4
- "description": "MCP server for Grafana \u2014 manage dashboards, datasources, alerts, folders, and annotations over stdio",
3
+ "version": "1.2.0",
4
+ "description": "MCP server for Grafana manage dashboards, datasources, alerts, folders, and annotations over stdio",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "grafana-mcp": "./dist/main.js"