
Grantd
io.github.rafavecchiPublished by GitHub account rafavecchiv0.1.0Updated Oct 24, 2026
Grantd MCP server: let your AI agent act on a user's behalf across third-party APIs via OAuth.
Overview
MCP server for Grantd, letting an AI agent act on a user's behalf across third-party APIs such as Gmail and GitHub via OAuth.
- What you can do
- List the third-party providers the broker supports. Check whether a given end user has connected a provider. Create an OAuth link so the user can grant access. Call provider APIs on the user's behalf, returning an authorization-required result when not connected.
- When to use it
- Use it when an AI agent should call third-party APIs such as Gmail or GitHub on a user's behalf without access tokens reaching the model or the conversation. Suited to developers running their own Grantd broker and needing an OAuth consent flow.
- Requirements
- Runs locally as the npm package grantd-mcp under Node.js and needs a running, self-hosted Grantd broker. Set GRANTD_API_KEY (an sk_ secret key), GRANTD_BASE_URL (broker address, default local port 8787), and optionally GRANTD_END_USER as the default user.
Installation
In SourceWeft
- Open Grantd in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Grantd
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.
Security at a glance
Grantd vaults users' OAuth tokens, so security is the product, not a feature. The fundamentals:
- Tokens encrypted at rest — AES-256-GCM envelope encryption, fresh IV per record, key-versioned, and fail-closed (a missing key refuses to write; it never silently stores plaintext).
- Tokens never reach the LLM or the caller. The proxy injects the access token at the network boundary and returns only the provider's response — the raw token is never serialized back.
- API keys hashed at rest (pbkdf2-sha256, peppered); the raw
sk_key is shown once. - No SQL injection — every query is a parameterized
postgres.jstagged template. - Tenant isolation on every query by environment id; Row-Level Security enabled on all tables so a Postgres REST layer (e.g. Supabase/PostgREST) can't read the vault.
- 256-bit random OAuth
state+ session tokens; PKCE (S256) where the provider supports it. - Durable, Postgres-backed rate limiting — per secret key on auth routes, per IP on public routes.
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.
Providers
Adding a provider is data, not code (see src/providers.ts). Help verifying Slack/Notion is welcome.
Quick start (dev)
MCP server
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:
Or in a Cursor / Claude Desktop mcpServers config:
Layout
Source: README.md at commit 948813e
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts