# Authentication for agents and machine clients

How software clients (AI agents, MCP clients, scripts) get access to vibe-manufacturing.com. Access works with the bearer tokens described here; manufacturers' connectors can instead sign in with OAuth 2.1 (section 4). Tokens are shown once, stored only as SHA-256 hashes on our side, and cannot be recovered; keep them secret.

## 1. Public tools and data: no authentication

Everything read-only is open:

- MCP server: `https://vibe-manufacturing.com/mcp` (Streamable HTTP, stays public; the OAuth-protected `/mcp/supplier` in section 4 is only for manufacturers). Search, supplier matching, design rules, design checks, cost estimates and quote-request requirements need no token.
- REST: see the [OpenAPI description](https://vibe-manufacturing.com/openapi.json), e.g. `GET /api/search`, `GET /api/match`, `GET /api/suppliers`.
- Open data: `https://vibe-manufacturing.com/data/suppliers/index.json` and one JSON file per country.
- WebMCP: the tools listed in `https://vibe-manufacturing.com/.well-known/webmcp` run in the visitor's browser session.
- Every HTML page is also available as Markdown: send `Accept: text/markdown` or append `.md` to the path.

Public endpoints are rate limited per client IP. Please identify your client in the `User-Agent` header.

## 2. Quote-request token (buyers and their agents): `rt_…`

- **How to get it:** create a request with the MCP tool `create_rfq` or `POST /api/v1/rfq`. The response contains `rfq_id` and `token` (prefix `rt_`). Creating a request needs no prior account; the requester's email address is part of the request.
- **What it unlocks:** that one request only: matches and quotes (`get_rfq`, `GET /api/v1/rfq/{id}`), the conversation with the matched manufacturers (`get_rfq_thread`, `send_rfq_message`, `/api/v1/rfq/{id}/messages`) and file uploads to it (`upload_rfq_file`).
- **How to send it:** REST: `Authorization: Bearer rt_…` (never in the URL). MCP: the `token` argument of the tool.

## 3. Supplier token (manufacturers and their agents): `st_…`

- **How to get it:** claim the listing at [/suppliers/manage](https://vibe-manufacturing.com/suppliers/manage) (or register at [/suppliers/register](https://vibe-manufacturing.com/suppliers/register)). We email a signed management link to an address at the company's own domain; on the management page tick "Create an API token so my agent can answer quote requests". A new token replaces the previous one and ends every OAuth authorization of the company (section 4).
- **What it unlocks:** the requests this company was matched to (`GET /api/v1/supplier/requests`), quotes (`POST /api/v1/rfq/{id}/quotes`), the company's own thread per request and file uploads to it. MCP supplier tools: `list_my_requests`, `get_request`, `send_message`, `submit_quote`, `get_my_profile`, `update_my_profile`; with a supplier token `send_rfq_message` and `get_rfq_thread` act as the company, and so does `upload_rfq_file` when `rfq_id` is given (without it, the upload is a new file for a request still to be created).
- **How to send it:** REST and MCP: `Authorization: Bearer st_…` header (preferred; for MCP set it once in the client config). Fallback for clients that cannot set headers: the `supplier_token` argument of a supplier tool (the `token` argument also works on the thread and upload tools). If header and argument are both given they must match.
- **Without handing the token to the assistant:** connect `https://vibe-manufacturing.com/mcp/supplier` with OAuth (section 4). The supplier token is typed once on our authorization page and never reaches the client.

## 4. OAuth 2.1 for manufacturer connectors: `/mcp/supplier`

For MCP clients with sign-in (custom connectors). The same MCP server as `/mcp`, but every request needs a token: without one, or with an invalid one, it answers `401` with `WWW-Authenticate: Bearer resource_metadata="https://vibe-manufacturing.com/.well-known/oauth-protected-resource"`, which starts the client's OAuth flow.

- **Metadata:** protected resource (RFC 9728) at [/.well-known/oauth-protected-resource](https://vibe-manufacturing.com/.well-known/oauth-protected-resource), authorization server (RFC 8414) at [/.well-known/oauth-authorization-server](https://vibe-manufacturing.com/.well-known/oauth-authorization-server). Issuer: `https://vibe-manufacturing.com`.
- **Client registration:** dynamic (RFC 7591), `POST /api/oauth/register` with `redirect_uris`. Public clients only (no client secret); redirect URIs must be `https`, or `http` on `localhost` / `127.0.0.1`, without fragment or user info. Registration is rate limited per IP.
- **Authorization:** authorization code with PKCE (`S256` only) at `https://vibe-manufacturing.com/oauth/authorize`. The manufacturer approves on that page by entering its supplier token (`st_…`); the redirect URI must match a registered one exactly and `state` is returned unchanged. Approval attempts are rate limited per IP.
- **Tokens:** `POST /api/oauth/token` (`authorization_code` or `refresh_token`, form or JSON body, with `client_id`). Access tokens (`at_…`) expire after one hour and act for the company like its supplier token: on the MCP supplier tools, the request inbox (`GET /api/v1/supplier/requests`) and quotes (`POST /api/v1/rfq/{id}/quotes`). Refresh tokens (`rf_…`) rotate on every use and expire after 30 days unused. One authorization ends 90 days after it was granted, whatever the refreshes; then the manufacturer approves again. A reused authorization code or an already rotated refresh token revokes everything issued under that authorization; a new supplier token revokes all authorizations of the company.
- **How to send it:** `Authorization: Bearer at_…` on `/mcp/supplier`. A plain supplier token in the same header works there too.

## 5. Ingest partner token

- **What it is for:** partners that contribute company websites in bulk (`POST /api/v1/ingest`, `POST /api/v1/ingest/check`, `GET /api/v1/ingest/known`). Contributions are crawled and checked like any other source; partners cannot edit listings.
- **How to get it:** on request only, through the [contact page](https://vibe-manufacturing.com/contact). Each token has a daily limit.
- **How to send it:** `Authorization: Bearer <token>`.

## Rules for agents

Act only on behalf of, and with the agreement of, the person or company that owns the token. Sending a quote request or a message shares its content with manufacturers or the buyer; ask the user first. Questions and abuse reports: [contact](https://vibe-manufacturing.com/contact).
