This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.
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
- Go installed for your platform.
- Optional: Docker for integration tests.
Run the server locally
STDIO (default for local development):
make runSSE:
go run ./cmd/mcp-grafana --transport sseBuild and run the Docker image
Build the image:
make 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):
make test-unitYou can also run:
make testIntegration tests (requires Docker containers):
make test-integrationCloud tests (requires Grafana Cloud instance and credentials):
make 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):
make run-test-services
make test-integrationIf you add tools, add integration tests; existing tests are a good template.
Run linters
make 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:
make lint-jsonschemaRefer to the JSONSchema linter README in the repository.
Next steps
Was this page helpful?
Related resources from Grafana Labs


