Skip to main content
Glama
tonyromero-ai

Glean Chatbot

Glean Chatbot

社内の契約ドキュメントの小規模なセットを Glean にインデックス登録し、それらのドキュメントに基づいて Search + Chat で質問に回答し、同じフローを MCP ツール(ask_glean)として公開します。

要件

  • Python 3.10+

  • Glean インスタンス

  • Indexing API トークン

  • Search と Chat のスコープを持つ Client API トークン

Related MCP server: Glean Remote MCP Server

セットアップ

  1. リポジトリをクローンして移動します:

git clone <your-repo-url>
cd glean-chatbot
  1. 依存関係をインストールします:

pip install -r requirements.txt
  1. サンプルから .env を作成し、値を入力します:

# macOS / Linux
cp .env.example .env

# Windows (PowerShell)
copy .env.example .env

変数

必須

目的

GLEAN_INSTANCE

必須

インスタンス名(https://<instance>-be.glean.com

GLEAN_INDEXING_TOKEN

必須

Indexing API トークン

GLEAN_CLIENT_TOKEN

必須

Client API トークン(Search + Chat)

GLEAN_ACT_AS

必須*

X-Glean-ActAs に使用するユーザーのメールアドレス(*グローバルクライアントトークンを使用する場合に必要)

GLEAN_DATASOURCE

任意

データソース名(デフォルトは interviewds

GLEAN_DATASOURCE_DISPLAY

任意

Glean UI での表示名

GLEAN_URL_REGEX

任意

すべてのドキュメントの viewURL が一致しなければならない正規表現

.envconfig.pypython-dotenv 経由)によって自動的に読み込まれます。source する必要はありません。

実行

ドキュメントのインデックス登録

python scripts/index_documents.py
# optional: wait until Search can find them
python scripts/index_documents.py --verify

CLI から質問する

python scripts/ask.py "Who owns the Enronry Tony contract?"
python scripts/ask.py "What must OKLightning Tony deliver before go-live?" --top-k 3

MCP (Cursor)

プロジェクト設定は .cursor/mcp.json にあります(src/mcp_server.py の絶対パス + 環境変数)。編集後は Cursor を再起動するか MCP を再読み込みしてください。ツールは ask_glean です。

サーバー単体のスモークテスト:

python src/mcp_server.py

テスト

python tests/test_pipeline.py

ネットワークは使用しません。Search/Chat をモックします。

仕組み

scripts/index_documents.py は Indexing API 経由で data/documents.json をプッシュします。クエリ時には、src/pipeline.py が Search を呼び出し、ヒットがある場合のみ、そのヒットをクローズドブックのコンテキストとして Chat を呼び出し、回答と出典を返します。CLI と MCP はどちらも同じパイプラインを呼び出します。結果は自社ドキュメントに限定されます。Search が何も返さない場合は、回答を捏造するのではなく、類似したドキュメントのタイトルを提案します。

注意事項 / 制限事項

  • 共有サンドボックスは datasourcesFilter を無視するため、ドキュメント ID の接頭辞(CUSTOM_<DATASOURCE>_Contract_)でクライアント側のフィルタリングをしています。

  • インデックス登録は非同期です。ドキュメントが検索可能になるまで数分かかる場合があります。

  • デモ用ドキュメントは allowAnonymousAccess: true を使用しています。本番環境では有効にしないでください。

  • ドキュメントの viewURLGLEAN_URL_REGEX に一致する必要があります。一致しない場合、インデックス登録が拒否されます。

API のトレードオフと本番運用に関する注意点については DESIGN_NOTE.md を参照してください。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables semantic search and retrieval of personal and team knowledge from connected sources like Slack, Gmail, Google Drive, and Dropbox, with the ability to save new information for future recall.
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants and developer tools to securely access and interact with an organization's enterprise knowledge, documents, and people through natural language while respecting existing access permissions.
    164
    MIT
  • F
    license
    Not graded
    quality
    F
    maintenance
    Enables semantic search across documentation stored in Gemini FileSearchStores, returning AI-generated answers with source citations.
    1

View all related MCP servers

Related MCP Connectors

  • Search your knowledge bases from any AI assistant using hybrid RAG.

  • Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.

  • Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tonyromero-ai/glean-chatbot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server