Skip to main content

Python client + MCP server adapter for Glean (search, chat, read documents). Provides a reusable HTTP client plus simple sync helper functions.

Project description

Glean MCP Library & Utilities

Lightweight Python package providing:

  • Async GleanClient for search, chat, document retrieval
  • Synchronous helper functions returning JSON strings
  • CLI (glean-mcp) for quick terminal usage

Links: Releases · Filtering Details · Cookie Guide · Publishing

Installation

pip install glean-mcp
# or with performance extra
pip install 'glean-mcp[perf]'

Quick Start (Library)

import os
from glean_mcp import glean_search
os.environ['GLEAN_BASE_URL'] = 'https://your-company-be.glean.com'
os.environ['GLEAN_COOKIES'] = '<cookie string>'
print(glean_search('onboarding docs'))

Quick Start (CLI)

export GLEAN_BASE_URL=https://your-company-be.glean.com
export GLEAN_COOKIES='<cookie string>'

glean-mcp search "onboarding"
glean-mcp chat "How do I rotate credentials?"
glean-mcp read-docs id=12345 url=https://docs.google.com/document/d/... 

Functions

Function Description
glean_search(query, page_size=10) Search documents (JSON string)
glean_chat(message) Chat answer (JSON string)
glean_read_documents(specs) Retrieve documents (JSON string)

Underlying async usage: create GleanClient(base_url, cookies) and await its methods.

Environment Variables

Var Required Purpose
GLEAN_BASE_URL Yes Backend instance URL
GLEAN_COOKIES Yes Auth cookies (see docs/COOKIES.md)

Development

git clone https://github.com/alankyshum/glean-mcp-server.git
cd glean-mcp-server
python -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
pytest -q

Versioning & Publishing

Tag vX.Y.Z after updating version strings; GitHub Action publishes if versions match. See PUBLISHING.md.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glean_mcp-2.0.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glean_mcp-2.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file glean_mcp-2.0.0.tar.gz.

File metadata

  • Download URL: glean_mcp-2.0.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for glean_mcp-2.0.0.tar.gz
Algorithm Hash digest
SHA256 65b1160eea839e30caa750993eb7904d6053dd8279d46052dacea048b5963720
MD5 d9957ffe855414a0613bb4a9a0efc39a
BLAKE2b-256 21e3ca7b9396182dfb5f5c5b30d1c2ec1b2f0c989377330633a26eeab9463adf

See more details on using hashes here.

File details

Details for the file glean_mcp-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: glean_mcp-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for glean_mcp-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f419ec50647a8fbf6ec87c01b08396ae43d9e7c3cf8e6f508873d165fee887c
MD5 8357cdba9ca4dc162dfe373c4a7a0ad3
BLAKE2b-256 06d72d82774846004f9eafe5c84c40ed5efbb420efce5acde788c814738906e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page