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
安装与设置
克隆并进入仓库:
git clone <your-repo-url>
cd glean-chatbot安装依赖:
pip install -r requirements.txt根据示例创建
.env并填入你的取值:
# macOS / Linux
cp .env.example .env
# Windows (PowerShell)
copy .env.example .env变量 | 是否必需 | 用途 |
| 是 | 实例名称( |
| 是 | Indexing API 令牌 |
| 是 | Client API 令牌(支持 Search + Chat) |
| 是* | 用于 |
| 否 | 数据源名称(默认为 |
| 否 | 在 Glean UI 中显示的名称 |
| 否 | 每个文档 |
.env 由 config.py 自动加载(通过 python-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 3MCP (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 都调用同一个 pipeline。结果被限制在我们自己的文档范围内;如果 Search 没有返回任何内容,我们会推荐相近的文档标题,而不是凭空编造答案。
备注 / 限制
共享沙箱会忽略
datasourcesFilter;我们在客户端按文档 id 前缀(CUSTOM_<DATASOURCE>_Contract_)进行过滤。索引是异步的——文档可能需要几分钟才能被搜索到。
演示文档使用了
allowAnonymousAccess: true。请勿将其带到生产环境。文档的
viewURL必须匹配GLEAN_URL_REGEX,否则索引会将其拒绝。
关于 API 的取舍与生产环境注意事项,请参阅 DESIGN_NOTE.md。
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityDmaintenanceEnables 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

Glean Remote MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceEnables 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.164MIT- FlicenseNot gradedqualityFmaintenanceEnables semantic search across documentation stored in Gemini FileSearchStores, returning AI-generated answers with source citations.1

Rememberizer MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceEnables querying and managing personal/team internal knowledge from sources like Slack, Gmail, and Drive through semantic search and retrieval.Apache 2.0
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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