Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana/latest/developer-resources/mcp/developer/build-and-test.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana/latest/developer-resources/mcp/developer/build-and-test/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Build, test, and lint
Contributions are welcome. Open an issue or pull request on GitHub. This project is written in Go.
What you’ll achieve
You can run the server from source, execute the test suites, and run linters locally.
Before you begin
- mise installed for your platform. Run
mise installin the repository to get the pinned Go and other tools. - Optional: Docker for integration tests.
Run the server locally
STDIO (default for local development):
mise run runSSE:
go run ./cmd/mcp-grafana --transport sseBuild and run the Docker image
Build the image:
mise run build-imageRun in SSE mode (image default):
docker run -it --rm -p 8000:8000 mcp-grafana:latestRun in stdio mode:
docker run -it --rm mcp-grafana:latest -t stdioRun tests
There are three types of tests available: unit tests, integration tests, and cloud tests.
Unit tests (no external dependencies required):
mise run test-unitYou can also run:
mise run testIntegration tests (requires Docker containers):
mise run test-integrationCloud tests (requires Grafana Cloud instance and credentials):
mise run test-cloudNote: Cloud tests are automatically configured in CI. For local development, you’ll need to set up your own Grafana Cloud instance and credentials.
For the full integration suite, start the supporting services first (Grafana and its dependencies on port 3000):
mise run run-test-services
mise run test-integrationIf you add tools, add integration tests; existing tests are a good template.
Run linters
mise run lintThe repository includes a custom linter for unescaped commas in jsonschema struct tags (description fields must be escaped with \\, to avoid truncation). Run only that linter:
mise run lint-jsonschemaRefer to the JSONSchema linter README in the repository.
Next steps
Was this page helpful?
Related resources from Grafana Labs


