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

Uploaded Python 3

File details

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

File metadata

  • Download URL: glean_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 7.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.3.tar.gz
Algorithm Hash digest
SHA256 531ba4c5575eb3b84d5d04e4b5ca330fc393c11966a9f1b35ebee75bc4a2a08b
MD5 4f022b2430125401ec52117277d5e2dc
BLAKE2b-256 b63ef70d56e52bcfac59729f1989fd84c51774c43245d491031b9f4431921de3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: glean_mcp-0.1.3-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-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 073feaea49c0294166eec6fc1c920d420fea972290675bcaa651f04c1ad000bd
MD5 5f45446fb305b5428b6b62814a5bb222
BLAKE2b-256 f5855c92bbc1efd5e3c2230f8406bd1e2bf98392d6474a7c636a1756ea913887

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