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-0.1.2.tar.gz (6.9 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-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for glean_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 29a3cc6d3c6225b5656839104a2b0e5176f4aea03419a586b786a4f129ee3003
MD5 a93c252b304199c97ea892a898914b0b
BLAKE2b-256 9e35542361ce6ef134031f462d6e05a805f689b221cfea627895b3bc03ebd1b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: glean_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8cb41319a555bf7c35840153792f5cd30f51a859e98c07f16125e7fd9c90606f
MD5 1ebd812b0bbcb4faaa39f165361e7938
BLAKE2b-256 248a924843441952f706509a68e7d02dce25ae75d89cb9f66e2030014044fb0a

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