Configure MCP
Configuring Model Context Protocol (MCP) in Graylog makes it possible for a supported LLM client to connect to your Graylog environment and use Graylog’s exposed MCP tools through the same API and permission model that governs REST access.
This article explains the requirements for MCP setup in Graylog, how to create and format authentication credentials, how to enable MCP, how to connect supported LLM clients, and what security considerations to keep in mind during configuration.
Warning: Graylog MCP support is an experimental feature. Its behavior, available tools, and responses may change without notice between versions. Use MCP only in controlled, non-production environments. Actions performed through MCP may modify live data, trigger system events, or expose sensitive information, depending on the permissions of the connected user. Graylog does not provide full support for MCP-related issues at this time. Proceed only if you understand the potential impact to your environment.
Prerequisites
Before proceeding, ensure that the following prerequisites are met:
-
You must be running Graylog version 7.0 or later to use MCP tools.
-
Each MCP user must have a unique API token generated for authentication.
-
You need a supported LLM client, such as Claude Code, LM Studio, Claude Desktop, or Open WebUI, to connect with the MCP server.
-
You should have a basic understanding of Graylog API tokens and REST endpoints before beginning configuration.
Set Up MCP Access in Graylog
Before you can connect an LLM to Graylog, you need to prepare the environment. This setup involves creating a dedicated MCP user, generating an API token, and enabling MCP support within your Graylog instance.
Create an API Token for the MCP User
Each MCP connection requires its own authentication token. Creating a dedicated user ensures limited access and isolates MCP activity from administrative accounts. The MCP user's permissions determine which data the LLM can query and which tools succeed. At a minimum, grant the user the Reader role and View access to the streams you want the LLM to search. If you want the LLM to work with dashboards or event definitions, share those resources with the user as well. Tools for Graylog Security and Illuminate content also require the user to have access to those features. See MCP Tools and Graylog for the full list of tools.
To create an API token for the MCP user, follow these steps:
-
Create a dedicated read-only Graylog user for MCP. Do not use administrator accounts. Instead, create a limited-access user that can only read the data required for MCP. See Manage Users for complete information about creating a user and assigning permissions.
-
Generate an API token for that user under System > Users and Teams > Tokens. See REST API Access Tokens for information.
-
Format the API token for use as an authentication header value. Add the Graylog API token as the
<username>in the following format:Copyecho -n "<username>:token" | base64In the example below, the user has replaced
<username>with the generated API token and maintained the syntax fortoken:Copyecho -n "3bpe4cpas2skrpvm9f3390ik2hqg8pfl4kp5bcs2cd78korjfjq:token" | base64Hint: Note that, as in the example above, you do NOT replace the value
tokenwith your API token. The API token is added in the<username>field. The wordtokenremains the same as demonstrated.
Enable MCP Support
After generating the API token, you must enable the MCP feature in Graylog. Enabling this configuration makes the MCP endpoint available so that approved clients can connect and issue tool-based requests.
- Navigate to System > Configurations > MCP.
- Toggle Enable MCP to On.
- Save your configuration.
Configure Your LLM Client
After MCP is enabled in Graylog, the next step is to connect your preferred LLM client. Configuration details vary depending on the client, but each setup requires specifying your Graylog MCP server URL and authentication token. We have provided example configuration steps for the following LLM clients: Claude Code, LM Studio, Claude Desktop, and Open WebUI.
Configure Claude Code
Use Claude Code to connect directly to your Graylog MCP server for live querying and operational tasks. Configuration is completed through simple command-line steps that register your Graylog instance as a remote MCP endpoint.
- Install and open Claude Code according to their documentation.
-
Display the current list of MCP servers for verification:
Copyclaude mcp list - Register your Graylog MCP server. Replace
http://127.0.0.1:9000with your Graylog server address and port, and replace theAuthorizationvalue with your base64-encoded API token from Create an API Token for the MCP User:Copyclaude mcp add --transport http graylog http://127.0.0.1:9000/api/mcp \
--header "Authorization: Basic CKDFJKLCFKLLFKCL..." - Verify the connection:Copy
claude mcp list - Start prompting Claude about your Graylog server.
Warning: Do not connect Claude Code to multiple Graylog instances at the same time!
Configure LM Studio
LM Studio supports MCP through a local configuration file. By editing the mcp.json file, you can register your Graylog server and begin using MCP tools directly from your LM Studio chat interface.
- Install and launch LM Studio.
- Go to Settings > Program > Edit mcp.json.
- Add your Graylog MCP configuration. Replace the
urlvalue with your Graylog server address and port, and replace theAuthorizationvalue with your base64-encoded API token from Create an API Token for the MCP User:Copy{
"mcpServers": {
"graylog-mcp-server": {
"url": "http://localhost:9000/api/mcp",
"headers": {
"Authorization": "Basic CKDFJKLCFKLLFKCL..."
}
}
}
} - Save the file. LM Studio refreshes the configuration automatically.
- Enable MCP tools and begin prompting.
Warning: Do not connect LM Studio to multiple Graylog instances at the same time!
Claude Desktop
Claude Desktop requires an additional proxy setup to communicate with the MCP endpoint. This configuration is intended for advanced users who want to run MCP commands locally through a controlled proxy environment:
{
"mcpServers": {
"graylog-proxy": {
"command": "uvx",
"args": [ "fastmcp", "run", "http://<username>:<password>@localhost:9000/api/mcp" ]
}
}
}
Or, if using a previously-generated API token:
{
"mcpServers": {
"graylog-proxy": {
"command": "uvx",
"args": [ "fastmcp", "run", "http://<api token>:token@localhost:9000/api/mcp" ]
}
}
}
Configure Open WebUI
Open WebUI is a self-hosted AI interface that connects natively to MCP servers over Streamable HTTP. For complete information on Open WebUI tool servers, see the Open WebUI MCP documentation.
Open WebUI authenticates to Graylog with an Authorization header that uses Graylog's basic authentication method. Set the connection's authentication to None and supply the header manually instead. The header value is Basic followed by the base64-encoded <api token>:token string you created in Create an API Token for the MCP User.
Hint: Open WebUI version 0.6.31 or later is required for native MCP support. Only Open WebUI administrators can add external tool server connections.
- Install and launch Open WebUI.
- As an administrator, navigate to Settings > Integrations. Under External Tool Servers, select + Add Connection.
-
Complete the connection parameters:
- Type: Select MCP (Streamable HTTP). Do not select OpenAPI.
- URL: Enter your Graylog MCP server URL, for example
https://graylog.your.domain/api/mcp. If Open WebUI runs in Docker and Graylog runs on the same host machine, usehttp://host.docker.internal:9000/api/mcpinstead oflocalhost. - Auth: Select None.
-
Headers: Add the Graylog authorization header in JSON format:
Copy{
"Authorization": "Basic CKDFJKLCFKLLFKCL..."
} - ID: Enter a short identifier without spaces, for example
graylog. Open WebUI adds the ID as a prefix to each tool name, for examplegraylog_search_messages. - Name and Description: Enter values that identify the connection, for example
Graylog MCP Server.
- Select Save.
- Open a new chat, select + > Tools, and enable the Graylog MCP server tools. You can now begin prompting.
Alternatively, you can import the connection from a JSON file. Save the following configuration as a .json file, replace the URL and authorization header value with your own, and import it:
[
{
"type": "mcp",
"url": "https://graylog.your.domain/api/mcp",
"spec_type": "url",
"spec": "",
"path": "openapi.json",
"auth_type": "none",
"headers": {
"Authorization": "Basic CKDFJKLCFKLLFKCL..."
},
"key": "",
"info": {
"id": "graylog",
"name": "Graylog MCP Server",
"description": "Graylog MCP Server"
}
}
]
Warning: Do not connect Open WebUI to multiple Graylog instances at the same time!
Security Considerations
MCP uses the same HTTP API that Graylog already relies on, so it does not require additional network ports or external access points. All requests made through MCP are subject to the same authentication and authorization controls as the Graylog REST API.
Access to MCP tools is governed by the user roles assigned to the API token in use. This user-role access means the scope of actions an LLM can perform depends entirely on the permissions of the associated Graylog account. To minimize risk, create a dedicated read-only user for MCP rather than reusing existing administrative credentials.
By default, remote MCP access is disabled in Graylog. You can enable it manually in System > Configurations > MCP when you are ready to test the feature. Always review your environment and data exposure before enabling MCP in production systems, as connected models may perform or suggest actions based on live data.
Use Your LLM With Graylog
Now that you have set up MCP integration with Graylog and configured your LLM client, review MCP Tools and Graylog to see what what tools are currently available and what prompts you can test in your LLM for use with these tools.
Troubleshooting and Common Issues
The following section outlines troubleshooting steps for common issues to assist you in resolving potential challenges you may encounter.
Issue: Connection Fails When Registering MCP Server
Your LLM client cannot connect to the Graylog MCP server. Depending on the client, the server is listed as failed or disconnected (for example, claude mcp list reports that it failed to connect, or Open WebUI displays Failed to connect to MCP server), no Graylog tools are available in the chat, or requests return an authentication error.
Solution: Validate Configuration
- Ensure that MCP is enabled under System > Configurations > MCP.
- Verify that the Graylog MCP endpoint (
/api/mcp) is reachable from the machine running your LLM client, and that the server URL in your client configuration matches your Graylog server address and port. - Confirm that your API token is base64-encoded correctly in the
<api token>:tokenformat and that theAuthorizationheader value begins withBasic. See Create an API Token for the MCP User. - Check the Graylog server logs for MCP errors.
Further Reading
Explore the following additional resources and recommended readings to expand your knowledge on related topics:
