Alter Multi-User MCP Servers
Officialby AlterAIDev
README.md
# Secure Multi-User MCP Servers
[](https://alterauth.com?utm_source=github&utm_medium=readme&utm_campaign=multi-user-mcp-servers)
[](https://m8ven.ai/mcp/alteraidev-alter-mcp-servers-vx7xd3?s=readme)
[](LICENSE)
**Shared service accounts are why multi-user agents fail security review.** These MCP servers **never hold the provider token**. One server serves Alice and Bob with full isolation, server-side policy, human approvals the client cannot skip, and per-person audit logs.
Unlike a gateway that still uses a shared upstream credential, each server makes the actual API call as the signed-in user. **12 open-source, secure servers** built on [Alter](https://alterauth.com?utm_source=github&utm_medium=readme&utm_campaign=multi-user-mcp-servers) — run locally, deploy on Cloudflare Workers (OAuth 2.1), or host both the MCP servers and Alter together in your own infrastructure (or have us host both). Official APIs only. See the [75-second Alice-vs-Bob walkthrough](docs/demo-script.md).
## Two users, one server, full isolation
<!-- Drop the 60-90s GitHub-hosted MP4/GIF demo right here after recording with docs/demo-script.md -->
```mermaid
flowchart LR
A["Alice (OIDC)"] -->|MCP| S["One MCP Server (zero tokens)"]
B["Bob (OIDC)"] -->|MCP| S
S -->|"agent key"| AL["Alter (policy · approvals · audit)"]
AL -->|"Alice's token"| APIA["Official API (Alice's account)"]
AL -->|"Bob's token"| APIB["Official API (Bob's account)"]
```
```text
Same hosted MCP server: https://alter-gmail-mcp.<your-org>.workers.dev/mcp
Secrets on the server: ALTER_AGENT_API_KEY + ALTER_SIGNIN_KEY (zero provider tokens)
1. Alice signs in via your OIDC IdP ──▶ "Search Q4 budget emails" ──▶ Sees ONLY Alice's inbox
2. Bob signs in via your OIDC IdP ──▶ "Search Q4 budget emails" ──▶ Sees ONLY Bob's inbox
3. Alice's agent calls send_email ──▶ Held by Alter policy ──▶ Alice approves in Slack / Wallet
4. Alter executes the exact email ──▶ Audit log records ──▶ user: alice@acme.com · tool: send_email · approved
```
## Security, policy, and audit
| What the MCP server holds | What the MCP server **never** holds |
|---|---|
| Only an [Alter](https://alterauth.com?utm_source=github&utm_medium=readme&utm_campaign=multi-user-mcp-servers) agent key (`ALTER_AGENT_API_KEY`) | Provider OAuth tokens (Gmail, Slack, GitHub, Jira, HubSpot, Stripe, etc.) |
| Hosted only: Alter sign-in key + hashed per-user session tokens in KV | User passwords, IdP client secrets, or shared service-account keys |
- **Zero token exfiltration:** No provider tokens sit on disk, in env vars, or in KV. A leaked agent key only reaches what policy permits and revokes in one place.
- **Prompt-injection-proof policy & approvals:** Policies and human approval gates run in Alter, outside the model and MCP client — neither a prompt nor a misbehaving client can bypass them.
- **Strict per-user isolation (OAuth 2.1):** Each hosted access token is bound to one OIDC-verified user (`ALLOWED_USERS` allowlist; only token hashes stored in KV).
- **Per-person audit logs:** Every read, write, approval, and denial logs the person, agent, tool, and outcome — ready to stream to your SIEM.
## Servers
- **Productivity & Comms:** [Slack](packages/slack-mcp) · [Gmail](packages/gmail-mcp) · [Google Calendar](packages/google-calendar-mcp) · [Google Drive](packages/google-drive-mcp) · [Notion](packages/notion-mcp)
- **Engineering:** [GitHub](packages/github-mcp) · [Linear](packages/linear-mcp) · [Jira](packages/jira-mcp)
- **GTM & Finance:** [HubSpot](packages/hubspot-mcp) · [Stripe](packages/stripe-mcp) · [LinkedIn](packages/linkedin-mcp) · [X](packages/x-mcp)
> **Human approvals right in Slack:** Pair any server above with [`slack-approvals`](packages/slack-approvals) to send held actions (emails, DMs, PR merges, Stripe refunds) straight to Slack with exact payload previews and **Approve / Deny** buttons — human approval where your team already works.
<details>
<summary>Full tool & default approval catalog (all 12 servers)</summary>
| Server | Package | Tools | Held for approval |
|---|---|---|---|
| [Gmail](packages/gmail-mcp) | `@alter-ai/gmail-mcp` | `search_emails`, `read_email`, `create_draft`, `send_email`, `check_approval` | Sends |
| [LinkedIn](packages/linkedin-mcp) | `@alter-ai/linkedin-mcp` | `get_profile`, `create_post`, `comment_on_post`, `react_to_post`, `check_approval` | Posts, comments and reactions |
| [X (Twitter)](packages/x-mcp) | `@alter-ai/x-mcp` | `get_profile`, `search_posts`, `get_mentions`, `create_post`, `like_post`, `repost`, `check_approval` | Posts, likes and reposts |
| [Notion](packages/notion-mcp) | `@alter-ai/notion-mcp` | `search`, `read_page`, `query_database`, `create_page`, `append_to_page`, `update_page`, `edit_page`, `create_database`, `add_database_columns`, `move_page`, `trash_page`, `restore_page`, `add_comment`, `check_approval` | Deletes and moves |
| [Slack](packages/slack-mcp) | `@alter-ai/slack-mcp` | `list_channels`, `read_channel`, `read_thread`, `list_users`, `get_user`, `post_message`, `send_dm`, `update_message`, `add_reaction`, `check_approval` | Channel posts, DMs and edits |
| [Google Calendar](packages/google-calendar-mcp) | `@alter-ai/google-calendar-mcp` | `list_calendars`, `list_events`, `get_event`, `check_free_busy`, `create_event`, `update_event`, `respond_to_event`, `check_approval` | Event creates, updates and RSVPs |
| [Google Drive](packages/google-drive-mcp) | `@alter-ai/google-drive-mcp` | `search_files`, `get_file`, `read_file`, `list_permissions`, `create_file`, `share_file`, `check_approval` | Sharing and permission changes |
| [GitHub](packages/github-mcp) | `@alter-ai/github-mcp` | `list_repos`, `search_issues`, `get_issue`, `list_pull_requests`, `get_pull_request`, `get_file_contents`, `create_issue`, `comment_on_issue`, `create_pull_request`, `merge_pull_request`, `check_approval` | Comments, PRs and merges |
| [Linear](packages/linear-mcp) | `@alter-ai/linear-mcp` | `get_viewer`, `list_teams`, `search_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment`, `check_approval` | Issue creates, updates and comments |
| [Jira](packages/jira-mcp) | `@alter-ai/jira-mcp` | `list_sites`, `list_projects`, `search_issues`, `get_issue`, `list_transitions`, `create_issue`, `update_issue`, `add_comment`, `transition_issue`, `check_approval` | Issue creates, updates, comments and transitions |
| [HubSpot](packages/hubspot-mcp) | `@alter-ai/hubspot-mcp` | `search_records`, `list_records`, `get_record`, `create_contact`, `update_contact`, `create_deal`, `update_deal`, `create_ticket`, `update_ticket`, `check_approval` | Contact, deal and ticket writes |
| [Stripe](packages/stripe-mcp) | `@alter-ai/stripe-mcp` | `get_balance`, `search_customers`, `get_customer`, `list_invoices`, `list_subscriptions`, `list_payment_intents`, `create_customer`, `create_invoice`, `send_invoice`, `create_refund`, `check_approval` | Refunds, invoices and customer creates |
</details>
**Need another provider?** You can build your own multi-user MCP server for any of the **[130+ providers in Alter](https://alterauth.com/integrations/)** — see [Build your own MCP server](#build-your-own-mcp-server-130-alter-providers) below.
## Recommended starting policy & audit
**Allow reads. Approve every send. Block deletes.** Alter enforces policies per operation family (`read`, `write`, `send`, `delete`, `payment`, `admin`) on its side — a prompt injection or misbehaving client cannot bypass them:
```bash
# 1. Require human approval before anything is sent (expires after 24h)
echo '{"effect": "require_approval", "when": {"match": {"families": ["send"]}}, "approval": {"channels": ["email"], "expires_in_seconds": 86400}}' | \
alter policy rules create --app <app-id> --agent <agent-id> --type require_approval --body - --name "Approve every send"
# 2. Block every delete operation outright
echo '{"when": {"family": ["delete"]}, "effect": "deny"}' | \
alter policy rules create --app <app-id> --agent <agent-id> --body - --name "Block deletes"
```
Reads run automatically with no prompt fatigue. Approve held actions in the Alter Wallet or in Slack with [`slack-approvals`](packages/slack-approvals). Every call — allowed, held, approved, or denied — is recorded in Alter's per-person audit log.
## Quick start (<10 minutes)
**Fastest — let your AI client run the setup.** Add the [Alter onboarding MCP server](https://docs.alterauth.com/mcp) and ask *"Set up the Gmail MCP server from github.com/AlterAIDev/multi-user-mcp-servers, with sends held for my approval"*:
```bash
claude mcp add --transport http alter-onboarding https://mcp.alterauth.com/mcp
```
**Or run manually:** follow **Set up** in any package README to get an `ALTER_AGENT_API_KEY` (need a 5-minute free-tier test IdP? See [docs/idp-quickstart.md](docs/idp-quickstart.md)), then connect locally with `npx` (works with all 12 `@alter-ai/*-mcp` packages) or deploy to Cloudflare Workers for your whole team:
```bash
claude mcp add gmail --env ALTER_AGENT_API_KEY=<agent key> -- npx -y @alter-ai/gmail-mcp
```
## Build your own MCP server (130+ Alter providers)
These 12 servers are examples of one reusable pattern: an MCP server that holds only an Alter agent key and proxies every call through Alter. You can build a secure, multi-user MCP server for **any of the [130+ providers in Alter](https://alterauth.com/integrations/)** in minutes.
### Option 1 — Clone a server in this repo (includes local stdio + Cloudflare Workers OAuth 2.1)
1. **Pick a provider in Alter** from [alterauth.com/integrations](https://alterauth.com/integrations/), add it to your Alter app with your OAuth client and scopes, and create an agent with those scopes.
2. **Copy the closest existing server** (`packages/github-mcp` for REST APIs, `packages/linear-mcp` for GraphQL):
```bash
cp -r packages/github-mcp packages/<provider>-mcp
```
3. **Point the copied package at your provider:**
- Update `package.json` (`name`, `mcpName`, `bin`, `description`), `server.json`, `wrangler.jsonc`, and `SERVER_NAME` in `src/server.ts`.
- Set your Alter provider ID in `src/index.ts` (`createAlterCaller(..., "<provider>", SERVER_NAME)`) and `src/worker.ts` (`provider: "<provider>"`).
- Leave `src/alter.ts`, `src/hosted.ts`, `tests/hosted.test.ts`, and `tests/tool-rules.test.ts` untouched — they handle zero-token proxying, OAuth 2.1 sign-in, per-user grant isolation, approvals, and directory checks automatically.
4. **Write your tools in `src/server.ts` using `caller.proxy(...)`** (never handle OAuth tokens directly — Alter injects the signed-in user's token, enforces policy/approvals, and logs the call):
```ts
const outcome = await caller.proxy({
method: "POST",
url: "https://api.example.com/v1/items",
json: { title },
tool: "create_item",
reason: `Create item: ${title}`,
});
if (outcome.kind === "pending") return ok(describePending(outcome, `creating ${title}`));
```
Set all four MCP tool annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) on every tool, and include `check_approval` if any tool writes or sends data.
5. **Verify:** Add your server to the [Servers](#servers) catalog above and run `pnpm install && pnpm typecheck && pnpm test && pnpm build`.
### Option 2 — Build in your own codebase (TypeScript or Python)
No code from this repository is required. Give your MCP server an `ALTER_AGENT_API_KEY` and route every provider API call through the Alter SDK (`agent.proxyRequest` in TypeScript, `agent.proxy_request` in Python). Follow [Build a multi-user server](https://docs.alterauth.com/guides/build-a-multi-user-server) or connect the [Alter MCP server](https://docs.alterauth.com/mcp) to scaffold it with your AI client.
## Hosting & Enterprise / Company IdP
- **Works with any OIDC IdP:** Okta, Microsoft Entra ID, Auth0, WorkOS, Clerk, or any standard OIDC provider.
- **Host the MCP servers and Alter your way:** Run Alter Cloud with self-hosted Cloudflare Workers, **self-host Alter alongside the MCP servers** in your own VPC / on-prem vault, or **have us host both** for your organization — with company-wide policy and audit streaming to your SIEM.
- **Deploying for your team?** **[Book a 20-minute architecture review](https://alterauth.com?utm_source=github&utm_medium=readme&utm_campaign=multi-user-mcp-servers)** or email [founders@alterauth.com](mailto:founders@alterauth.com).
## Docs & contributing
- [Hosted OAuth 2.1 sign-in & security model](docs/hosted-sign-in.md) — consent flow, trust boundaries, token lifetimes
- [5-minute Auth0 / Okta IdP quickstart](docs/idp-quickstart.md) — set up a free-tier IdP for two-user testing
- [75-second two-user demo script](docs/demo-script.md) — Alice vs. Bob isolation walkthrough
- [Contributing & directory rules](CONTRIBUTING.md) — shared-file checks, Slack approval renderers, and local dev commands
---
[Changelog](CHANGELOG.md) · [Security](SECURITY.md) · [MIT License](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues