Glean MCP Integration

Glean’s Model Context Protocol (MCP) server enables AI models to securely access and search your organization’s knowledge. This integration allows you to use Glean’s powerful search and chat capabilities in MCP-compatible tools and applications.

This documentation is for the STDIO (local) MCP server implementation. For the Remote MCP server implementation, please reach out to your Glean account team.

MCP Server

@gleanwork/local-mcp-server


Official STDIO (local) MCP server implementation for Glean’s search and chat capabilities

Features

  • Enterprise Search: Access Glean’s powerful content search capabilities
  • Chat Interface: Interact with Glean’s AI assistant
  • MCP Compliant: Implements the Model Context Protocol specification

Available Tools

The Glean MCP server provides the following tools:

Search Glean’s content index using the Glean Search API. This tool allows you to query Glean’s content index with various filtering and configuration options.

chat

Interact with Glean’s AI assistant using the Glean Chat API. This tool allows you to have conversational interactions with Glean’s AI, including support for message history, citations, and various configuration options.

Search Glean’s People directory to find employee information.

read_documents

Read documents from Glean by providing document IDs or URLs. This tool allows you to retrieve the full content of specific documents for detailed analysis or reference.

Configuration

Authentication

The local MCP server can authenticate you in one of two ways:

  1. Using an OAuth token via device flow or
  2. Using a Glean Client API token

We recommend using OAuth whenever possible, for a better user experience and obviating the need to manage token issuance.

See here for instructions your Glean administrator can follow to setup OAuth device flow for Glean’s MCP servers.

Currently, our MCP implementation uses the OAuth device flow or API tokens for authentication. While the MCP specification includes optional authorization mechanisms we’re using a simpler approach for now. Once the OAuth specification is widely adopted in the MCP ecosystem, we plan to implement a fully spec-compliant OAuth-based authentication for enhanced security and user management.

Using OAuth

First, make sure your administrator has enabled OAuth device flow for your Glean instance. See here for instructions.

Then follow the instructions for your IDE integration or Application Integration. When you run the configure command you’ll be prompted to go through an OAuth device flow to grant access to your IDE or Application to communicate with Glean on your behalf.

Using Client API Tokens

API Tokens

To use API tokens you’ll need a user-scoped API token. API Tokens require the following scopes: chat, search, documents. You should speak to your Glean administrator to provision these tokens.

IDE Integrations

Application Integrations