Get Started
Indexing
- Get Started
- Guides
- Authentication
- Datasources
- Documents
- Debugging
- API Reference
- OpenAPI Spec
Client
- Get Started
- Guides
- Search
- Governance
- API Reference
- OpenAPI Spec
Web SDK
- Get Started
- Components
- Guides
Actions
- Get Started
- Examples
Model Context Protocol
Connect Glean to AI models with MCP
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.
MCP Server
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:
company_search
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.
people_profile_search
Search Glean’s People directory to find employee information.
Configuration
API Tokens
You’ll need Glean API credentials, and specifically a user-scoped API token. API Tokens require the following scopes: chat
, search
. You should speak to your Glean administrator to provision these tokens.
Currently, our MCP implementation uses API tokens for authentication. While the MCP specification includes optional authorization mechanisms and there is an active RFC to add OAuth 2.0 support, we’re using a simple token-based approach for now. Once the OAuth specification is finalized and widely adopted in the MCP ecosystem, we plan to implement OAuth-based authentication for enhanced security and user management.
IDE Integrations
Configure Cursor
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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.
Using explicit domain
and token
flags:
npx @gleanwork/mcp-server configure --client cursor --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client cursor --env <path-to-env-file>
Test the Integration
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.
- Open a new chat in Cursor
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Cursor can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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.
Using explicit domain
and token
flags:
npx @gleanwork/mcp-server configure --client cursor --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client cursor --env <path-to-env-file>
Test the Integration
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.
- Open a new chat in Cursor
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Cursor can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure Cursor
- Click “Cursor” in the menu bar
- Select “Settings”
- Click “Cursor Settings”
- Navigate to the “MCP” section
- Click “Add new global MCP server”
- Add the following configuration to the opened
mcp.json
file:
{
"mcpServers": {
"glean": {
"command": "npx",
"args": ["-y", "@gleanwork/mcp-server"],
"env": {
"GLEAN_INSTANCE": "<your-glean-instance-name>",
"GLEAN_API_TOKEN": "<your-glean-api-token>"
}
}
}
}
- Close the file to save the configuration
Your MCP server should now be listed and Enabled, as shown below.
Test the Integration
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.
- Open a new chat in Cursor
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Cursor can access and search your Glean content
Configure Windsurf
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 domain
and token
flags:
npx @gleanwork/mcp-server configure --client windsurf --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client windsurf --env <path-to-env-file>
Test the Integration
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.
- Open a new chat in Windsurf
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Windsurf can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 domain
and token
flags:
npx @gleanwork/mcp-server configure --client windsurf --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client windsurf --env <path-to-env-file>
Test the Integration
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.
- Open a new chat in Windsurf
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Windsurf can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure Windsurf
- Click “Windsurf” in the menu bar
- Select “Settings”
- Click “Windsurf Settings”
- Under “Cascade / Model Context Protocol (MCP) Servers”
- Click “Add Server”
- Click “Add Custom Server”
- Add the following configuration to the opened
mcp_config.json
file:
{
"mcpServers": {
"glean": {
"command": "npx",
"args": ["-y", "@gleanwork/mcp-server"],
"env": {
"GLEAN_INSTANCE": "<your-glean-instance-name>",
"GLEAN_API_TOKEN": "<your-glean-api-token>"
}
}
}
}
- Close the file to save the configuration
Your MCP server should now be listed in the servers section, as shown below.
Test the Integration
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.
- Open a new chat in Windsurf
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Windsurf can access and search your Glean content
Configure VS Code
VS Code supports global MCP server configuration that applies across all your workspaces. This is ideal for personal use.
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 @gleanwork/mcp-server configure --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client vscode --env <path-to-env-file>
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 @gleanwork/mcp-server configure --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client vscode --env <path-to-env-file>
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure VS Code
- Open VS Code Command Palette (⌘⇧P / Ctrl+Shift+P)
- Run “MCP: Add Server” command
- Select “User Settings” when prompted
- Or manually edit your
settings.json
and add:
{
"mcp": {
"servers": {
"glean": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@gleanwork/mcp-server"],
"env": {
"GLEAN_INSTANCE": "<your-glean-instance-name>",
"GLEAN_API_TOKEN": "<your-glean-api-token>"
}
}
}
}
}
- Use “MCP: List Servers” command to view and manage your configured servers
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
VS Code supports global MCP server configuration that applies across all your workspaces. This is ideal for personal use.
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 @gleanwork/mcp-server configure --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client vscode --env <path-to-env-file>
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 @gleanwork/mcp-server configure --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client vscode --env <path-to-env-file>
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure VS Code
- Open VS Code Command Palette (⌘⇧P / Ctrl+Shift+P)
- Run “MCP: Add Server” command
- Select “User Settings” when prompted
- Or manually edit your
settings.json
and add:
{
"mcp": {
"servers": {
"glean": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@gleanwork/mcp-server"],
"env": {
"GLEAN_INSTANCE": "<your-glean-instance-name>",
"GLEAN_API_TOKEN": "<your-glean-api-token>"
}
}
}
}
}
- Use “MCP: List Servers” command to view and manage your configured servers
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
VS Code supports workspace-specific MCP server configuration stored in .vscode/mcp.json
. This is ideal for teams to share configurations.
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure VS Code
Run the following command from your workspace root to configure Glean’s MCP server for this workspace.
Using explicit instance
and token
flags:
npx @gleanwork/mcp-server configure --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token> --workspace
Using a .env
file:
npx @gleanwork/mcp-server configure --client vscode --env <path-to-env-file> --workspace
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure VS Code
Run the following command from your workspace root to configure Glean’s MCP server for this workspace.
Using explicit instance
and token
flags:
npx @gleanwork/mcp-server configure --client vscode --instance <your-glean-instance-name> --token <your-glean-api-token> --workspace
Using a .env
file:
npx @gleanwork/mcp-server configure --client vscode --env <path-to-env-file> --workspace
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure VS Code
- Create a
.vscode/mcp.json
file in your workspace root - Add the following configuration:
{
"inputs": [
{
"type": "promptString",
"id": "glean-instance",
"description": "Glean Instance"
},
{
"type": "promptString",
"id": "glean-api-token",
"description": "Glean API Token",
"password": true
}
],
"servers": {
"glean": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@gleanwork/mcp-server"],
"env": {
"GLEAN_INSTANCE": "${input:glean-instance}",
"GLEAN_API_TOKEN": "${input:glean-api-token}"
}
}
}
}
- Save the file. VS Code will automatically detect the MCP server configuration
- A “Start” button will appear in your
.vscode/mcp.json
file. Click it to start the MCP server - VS Code will prompt you for the instance name and API token when the server first starts
Test the Integration
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.
- Open the Chat view in VS Code (⌃⌘I / Ctrl+Alt+I)
- Select Agent mode from the dropdown
- Click the Tools button to view available MCP tools
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that VS Code can access and search your Glean content
Application Integrations
Claude Desktop
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 domain
and token
flags:
npx @gleanwork/mcp-server configure --client claude --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client claude --env <path-to-env-file>
Test the Integration
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.
- Start a new conversation in Claude Desktop
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Claude can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
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 domain
and token
flags:
npx @gleanwork/mcp-server configure --client claude --instance <your-glean-instance-name> --token <your-glean-api-token>
Using a .env
file:
npx @gleanwork/mcp-server configure --client claude --env <path-to-env-file>
Test the Integration
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.
- Start a new conversation in Claude Desktop
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Claude can access and search your Glean content
Get Credentials
Ensure you have your Glean API credentials ready from the Configuration section above. You’ll need:
- Your Glean instance name
- A user-scoped API token
Configure Claude Desktop
- Click “Claude” in the menu bar
- Select “Settings…”
- Click on “Developer”
- Click “Edit Config” to open your
claude_desktop_config.json
file - Add the following configuration:
{
"mcpServers": {
"glean": {
"command": "npx",
"args": ["-y", "@gleanwork/mcp-server"],
"env": {
"GLEAN_INSTANCE": "<your-glean-instance-name>",
"GLEAN_API_TOKEN": "<your-glean-api-token>"
}
}
}
}
- Save and close the file
- Restart Claude Desktop
The config file is typically located at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Your MCP server should now be listed, as shown below.
Test the Integration
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.
- Start a new conversation in Claude Desktop
- Try a query like “Using Glean, what’s our company’s policy on remote work?”
- Verify that Claude can access and search your Glean content
Was this page helpful?