Skip to content

aaronsb/glean-mcp-server

 
 

Repository files navigation

@gleanwork/mcp-server

CI Build npm version License

A Model Context Protocol (MCP) server implementation for Glean's search and chat capabilities. This server provides a standardized interface for AI models to interact with Glean's content search and conversational AI features through stdio communication.

Features

  • 🔍 Search Integration: Access Glean's powerful content search capabilities
  • 💬 Chat Interface: Interact with Glean's AI assistant
  • 🔄 MCP Compliant: Implements the Model Context Protocol specification

Prerequisites

  • Node.js v18 or higher
  • Glean API credentials

Installation

With npm:

npm install @gleanwork/mcp-server

With pnpm:

pnpm install @gleanwork/mcp-server

With yarn:

yarn add @gleanwork/mcp-server

Configuration

  1. Set up your Glean API credentials:
export GLEAN_SUBDOMAIN=your_subdomain
export GLEAN_API_TOKEN=your_api_token
  1. (Optional) For global tokens that support impersonation:
export GLEAN_ACT_AS=user@example.com

MCP Client Configuration

To configure this MCP server in your MCP client (such as Claude Desktop, Windsurf, Cursor, etc.), add the following configuration to your MCP client settings:

{
  "mcpServers": {
    "glean": {
      "command": "npx",
      "args": ["-y", "@gleanwork/mcp-server"],
      "env": {
        "GLEAN_SUBDOMAIN": "<glean instance subdomain>",
        "GLEAN_API_TOKEN": "<glean api token>"
      }
    }
  }
}

Replace the environment variable values with your actual Glean credentials.

Tools

glean_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.

For complete parameter details, see Search API Documentation

glean_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.

For complete parameter details, see Chat API Documentation

Running the Server

The server communicates via stdio, making it ideal for integration with AI models and other tools:

node build/index.js

Running in inspect mode

The server can also be run in inspect mode, which provides additional debugging information:

pnpm inspector

This will run MCP's inspector, which allows you to execute and debug calls to the server.

Contributing

Please see CONTRIBUTING.md for development setup and guidelines.

License

MIT License - see the LICENSE file for details

Support

About

MCP server for Glean API integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 95.2%
  • JavaScript 4.8%