Install
$ agentstack add mcp-grafana-cold-storage-grafana-mcp-agent-datasource ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
| :warning: Info | |:----------------------------| | This experiment has been archived, we merged this effort with Grafana MCP, please use that. |
Grafana MCP Agent DataSource Plugin
A Grafana data source plugin that connects to Model Context Protocol (MCP) servers and enables natural language querying of external tools and data sources.
🎉 Built with mcp-go Library
This plugin leverages the excellent mark3labs/mcp-go library (6.1k+ stars) for robust, production-ready MCP client functionality. This provides:
- ✅ Full MCP protocol compliance
- ✅ Multiple transport options (stdio, SSE, streamable HTTP, in-process)
- ✅ Comprehensive error handling and retry logic
- ✅ Active maintenance and community support
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables Large Language Models (LLMs) to securely connect with external data sources and tools. MCP servers can:
- Expose data through Resources (like databases, files, APIs)
- Provide functionality through Tools (like calculations, external service calls)
- Define interaction patterns through Prompts (reusable templates)
Features
- 🔗 Universal MCP Connectivity: Connect to any MCP-compliant server
- 🗣️ Natural Language Queries: Query your data sources using plain English
- 🛠️ Tool Integration: Execute MCP tools directly from Grafana
- 📊 Data Visualization: Convert MCP responses into Grafana data frames
- 🔧 Multiple Transports: Support for WebSocket, HTTP, and SSE connections
- 🔐 Flexible Authentication: Multiple auth methods including basic, bearer, and OAuth
- ⚡ Real-time Updates: Live connection monitoring and health checks
Architecture
┌─────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Grafana │◄──►│ MCP DataSource │◄──►│ MCP Server │
│ Dashboard │ │ Plugin │ │ (External Tool) │
└─────────────┘ └─────────────────┘ └─────────────────┘
- Grafana Dashboard: Visualizes data and provides the user interface
- MCP DataSource Plugin: Translates between Grafana and MCP protocols
- MCP Server: External service exposing tools, data, or capabilities
Getting Started
Prerequisites
- Grafana 8.0+
- Go 1.24+
- Node.js 18+
- Access to one or more MCP servers
Development Setup
- Clone and setup the project:
``bash git clone cd grafana-mcpclient-datasource npm install go mod tidy ``
- Build the plugin:
```bash # Build frontend npm run build
# Build backend go build -o mcp-datasource ./pkg ```
- Run development server:
``bash npm run server ``
Configuration
- Add the datasource in Grafana's Data Sources settings
- Configure MCP server connection:
- Server URL: Your MCP server endpoint (http, https, ws, wss)
- Transport: Auto-detected based on URL scheme
- Authentication: Configure credentials if required
- Timeouts: Set connection and query timeouts
- Test the connection using the built-in health check
Query Types
The plugin supports multiple query types:
Natural Language Queries
{
"queryType": "natural_language",
"query": "Show me the latest sales data from the database"
}
Direct Tool Calls
{
"queryType": "tool_call",
"toolName": "database_query",
"toolArguments": "{\"table\": \"sales\", \"limit\": 100}"
}
Tool Discovery
{
"queryType": "list_tools"
}
MCP Server Compatibility
This plugin works with any MCP-compliant server. Popular examples include:
- Database Servers: PostgreSQL, MySQL, SQLite MCP servers
- File System Servers: Local and remote file access
- API Servers: REST/GraphQL API wrappers
- Cloud Services: AWS, Azure, GCP integrations
- Custom Tools: Domain-specific business logic
Development
Backend Development
The backend is written in Go and uses the Grafana Plugin SDK:
# Install dependencies
go mod tidy
# Run tests
go test ./...
# Build
go build ./pkg
Frontend Development
The frontend is built with React and TypeScript:
# Install dependencies
npm install
# Development mode
npm run dev
# Production build
npm run build
# Run tests
npm run test
Project Structure
├── pkg/ # Go backend code
│ ├── main.go # Plugin entry point
│ ├── models/ # Data models and types
│ └── plugin/ # Plugin implementation
├── src/ # TypeScript frontend code
│ ├── components/ # React components
│ ├── datasource.ts # DataSource implementation
│ └── types.ts # Type definitions
├── project/ # Project documentation
│ ├── plan.md # Technical architecture
│ └── tasks.md # Development tasks
└── provisioning/ # Grafana provisioning configs
Contributing
Contributions are welcome! Please check the [development tasks](project/tasks.md) for current priorities.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Learn More
- Model Context Protocol - Official MCP documentation
- mcp-go Library - The Go MCP library we use
- Grafana Plugin Development - Official Grafana plugin docs
- [Project Plan](project/plan.md) - Detailed technical architecture
- [Development Tasks](project/tasks.md) - Current development status
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Thanks to mark3labs for the excellent mcp-go library
- Thanks to the Grafana team for the plugin development framework
- Thanks to the MCP community for the protocol specification
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: grafana-cold-storage
- Source: grafana-cold-storage/grafana-mcp-agent-datasource
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.