Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"grantd": {
"env": {
"GRANTD_API_KEY": "sk_...",
"GRANTD_BASE_URL": "https://your-broker.example.com",
"GRANTD_END_USER": "user-123"
},
"args": [
"-y",
"grantd-mcp"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
OAuth-for-agents: a dead-simple, MCP-native OAuth token broker that lets AI agents securely act on a user's behalf across third-party APIs (Gmail, Slack, GitHub, Notion…). Tokens are vaulted server-side and never touch the LLM.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'grantd-mcp' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked grantd-mcp against OSV.dev.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in ai-ml
Dynamic problem-solving through sequential thought chains
Persistent memory using a knowledge graph
Workspace template + MCP server for Claude Code, Codex CLI, Cursor & Windsurf. Multi-agent knowledge engine (ag-refresh / ag-ask) that turns any codebase into a queryable AI assistant.
Compact, efficient, and extensible long-term memory for LLM agents.
MCP Security Weekly
Get CVE alerts and security updates for io.github.rafavecchi/grantd and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
OAuth-for-agents: a dead-simple, MCP-native OAuth token broker that lets AI agents securely act on a user's behalf across third-party APIs (Gmail, Slack, GitHub, Notion…). Tokens are vaulted server-side and never touch the LLM.
Stack: TypeScript · Hono · Postgres · generic OAuth2 driven by a declarative provider registry · envelope encryption (AES-256-GCM, key-versioned) · Postgres advisory locks for refresh concurrency (no Redis). Security model and how to report issues: SECURITY.md.
Grantd vaults users' OAuth tokens, so security is the product, not a feature. The fundamentals:
sk_ key is shown once.postgres.js tagged template.state + session tokens; PKCE (S256) where the provider supports it.This is open-source infrastructure you run yourself. Self-hosting responsibilities (key custody, TLS, an edge/WAF for volumetric DoS) and known limitations are documented honestly in SECURITY.md. If you intend to run a hosted, multi-tenant deployment that holds other people's tokens, work through HOSTED-CHECKLIST.md first.
| Provider | Status |
|---|---|
| Google (Gmail, Calendar, …) | ✅ Verified end-to-end, including token refresh |
| GitHub | ✅ Verified end-to-end |
| Slack | 🧪 Experimental — config present, not yet verified against live OAuth |
| Notion | 🧪 Experimental — config present, not yet verified against live OAuth |
Adding a provider is data, not code (see src/providers.ts). Help verifying Slack/Notion is welcome.
npm install
npm run keygen # prints an ENCRYPTION_KEYRING + API_KEY_SALT
cp .env.example .env # then paste keygen output + your DATABASE_URL
npm run migrate # apply SQL migrations
npm run dev # start the broker on :8787
Exposes the broker to an AI agent (Claude Code / Cursor / Claude Desktop) as tools:
list_providers, check_connection, create_connect_link, and call_provider. The
auth-gating wedge: if the agent calls call_provider for a user who isn't connected, it
returns an authorization_required result with a connect link instead of failing.
The MCP server is published to npm as grantd-mcp, so
you don't need to clone this repo to use it — just point an MCP client at it (you do need a running
broker and a secret key). For local development: npm run mcp (needs the broker running); smoke
test: npm run mcp:test.
Add to Claude Code:
claude mcp add grantd \
--env GRANTD_API_KEY=sk_... \
--env GRANTD_BASE_URL=https://your-broker.example.com \
--env GRANTD_END_USER=user-123 \
-- npx -y grantd-mcp
Or in a Cursor / Claude Desktop mcpServers config:
{
"mcpServers": {
"grantd": {
"command": "npx",
"args": ["-y", "grantd-mcp"],
"env": {
"GRANTD_API_KEY": "sk_...",
"GRANTD_BASE_URL": "https://your-broker.example.com",
"GRANTD_END_USER": "user-123"
}
}
}
}
migrations/ SQL schema (Supabase/Postgres compatible)
scripts/ keygen + migrate
... [View full README on GitHub](https://github.com/rafavecchi/grantd#readme)