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.
13 stars3 watching2 forks

@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

Tools

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

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 inspect

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

Features

search
chat
protocol
integration

Category

Search