ScopeGate
Provides integration with GitHub, enabling AI agents to perform authorized actions via a granular permission gateway.
Allows AI agents to read, send, search emails, and list labels in Gmail, with granular permissions.
Allows AI agents to list, create, update, and delete events on Google Calendar.
Allows AI agents to list, read, create, and delete files on Google Drive.
ScopeGate
AI Access Proxy Layer. Connect external services (e.g. Google), define granular permissions, and receive an MCP endpoint URL for use in AI agents. Acts as a permission gateway — exposing only the specific capabilities you authorize, more granular than native OAuth scopes.
Tech Stack
Framework: Next.js 16 (App Router)
Language: TypeScript
Database: PostgreSQL + Prisma 7
UI: Tailwind CSS v4, shadcn/ui
Auth: Better Auth (database-backed sessions, Prisma adapter)
MCP:
@modelcontextprotocol/sdk(Streamable HTTP)Package Manager: pnpm
Related MCP server: mcpgate
Quick Start (self-hosted)
Full feature parity with the hosted cloud version — nothing is cut for self-host.
git clone https://github.com/alifanov/scopegate.git
cd scopegate
docker compose --profile local upOpen http://localhost:3000. No .env file needed: a local
Postgres and a fresh BETTER_AUTH_SECRET are provisioned automatically, and the
generated admin login is printed once in the app container logs on first boot
(look for Generated admin login) — search it with docker compose logs app | grep -A4 "First run".
The password is also saved to the app_data volume so it survives restarts.
To connect real services (Gmail, LinkedIn, GitHub, …), copy .env.example to .env
and fill in the OAuth client id/secret for the providers you want — every block is
independent and optional, a provider without credentials simply doesn't show up.
Development Setup
Prerequisites
Node.js 18+
pnpm
PostgreSQL
Setup
Clone the repository and install dependencies:
pnpm installCopy the environment file and fill in your values:
cp .env.example .envVariable | Description |
| PostgreSQL connection string |
| Secret key for session signing |
| App base URL (e.g. |
| Bootstrap admin email |
| Bootstrap admin password |
Run database migrations:
pnpm prisma migrate devStart the development server:
pnpm devOpen http://localhost:3000.
Project Structure
src/
├── app/
│ ├── (auth)/ # Login & register pages
│ ├── (dashboard)/ # Protected dashboard pages
│ │ └── projects/ # Project management, endpoints, audit, settings
│ ├── api/
│ │ ├── auth/[...all]/ # Better Auth catch-all handler
│ │ ├── projects/ # Projects CRUD, endpoints, services, audit
│ │ └── mcp/[apiKey]/ # MCP Streamable HTTP handler
│ ├── layout.tsx
│ └── page.tsx # Landing page
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── layout/ # Sidebar, header
│ └── shared/ # Reusable app components
├── lib/
│ ├── db.ts # Prisma client singleton
│ ├── auth.ts # Better Auth server instance
│ ├── auth-client.ts # Better Auth client SDK
│ ├── auth-middleware.ts # getCurrentUser() helper
│ ├── bootstrap.ts # Admin user bootstrap on empty DB
│ └── mcp/
│ ├── permissions.ts # Permission groups (source of truth)
│ ├── tools.ts # MCP tool definitions
│ └── handler.ts # MCP server factory
├── generated/prisma/ # Generated Prisma client
└── middleware.ts # Route protectionAvailable Scripts
pnpm dev # Start development server
pnpm build # Production build
pnpm start # Start production server
pnpm lint # Run ESLint
pnpm prisma generate # Regenerate Prisma client
pnpm prisma migrate dev # Create and apply migrations
pnpm prisma studio # Open Prisma Studio (DB browser)How It Works
Login — sign in with admin credentials (bootstrapped from env vars on first run)
Create a Project — organize endpoints and services by project
Connect a Service — add a service connection to the project
Create an MCP Endpoint — select a service connection and pick specific permissions (e.g.
gmail:read_emails,calendar:create_event)Use the MCP URL — plug the endpoint URL into any MCP-compatible AI agent; only the allowed actions are exposed
Monitor — track every request in the audit log
Permissions
Permissions are defined in src/lib/mcp/permissions.ts and grouped by service:
Group | Actions |
Gmail |
|
Google Calendar |
|
Google Drive |
|
Database Schema
User — authentication, team membership
Session — database-backed auth sessions
Account — auth provider credentials (email/password)
Project — logical grouping for services and endpoints
TeamMember — user-project relationship with roles (owner/member)
ServiceConnection — OAuth tokens for connected services
McpEndpoint — MCP endpoint with API key, rate limit, active status
EndpointPermission — allowed actions per endpoint
AuditLog — request log with action, status, duration, errors
License
See LICENSE.
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
- Alicense-qualityCmaintenanceSelf-hosted credential store and API proxy for AI agents. One Bearer token, all your services. Handles OAuth refresh, encrypted storage, audit logging, and per-agent permissioning.63MIT

mcpgateofficial
Flicense-qualityAmaintenanceSelf-hosted MCP gateway that connects Claude, ChatGPT, and other AI agents to 20+ enterprise tools (GitLab, Jira, Notion, Google Workspace, Slack, Grafana, …) with OAuth, audit logs, and zero data leaving your infrastructure- AlicenseAqualityAmaintenanceLocal zero-trust permission gateway for AI agents. Enforces policy-based tool authorization, human approvals, scoped permissions, and cryptographically verifiable audit logs.45Apache 2.0
- Alicense-qualityBmaintenanceGives AI coding agents (Claude Code, Cursor, etc.) unified, secure access to dev infrastructure (Vercel, GitHub, Supabase, Cloudflare, GCP) via a single MCP token.MIT
Related MCP Connectors
Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.
Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
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/alifanov/scopegate'
If you have feedback or need assistance with the MCP directory API, please join our Discord server