Glean Connector MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Glean Connector MCP ServerScaffold a new Glean connector for Jira"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@gleanwork/connector-mcp
An MCP server for AI-assisted Glean connector development. Add it to your IDE's MCP config and use Claude Code, Cursor, or any MCP-compatible AI assistant to scaffold, schema-map, generate, and test Glean connectors — without leaving your editor.
Prerequisites
Node.js ≥ 20
Python + uv (for
run_connectorand Copier scaffolding)A Glean API token
Related MCP server: Glean MCP Server
Setup
Claude Code
Add to .claude/mcp.json in your project (or ~/.claude/mcp.json globally):
{
"mcpServers": {
"local": {
"command": "npx",
"args": [
"-y",
"@gleanwork/connector-mcp"
],
"type": "stdio"
}
}
}For setup instructions for Cursor, VS Code, Windsurf, Goose, Codex, JetBrains, Gemini CLI, OpenCode, and more, see docs/setup.md.
Environment Variables
These are set in the MCP server config, not in your connector project.
Variable | Required | Description |
| No | Default project directory; overridden by |
| No | Path to a custom Copier template (defaults to |
| No | Command to start the Python worker (default: |
| No | Max seconds to wait for a worker JSON-RPC response (default: 30) |
| No | Seconds to wait for graceful worker shutdown before SIGKILL (default: 5) |
GLEAN_INSTANCE and GLEAN_API_TOKEN belong in your connector project's .env file — create_connector generates a .env.example to get you started.
Quick Start
In your AI assistant, try:
"I want to build a Glean connector for our Salesforce Opportunities data. The API uses OAuth2 bearer tokens and returns paginated JSON. Let's start."
Or call get_started — the assistant will ask what you're connecting and walk you through the rest.
Core Workflow
Six steps from zero to a running connector. The assistant guides you through each one.
Step | What you're doing | Tool |
0 | Verify prerequisites |
|
1 | Scaffold the project |
|
2 | Configure the data source |
|
3 | Define the schema (infer from a sample file or write it) |
|
4 | Map fields and verify required Glean fields are covered |
|
5 | Generate the Python connector code |
|
5a | Implement real API calls in data_client.py |
|
6 | Run the connector and inspect results |
|
Tool Reference
Project Setup
Tool | Description |
| Open the guided workflow; the assistant asks what you're connecting |
| Verify uv, python, mise, copier, and Glean credentials are all configured |
| Scaffold a new connector project and set the active session path |
| List all connector classes found in the project with their DataClient status |
| Write connector config (auth, endpoint, pagination) to |
| Read |
Schema
Tool | Description |
| Parse a |
| Read current |
| Write field definitions to |
| Deep-dive on a single field: samples, type, Glean mapping suggestions |
Field Mapping
Tool | Description |
| Show source schema and Glean entity model side-by-side |
| Save field mapping decisions to |
| Check mappings for missing required Glean fields |
Data Client
Tool | Description |
| Read |
| Write a new |
Build & Run
Tool | Description |
| Generate |
| Start async connector execution; returns |
| Poll execution status; returns records, validation issues, logs |
| Record/replay/list/delete connector data recordings |
Project Layout
After create_connector, your project directory looks like:
my-connector/
├── src/
│ └── {module_name}/
│ ├── connector.py ← generated by build_connector
│ ├── models.py ← generated TypedDict for source data
│ └── mock_data.json ← sample data for local testing
├── CLAUDE.md ← workflow guidance (for Claude Code users)
└── .glean/
├── schema.json ← field schema
├── mappings.json ← field mappings to Glean entity model
├── config.json ← connector configuration
├── executions/ ← execution results (written on completion)
└── recordings/ ← captured API responses for replayMCP Resource
The server exposes a connector://workflow resource that returns the full authoring guide. Your AI assistant can fetch it at session start for workflow context.
Known Limitations
Single project per MCP session. The server tracks one active project at a time. To switch projects, set
GLEAN_PROJECT_PATHin the MCP server config or restart the server after runningcreate_connectorfor the new project.Execution state is in-memory. Active execution history is lost when the MCP server restarts. Completed execution results written to
.glean/executions/persist on disk, but any in-progress executions must be re-run.
Troubleshooting
spawn uv ENOENT
uv is not installed or is not on your PATH. The server requires uv to scaffold connector projects and to run the Python worker.
Install it following the official uv instructions, then verify:
uv --versionIf uv is installed but not on the PATH seen by your IDE, add it explicitly in the MCP server env config or set GLEAN_WORKER_COMMAND to the full path of an alternative command.
Copier template not found
The server could not locate the copier-glean-connector template. By default it looks for the template alongside this package in the Glean workspace or clones it from github.com/gleanwork over SSH.
Set the GLEAN_CONNECTOR_TEMPLATE_PATH environment variable to the absolute path of a local checkout of the template:
{
"env": {
"GLEAN_CONNECTOR_TEMPLATE_PATH": "/path/to/copier-glean-connector"
}
}Worker exited / glean.indexing.worker module not found
The Python worker process exited immediately. This usually means one of:
You are not inside a Copier-scaffolded connector project. The
run_connectortool must be called aftercreate_connectorhas set up the project directory with the correctpyproject.tomland dependencies.The
glean-indexing-sdkis not installed in the project's virtual environment. Runuv syncinside the connector project directory to install dependencies.Wrong working directory. Ensure
GLEAN_PROJECT_PATHpoints to the connector project root, or runcreate_connectorfirst to set the active session path automatically.
Available Tools
19 toolsanalyze_fieldB
Deep-dive on a single field from the current schema: samples, type details, and Glean mapping suggestions.
Inputs: field_name (required).
build_connectorA
Generate Python connector files from schema + mappings + config. Use dry_run: true to preview the generated code without writing files.
Inputs: dry_run, connector_name, datasource_type.
check_prerequisitesB
Check that all required tools and credentials are installed and configured.
Inputs: no named parameters.
confirm_mappingsA
Save field mapping decisions to .glean/mappings.json. Merges with any existing mappings.
Inputs: mappings (required).
create_connectorA
Scaffold a new Glean connector project using the standard template. Call this after get_started. Sets the active project directory for this session.
Inputs: name (required), description, datasource_type, parent_directory, +1 more.
get_configA
Read the current connector configuration from .glean/config.json.
Inputs: no named parameters.
get_data_clientA
Read data_client.py for a module — use before asking AI to implement real API calls.
Inputs: module_name (required).
get_mappingsA
Return the current source schema alongside the Glean entity model so you can decide which source field maps to which Glean field.
Inputs: no named parameters.
get_schemaA
Read the current field schema from .glean/schema.json.
Inputs: no named parameters.
get_startedA
Entry point for building a Glean connector. Returns an opening prompt that orients the AI and asks the user what data source they want to connect. Call this before any other tool.
Inputs: no named parameters.
infer_schemaA
Parse a data file (.csv, .json, .ndjson) and return field analysis: detected types, null rates, cardinality, and sample values. Use this to understand the source data before defining mappings.
Inputs: file_path (required), save.
inspect_executionA
Check execution status and retrieve records. Returns status, records fetched, per-record validation results, and recent logs.
Inputs: execution_id (required), limit, offset.
list_connectorsA
List all connector classes found in this project with their module paths.
Inputs: no named parameters.
manage_recordingB
Manage connector recordings. action: "record" saves fetched data, "replay" runs from a saved file, "list" shows available recordings, "delete" removes one.
Inputs: no named parameters.
run_connectorA
Start async execution of the Python connector. Returns an execution_id immediately. Poll status with inspect_execution.
Inputs: recording_id, connector_name.
set_configA
Write connector configuration to .glean/config.json. Merges with existing config. Code-generation keys (consumed by build_connector): name, display_name, datasource_category, url_regex, icon_url, connector_type. Runtime-only keys (used by the connector at execution time, not during code generation): auth_type, endpoint, api_key_header, page_size, rate_limit_rps.
Inputs: config (required).
update_data_clientC
Write a new data_client.py implementation (replaces the mock with real API calls).
Inputs: code (required), module_name (required).
update_schemaA
Write field definitions to .glean/schema.json. Call this after infer_schema to save the agreed schema, or to make manual edits. Set merge: true to merge incoming fields with the existing schema (fields with the same name are replaced; new names are appended) instead of replacing the entire field list.
Inputs: fields (required), merge.
validate_mappingsA
Check current mappings against Glean's entity model. Reports missing required fields and type mismatches.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 19 tools
Each tool has a clearly distinct purpose, covering different aspects of connector development: scaffolding, schema inference, mapping, configuration, building, execution, and monitoring. No two tools appear to do the same thing.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., get_schema, create_connector, infer_schema). The only slight deviation is get_started, but it still follows a verb-like prefix, maintaining overall consistency.
With 19 tools, the count is appropriate for the complex domain of building a Glean connector. Each tool fulfills a specific need without being overwhelming or sparse.
The tool surface covers the full lifecycle: from starting a project (get_started, create_connector) through schema inference, mapping, configuration, code generation, execution, and monitoring. Obvious gaps (e.g., testing) are minimal and likely covered by inspect_execution and manage_recording.
Maintenance
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that integrates the Glean API to provide search results and chatbot interaction.10MIT
- AlicenseBqualityFmaintenanceA Model Context Protocol server that provides AI assistants with access to Glean's enterprise knowledge features, including content search, people directory, and AI chat capabilities.38 npm62MIT
- -licenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables developers to summon AI development team agents directly from their IDE to help with tasks like PR reviews, security evaluation, and CI/CD deployment setup.-
- AlicenseNot gradedqualityBmaintenanceA production-ready MCP server that enables AI assistants to intelligently understand, analyze, edit, navigate, and review software projects with multi-workspace support, Git integration, and semantic search.1MIT