Skip to main content

Glean MCP Integration: Choose Your Approach

Glean offers two ways to integrate with Model Context Protocol (MCP) to enable AI models to securely access and search your organization's knowledge:

Which Approach Should I Use?

Choose the approach that best fits your needs:

FactorLocal MCP ServerRemote MCP Server
Availability Available now Private beta - contact Glean team
SetupInstall & configure locallyNo setup required
MaintenanceYou manage updates & hostingGlean manages everything
SecurityRuns on your infrastructureEnterprise-grade Glean infrastructure
PerformanceDepends on your local setupEnterprise SLA with guaranteed uptime
Available Toolscompany_search, chat, people_profile_search, read_documentsDifferent tool set (details available to beta participants)
Ideal ForDevelopers, quick testing, full controlEnterprise deployments, production use
Quick Start Recommendation

If you're just getting started or want to test MCP integration, begin with the Local MCP Server. You can always migrate to the Remote MCP Server when it becomes generally available.


Local MCP Server (Available Now)

The Local MCP Server is a self-hosted solution that you install and run on your own infrastructure. This gives you full control over the setup and allows immediate access to Glean's MCP capabilities.

@gleanwork/local-mcp-server

npm version

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

View on GitHub

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
  • Cross-Platform: Works with Cursor, VS Code, Windsurf, Claude Desktop, and more
  • Easy Setup: Simple CLI configuration for popular MCP clients

Available Tools

The Local 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.

info

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

Cursor

Configure Cursor

1

Prerequisites

First, make sure your administrator has enabled OAuth device flow for your Glean instance. See the Using OAuth section above for setup instructions.

2

Configure Cursor

Run the following command to configure Cursor to use Glean's MCP server. This will add a new MCP server to Cursor's settings.

npx -y @gleanwork/configure-mcp-server --client cursor --instance <your-glean-instance-name>
3

Test the Integration

note

Since MCP does not mandate a specific tool discovery interface, you may need to explicitly prompt Cursor's AI to use Glean's tools. Try prefixing your questions with phrases like "Using Glean, ..." or "Search in Glean for ..." to help the AI understand which tool to use.

  1. Open a new chat in Cursor
  2. Try a query like "Using Glean, what's our company's policy on remote work?"
  3. Verify that Cursor can access and search your Glean content
Windsurf

Configure Windsurf

1

Get Credentials

Ensure you have your Glean API credentials ready from the Configuration section above. You'll need:

2

Configure Windsurf

Run the following command to configure Windsurf to use Glean's MCP server. This will add a new MCP server to Windsurf's settings.

Using explicit instance and token flags:

npx -y @gleanwork/configure-mcp-server --client windsurf --instance <your-glean-instance-name> --token <your-glean-api-token>

Using a .env file:

npx -y @gleanwork/configure-mcp-server --client windsurf --env <path-to-env-file>
3

Test the Integration

note

Since MCP does not mandate a specific tool discovery interface, you may need to explicitly prompt Cascade to use Glean's tools. Try prefixing your questions with phrases like "Using Glean, ..." or "Search in Glean for ..." to help Cascade understand which tool to use.

  1. Open a new chat in Windsurf
  2. Try a query like "Using Glean, what's our company's policy on remote work?"
  3. Verify that Windsurf can access and search your Glean content
VS Code

Configure VS Code

VS Code supports global MCP server configuration that applies across all your workspaces. This is ideal for personal use.

1

Get Credentials

Ensure you have your Glean API credentials ready from the Configuration section above. You'll need:

2

Configure VS Code

Run the following command to configure VS Code to use Glean's MCP server globally.

Using explicit instance and token flags:

npx -y @gleanwork/configure-mcp-server --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token>

Using a .env file:

npx -y @gleanwork/configure-mcp-server --client vscode --env <path-to-env-file>
3

Test the Integration

note

VS Code has native MCP support with agent mode. You can access MCP tools through the Chat view in agent mode. Look for the Tools button to manage available MCP servers and tools.

  1. Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
  2. Select Agent mode from the dropdown
  3. Click the Tools button to view available MCP tools
  4. Try a query like "Using Glean, what's our company's policy on remote work?"
  5. Verify that VS Code can access and search your Glean content

Application Integrations

Claude Desktop

Configure Claude Desktop

1

Get Credentials

Ensure you have your Glean API credentials ready from the Configuration section above. You'll need:

2

Configure Claude Desktop

Run the following command to configure Claude Desktop to use Glean's MCP server. This will add a new MCP server to Claude Desktop's settings.

Using explicit instance and token flags:

npx -y @gleanwork/configure-mcp-server --client claude --instance <your-glean-instance-name> --token <your-glean-api-token>

Using a .env file:

npx -y @gleanwork/configure-mcp-server --client claude --env <path-to-env-file>
3

Test the Integration

note

Since MCP does not mandate a specific tool discovery interface, you may need to explicitly prompt Claude to use Glean's tools. Try prefixing your questions with phrases like "Using Glean, ..." or "Search in Glean for ..." to help Claude understand which tool to use.

  1. Start a new conversation in Claude Desktop
  2. Try a query like "Using Glean, what's our company's policy on remote work?"
  3. Verify that Claude can access and search your Glean content

Remote MCP Server (Private Beta)

The Remote MCP Server is built directly into Glean's platform, providing enterprise-grade hosting, security, and performance without requiring any local setup or maintenance.

Private Beta Status

The Remote MCP Server is currently in private beta. It's available to select enterprise customers and requires special access from the Glean team.

Key Benefits

  • Zero Setup: No installation, configuration, or maintenance required
  • Enterprise Security: Built on Glean's secure, SOC 2 compliant infrastructure
  • High Performance: Enterprise SLA with guaranteed uptime and response times
  • Automatic Updates: Always running the latest features and security patches
  • Centralized Management: IT teams can manage access and permissions centrally
  • Scalable: Handles enterprise-scale workloads without performance degradation

How It Works

The Remote MCP Server operates as a cloud service within Glean's infrastructure:

  1. Direct Integration: MCP clients connect directly to Glean's hosted endpoints
  2. Authentication: Uses your existing Glean authentication and permissions
  3. Real-time Access: Provides live access to your organization's knowledge base
  4. Audit & Compliance: Full audit logging and compliance reporting available

Enhanced Capabilities

The Remote MCP Server provides a different set of tools optimized for enterprise use. Specific tool details and capabilities are shared with beta participants upon access approval.

Beta Access

To join the Remote MCP Server private beta:

Request Beta Access

What to Include in Your Request:

  • Your organization name and Glean instance
  • Intended use cases for MCP integration
  • Expected number of users

Next Steps

  1. Choose Your Approach: Review the comparison table above
  2. Local Setup: Follow the configuration guide for immediate access
  3. Beta Access: Contact Glean for Remote MCP Server access
  4. Integration: Connect your favorite MCP-compatible tools (Cursor, VS Code, Claude, etc.)