---
agent_auth:
  skill: https://rfp.ai/.well-known/agent-skills/connect-rfp-ai-mcp/SKILL.md
  audience: https://rfp.ai/api/mcp
  register_uri: https://rfp.ai/oauth/register
  methods:
    - name: oauth2_authorization_code_pkce
      grant: authorization_code
      pkce: S256
      token_endpoint_auth_method: none
      authorization_server_metadata: https://rfp.ai/.well-known/oauth-authorization-server
      protected_resource_metadata: https://rfp.ai/.well-known/oauth-protected-resource/api/mcp
      registration: dynamic (RFC 7591, unauthenticated, rate limited)
    - name: bearer_api_token
      description: Static scoped token created by a signed-in user in Settings → API & Extensions
      header: "Authorization: Bearer <token>"
---

# auth.md — Agent authentication for rfp.ai

This document describes how automated agents authenticate against RFP.ai's
agent-facing endpoints, primarily the MCP server at `https://rfp.ai/api/mcp`.

## agent_auth

```yaml
agent_auth:
  skill: https://rfp.ai/.well-known/agent-skills/connect-rfp-ai-mcp/SKILL.md
  audience: https://rfp.ai/api/mcp
  register_uri: https://rfp.ai/oauth/register
  methods:
    - name: oauth2_authorization_code_pkce
      grant: authorization_code
      pkce: S256
      token_endpoint_auth_method: none
      authorization_server_metadata: https://rfp.ai/.well-known/oauth-authorization-server
      protected_resource_metadata: https://rfp.ai/.well-known/oauth-protected-resource/api/mcp
      registration: dynamic (RFC 7591, unauthenticated, rate limited)
    - name: bearer_api_token
      description: Static scoped token created by a signed-in user in Settings → API & Extensions
      header: "Authorization: Bearer <token>"
```

## OAuth 2.1 (recommended for agent platforms)

RFP.ai is both the authorization server (issuer `https://rfp.ai`) and the
resource server (`https://rfp.ai/api/mcp`).

1. **Discover.** An unauthenticated `POST https://rfp.ai/api/mcp` returns
   `401` with `WWW-Authenticate: Bearer resource_metadata="https://rfp.ai/.well-known/oauth-protected-resource/api/mcp"`.
   That document names the authorization server; its metadata lives at
   `https://rfp.ai/.well-known/oauth-authorization-server` (also mirrored at
   `/.well-known/openid-configuration`).
2. **Register.** `POST https://rfp.ai/oauth/register` (RFC 7591). Public
   clients only: `token_endpoint_auth_method` must be `none`. Redirect URIs
   may be `https` URLs, loopback `http` URLs (port-agnostic matching per
   RFC 8252), or custom app schemes.
3. **Authorize.** Send the user to `https://rfp.ai/oauth/authorize` with
   `response_type=code`, PKCE `code_challenge` (`S256` only), optional
   `scope` and `state`, and optionally `resource=https://rfp.ai/api/mcp`.
   The signed-in user reviews the requested scopes and approves. Agent
   access requires a paid RFP.ai plan.
4. **Exchange.** `POST https://rfp.ai/oauth/token` with
   `grant_type=authorization_code`, the `code`, `redirect_uri`,
   `client_id`, and `code_verifier`. Response: `access_token` (1 hour),
   `refresh_token` (30 days, rotated on every use), `expires_in`, `scope`.
5. **Call.** `Authorization: Bearer <access_token>` on every MCP request.
   Refresh with `grant_type=refresh_token`; each refresh returns a new
   refresh token and invalidates the old one.

## Scopes

| Scope | Grants |
| --- | --- |
| `read` | Search the knowledge base, ask questions, read projects, questions, and answers |
| `projects.write` | Create and update RFP projects |
| `qa.write` | Draft answers, assign questions, add comments |
| `qa.approve` | Approve answers, unlock approved answers, promote to best answers |
| `kb.write` | Upload knowledge-base files |

`read` is always granted. Unknown scopes are rejected with
`invalid_scope` rather than silently dropped.

## Static API tokens (alternative)

A signed-in user on a paid plan can create a scoped API token under
**Settings → API & Extensions** and configure it directly in Claude
Desktop, Cursor, or any MCP client as `Authorization: Bearer <token>`.
Setup guide: https://rfp.ai/docs/claude-desktop-mcp-integration/

## Errors agents should expect

| Status | Meaning |
| --- | --- |
| `401` + `WWW-Authenticate` | Missing/expired/revoked token — run the OAuth flow |
| `403` / JSON-RPC `-32001` | Token lacks the required scope |
| `429` + `Retry-After` | Per-organization rate limit reached |

## Related discovery documents

- MCP server card: https://rfp.ai/.well-known/mcp/server-card.json
- Agent card (A2A): https://rfp.ai/.well-known/agent-card.json
- Agent skills index: https://rfp.ai/.well-known/agent-skills/index.json
- API catalog (RFC 9727): https://rfp.ai/.well-known/api-catalog
- LLM page map: https://rfp.ai/llms.txt

Questions: hello@rfp.ai
