glean-local-mcp
v1.5.1
Published
Generic Glean MCP Server with OAuth support for any IDE supporting Model Context Protocol
Downloads
110
Maintainers
Readme
glean-local-mcp
OAuth wrapper for @gleanwork/local-mcp-server - enables Cursor and other MCP clients to use Glean with OAuth 2.0 authentication.
Repository: https://github.com/theplenkov-npm/glean-local-mcp
Installation
bun install -g glean-local-mcpOr use with bunx (no installation):
bunx glean-local-mcpConfiguration
The wrapper loads configuration in this order (later sources override earlier):
~/.glean/mcp-config.json(persistent, user-specific)- Environment variables (temporary, session-specific)
Option 1: User Config File (Recommended)
Create ~/.glean/mcp-config.json:
{
"clientId": "your_client_id",
"clientSecret": "your_client_secret",
"issuerUrl": "https://your-company.okta.com",
"apiBaseUrl": "https://your-company-be.glean.com"
}Then just run:
bunx glean-local-mcpOption 2: Environment Variables
Set via shell, .env file (with node --env-file), or IDE configuration.
Usage
With Cursor
If using ~/.glean/mcp-config.json (recommended):
{
"mcpServers": {
"glean": {
"command": "bunx",
"args": ["glean-local-mcp"]
}
}
}Or with environment variables:
{
"mcpServers": {
"glean": {
"command": "bunx",
"args": ["glean-local-mcp"],
"env": {
"GLEAN_CLIENT_ID": "your_client_id",
"GLEAN_CLIENT_SECRET": "your_client_secret",
"OAUTH_ISSUER_URL": "https://your-company.okta.com",
"GLEAN_SERVER_URL": "https://your-company-be.glean.com"
}
}
}
}Restart Cursor. On first use, your browser opens for OAuth login.
With Other MCP Clients
Use the same configuration pattern with your MCP client's config file.
Configuration Reference
Configuration can be set in ~/.glean/mcp-config.json or via environment variables.
| Field / Variable | Required | Description |
|------------------|----------|-------------|
| clientId / GLEAN_CLIENT_ID | Yes | OAuth Client ID |
| clientSecret / GLEAN_CLIENT_SECRET | Yes | OAuth Client Secret |
| issuerUrl / OAUTH_ISSUER_URL | Yes | OAuth provider URL (supports OIDC discovery) |
| apiBaseUrl / GLEAN_SERVER_URL | Yes | Glean API base URL (e.g., https://company-be.glean.com) |
| redirectUri / REDIRECT_URI | No | OAuth callback (default: http://localhost:8080/...) |
| oauthPort / OAUTH_PORT | No | Callback port (default: 8080) |
| scopes / OAUTH_SCOPES | No | Comma-separated scopes (default: openid,email,profile,offline_access) |
How It Works
Your IDE → OAuth Wrapper → @gleanwork/local-mcp-server → Glean API
↓
• Authenticates via OAuth
• Stores tokens locally
• Refreshes automatically
• Passes to local-mcp-serverFeatures
- ✅ OAuth 2.0 authentication via browser
- ✅ Automatic token refresh (every 5 minutes)
- ✅ Token persistence between sessions
- ✅ Zero HTTP dependencies (native fetch/http)
- ✅ Works with official Glean MCP tools
Token Storage
Tokens are securely stored in ~/.glean/tokens.json by default. Override with TOKEN_STORAGE_PATH if needed.
Troubleshooting
"Missing OAuth configuration"
- Verify all required environment variables are set
"Port already in use"
- Change
OAUTH_PORTto a different port - Update
REDIRECT_URIto match
Authentication fails
- Clear tokens:
rm ~/.glean/tokens.json - Try again
Requirements
- Node.js 24.0.0+
- OAuth credentials for your Glean instance
Contributing
Contributions are welcome! Please visit the repository to:
License
MIT - See LICENSE for details.
