Configure MCP for Microsoft Copilot

Connecting a Microsoft Copilot Studio agent to the Graylog Model Context Protocol (MCP) endpoint gives the agent direct access to Graylog’s MCP tools. This connection allows the agent to query your Graylog deployment for streams, search results, and events and use the returned data in its responses. This article explains how to connect a Copilot Studio agent to Graylog MCP.

Prerequisites

Before proceeding, ensure that the following prerequisites are met:

  • Graylog 7.1 or later.

  • A dedicated, read-only Graylog user and an API token for that user. Do not use an administrator account for this connection. See Configure MCP and REST API Access Tokens.

  • A Microsoft Copilot Studio environment with permission to create agents and add tools.

  • A Graylog MCP endpoint that is reachable from Microsoft's cloud. Copilot Studio connects to your MCP server from Microsoft's cloud, not from your network.

Hint: The MCP endpoint is not displayed in the Graylog interface. Build it from the base URL you use to open the Graylog web interface, followed by /api/mcp. For example, https://<your-graylog-host>/api/mcp.

If you reach Graylog on a specific port (for example, the default port 9000), include it: https://<your-graylog-host>:9000/api/mcp.

If Graylog sits behind a load balancer or reverse proxy, use that public URL, which is typically the value of http_external_uri in server.conf.

Configure Graylog for Copilot Studio

The following sections describe the Graylog configuration required to connect a Copilot Studio agent to Graylog MCP.

Enable Remote MCP Access in Graylog

Graylog's MCP server is built into Graylog, but it does not accept connections from external clients until you turn on remote MCP access. This setting makes the MCP endpoint (/api/mcp) available so that approved MCP clients, such as Copilot Studio, can connect to Graylog and send tool-based requests, for example to list streams or search messages.

Enabling remote MCP access does not grant any new data access on its own. Each request is still authenticated with an API token, and what a client can see or do is limited to the roles of the Graylog user who owns that token.

To enable remote MCP access:

  1. In Graylog, navigate to System > Configurations.

  2. From the list of configuration settings in the left pane, select MCP. The MCP Server Configuration section shows the current state of each MCP setting.

  3. Select Edit configuration. The Update MCP Server Configuration dialog opens.

  4. Select the Enable remote MCP access check box, then select Update configuration.

Generate the Authorization Value

Copilot Studio authenticates to Graylog by sending an Authorization header with every request. Before you configure Copilot Studio, convert your Graylog API token into the value for this header. The value is the word Basic, a single space, and the base64-encoded string <api_token>:token, where a single colon separates your API token from the literal word token. The finished value looks like this:

Basic MWFiYzJkZWYzZ2hpNGprbDVtbm82cHFy...

Windows (PowerShell)

Replace <your-api-token> with your API token (without the angle brackets), and run the following script, which displays the authorization value and copies it to your clipboard:

Copy
$token = "<your-api-token>"
$auth  = "Basic " + [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("${token}:token"))
"Key value for Copilot Studio:"; $auth
$auth | Set-Clipboard

macOS or Linux

Replace <your-api-token> with your API token (without the angle brackets), and run:

Copy
echo "Basic $(printf '%s:token' '<your-api-token>' | base64 | tr -d '\n')"

Important: Enter only the raw API token in the script. Do not include angle brackets, and do not add Basic to the token yourself, because the script adds it. Either mistake causes Graylog to reject the request as unauthorized.

Copy the full output, including Basic and the space after it. You enter this value in the Key value field when you add the Graylog MCP tool, and again in the Authorization field when you create the connection.

Warning: The authorization value grants the same access as your API token. Treat it as a password and do not share it in screenshots, chats, or tickets. If it is exposed, revoke the token in Graylog and generate a new one.

Connect a Copilot Studio Agent to Graylog MCP

The following steps use Copilot Studio's built-in MCP onboarding wizard. Menu labels reflect the current Copilot Studio interface as of this writing and may change. If a label below doesn't match what you see, consult Microsoft's Connect your agent to an existing MCP server documentation.

Create the Agent

  1. In Copilot Studio, select Agents from the left navigation.

  2. Select New agent, or create a new agent from the home screen.

  3. Enter a name for the agent, for example Graylog MCP, and then enter a description and instructions for the agent.

Add the Graylog MCP Tool

  1. From the agent's overview screen, select Tools.

  2. Select + Add, and then select Model Context Protocol (MCP).

    The Copilot Studio Add a tool dialog with the Model Context Protocol (MCP) option highlighted in the category dropdown.

  3. Enter a Server name, for example Graylog, and a Server description.

  4. In Server URL, enter your Graylog MCP endpoint (https://<your-graylog-host>/api/mcp).

  5. Under Authentication, select API key.

  6. Set Parameter type to Header.

  7. In the Header name field, enter Authorization.

  8. In the Key value field, paste the authorization value you generated in Generate the Authorization Value. The value must begin with Basic.

  9. Select Add.

Hint: This mirrors a standard Graylog REST API request. Copilot Studio sends the authorization value in the Authorization header, the same way as the following request:

Copy
curl -X POST "https://<your-graylog-host>/api/mcp" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Basic <base64-encoded-string>"

Authenticate the Connection

After you add the tool, Copilot Studio prompts you to create a connection that stores the credentials the agent uses.

  1. Select the Connection drop-down, and then select Create new connection.

    The Copilot Studio Select a connection dialog with the Create new connection option highlighted in the Connection dropdown.

  2. Optionally, enter a display name for the connection.

  3. In the Authorization field, paste the same authorization value you used in the Key value field, exactly as generated. See Generate the Authorization Value.

    Important: The generated value already begins with Basic. Do not add another Basic prefix, and do not paste the raw API token. Either mistake causes Graylog to reject the request as unauthorized.

  4. Select Create, and then select Add to agent.

Set Tool Permissions

  1. Select the newly added Graylog tool to open its settings.

  2. Select the Authentication drop-down.

  3. Select Shared account so the agent always authenticates with the read-only Graylog user you configured, not each end user's credentials.

    The Copilot Studio Edit tool dialog with Shared account selected in the Authentication dropdown, showing the list of Graylog MCP tool permissions below.

  4. Select Done.

Hint: Copilot Studio lists the tools it discovered from the Graylog MCP server and, by default, allows all of them. Because access is already scoped by the read-only Graylog user's role, this is generally safe. For tighter control, turn off Allow all and select only the tools this agent needs.

Test the Connection

  1. At the top of the agent page, select the Preview tab.

  2. Enter a simple diagnostic prompt:

    Copy
    List the available streams in Graylog
  3. Send the prompt and review the response. If you are prompted to allow the Graylog tool or confirm the connection, approve it.

    When your Graylog streams appear in the response, the connection is working.

  4. Save and publish the agent.

Security Considerations

  • MCP uses the same HTTP API and authorization model as the rest of Graylog. Copilot can only do what the connected user's role permits.

  • Always use a dedicated, read-only user for this connection, never an administrator account.

  • Treat this integration as experimental. Review the tools Copilot has access to periodically, and prefer explicitly selecting tools over Allow all in production-adjacent environments.

Troubleshooting and Common Issues

The following section outlines troubleshooting steps for common issues to assist you in resolving potential challenges you may encounter.

Issue: "Can't create MCP server. Try again." Error When Adding the Tool

Copilot Studio shows this generic error when its first call to your Graylog server fails.

Solution: Verify the Connection Requirements

Confirm the following:

  • The Key value field and the connection's Authorization field both contain the full generated value, starting with Basic, and the value was generated from the raw token without angle brackets.

  • Remote MCP access is enabled in Graylog.

  • The Graylog URL is reachable from the public internet, not only from your VPN or internal network.

  • Your Power Platform environment allows custom MCP servers. A data loss prevention (DLP) policy or missing maker permissions can block them. Contact your Power Platform administrator.

Issue: Connection Fails or Times Out

The connection to your Graylog MCP server fails or times out.

Solution: Verify the Server URL and Remote MCP Access

Confirm the Server URL is correct and reachable from outside your network, and that remote MCP access is enabled in Graylog under System > Configurations > MCP.

Issue: 401 or Unauthorized Errors

Graylog rejects requests from Copilot Studio as unauthorized.

Solution: Verify the Authorization Value

Confirm the authorization value starts with Basic followed by a space, and that it was generated from the <api_token>:token string as described in Generate the Authorization Value.

Issue: Each User Is Prompted to Sign In

Each user is prompted to sign in.

Solution: Change the Authentication Setting to Shared Account

The tool's Authentication setting is End user account. Change it to Shared account. See Set Tool Permissions.

Issue: No Tools or Streams Returned

No tools or streams are returned.

Solution: Verify User Permissions and Allowed Tools

Confirm the API token's user has the expected role and permissions in Graylog, and that the tools are allowed in the Graylog tool's settings in Copilot Studio.

Further Reading

Explore the following additional resources and recommended readings to expand your knowledge on related topics: