Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana-cloud/machine-learning/mcp/clients/zed.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/machine-learning/mcp/clients/zed/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
Zed
This guide helps you set up the mcp-grafana server for the Zed editor.
Prerequisites
- Zed editor installed
- Grafana 9.0+ with a service account token
mcp-grafanabinary in your PATH
Configuration
Zed uses context_servers in settings.json, not mcpServers.
Add using the UI
- Open Agent Panel (Cmd+Shift+A)
- Click Settings (gear icon)
- Click Add Custom Server
- Fill in command and args
Manual configuration
Open Zed settings (Cmd+,) and add:
{
"context_servers": {
"grafana": {
"command": "mcp-grafana",
"args": [],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Note: Zed uses context_servers, not mcpServers.
Docker configuration
{
"context_servers": {
"grafana": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"GRAFANA_URL",
"-e",
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
"grafana/mcp-grafana",
"-t",
"stdio"
],
"env": {
"GRAFANA_URL": "http://host.docker.internal:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Debug mode
{
"context_servers": {
"grafana": {
"command": "mcp-grafana",
"args": ["-debug"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Verify configuration
- Open Agent Panel settings
- Check indicator next to grafana
- Green = server active
- Other colors = check tooltip for status
- Open Agent Panel chat
- Ask: “List my Grafana dashboards”
Tip: Mention “grafana” in your prompt to help the model pick the right tools.
Tool permissions
By default, Zed asks permission for each tool call. To auto-allow:
{
"agent": {
"always_allow_tool_actions": true
}
}Use with caution – this enables all MCP tools without confirmation.
Troubleshooting
Server not starting:
- Check Zed logs: Cmd+Shift+P -> zed: open logs
- Verify binary path:
which mcp-grafana - Restart Zed after configuration changes
Tools not appearing:
- Zed supports both stdio and HTTP transports
- For remote servers, use native URL syntax or
mcp-remoteshim
Remote server (native URL syntax):
Zed supports direct URL connections for remote MCP servers:
{
"context_servers": {
"grafana": {
"url": "http://localhost:8000/sse",
"headers": {}
}
}
}First start the server:
mcp-grafana --transport sse --address localhost:8000Remote server (mcp-remote fallback):
Alternative using mcp-remote shim:
{
"context_servers": {
"grafana": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8000/sse"]
}
}
}Read-only mode
{
"context_servers": {
"grafana": {
"command": "mcp-grafana",
"args": ["--disable-write"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Next steps
- Set up for other install options.
- Configure authentication for Grafana credentials.
Was this page helpful?
Related resources from Grafana Labs


