grafana -agent-datasource
A Grafana data source plugin that connects to MCP servers and enables natural language querying
claude mcp add --transport stdio grafana-grafana-mcp-agent-datasource npx -y grafana-mcpclient-datasource
How to use
This MCP client plugin enables Grafana to communicate with any MCP-compliant server, allowing natural language queries, direct tool invocations, and tool discovery through the MCP protocol. The plugin translates between Grafana’s UI and the MCP server, enabling data visualization in Grafana dashboards by rendering MCP responses as data frames. It supports multiple transport options (WebSocket, HTTP, SSE) and flexible authentication methods, so you can connect to various MCP servers such as databases, file systems, APIs, or custom tools. To use it, install the plugin in Grafana, configure a data source pointing to your MCP server, then create queries in Grafana using the provided query types.
You can run three main query shapes:
- Natural language queries, which submit human-friendly questions (e.g., "Show me the latest sales data").
- Direct tool calls, which invoke a specific MCP tool with structured arguments (e.g., toolName: database_query, toolArguments: '{"table": "sales"}' ).
- Tool discovery, which lists available tools on the connected MCP server. Once configured, you can test connections and visualize results directly in Grafana dashboards.
How to install
Prerequisites
- Grafana 8.0+ installed
- Node.js 18+ installed
- Go 1.20+ installed (for plugin build and tests)
- Access to an MCP server (or a local MCP server for testing)
Installation steps
- Prepare the environment
- Ensure Grafana is running and you have admin access to install plugins.
- Install dependencies and clone the project
git clone <repository-url>
cd grafana-mcpclient-datasource
npm install
- Build the plugin (frontend and backend)
# Build frontend
npm run build
# Build backend (Go)
go mod tidy
go build ./pkg
- Run the development server
npm run server
- Add the MCP data source in Grafana
- Open Grafana, go to Configuration > Data Sources > Add data source
- Choose the MCP DataSource (Grafana MCP Agent DataSource) and configure the MCP server URL, transport, and authentication as required.
Additional notes
Notes and tips:
- This plugin is designed to work with any MCP-compliant server. Ensure your MCP server supports the transports you plan to use (WebSocket, HTTP, SSE).
- When configuring authentication, consider using token-based methods (Bearer) or basic authentication as supported by your MCP server.
- If you encounter transport issues, verify the MCP server URL scheme (ws/wss for WebSocket, http/https for HTTP) and ensure firewalls allow the traffic.
- For development, use the provided test endpoints and tools in your MCP server to validate natural language queries and tool calls before integrating into dashboards.
- Logs and error messages from the Grafana plugin can help diagnose connectivity or protocol mismatch problems; enable verbose logging in Grafana if available.
Related MCP Servers
paperdebugger
A Plugin-Based Multi-Agent System for In-Editor Academic Writing, Review, and Editing
context-space
Ultimate Context Engineering Infrastructure, starting from MCPs and Integrations
volcano-agent-sdk
🌋 Build AI agents that seamlessly combine LLM reasoning with real-world actions via MCP tools — in just a few lines of TypeScript.
loki
An MCP ( Model Context Protocol ) Server for Grafana Loki
zerodha
Zerodha MCP Server & Client - AI Agent (w/Agno & w/Google ADK)
fast -telegram
Telegram MCP Server and HTTP-MTProto bridge | Multi-user auth, intelligent search, file sending, web setup | Docker & PyPI ready