- MCP OAuth 2.0 / OpenID Connect with easy dynamic client registration — this flow works for Google users (end users sign in with Google)
- Direct bearer-token authentication, using the same tokens as the AODocs REST API (see Access APIs with Bearer tokens and the Authentication overview)
MCP is not part of the OpenAPI playground. The live Document Assistant OpenAPI documents the REST AI API (including A2A). MCP uses
/assistant/tools/mcp/v1/... and is documented on this page from the AODocs MCP Integration Guide.Base URLs and endpoints
The MCP service is mounted under/assistant/tools/mcp/v1.
The tenant-scoped MCP endpoint is:
{tenant} with your AODocs tenant identifier (typically a domain-like string such as example.com). The service expects the exact tenant value configured in AODocs.
Use the same regional Document Assistant host as for the REST AI API (document-assistant.us.aodocs.app or document-assistant.eu.aodocs.app).
Clients should follow the absolute URLs returned by discovery instead of reconstructing them manually.
Transport and protocol
This service uses MCP over Streamable HTTP in stateless mode:- the MCP endpoint is a regular HTTP endpoint
- clients connect to
/assistant/tools/mcp/v1/tenants/{tenant}/mcp - SSE is not the configured transport for this deployment
- each MCP request is self-contained
- clients should not rely on server-side session affinity
initializenotifications/initializedtools/listtools/call
2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25. An unsupported MCP-Protocol-Version yields 400 Bad Request.
Authenticated MCP requests use:
Authentication and discovery
During the MCP OAuth flow, end users authenticate with Google. Required Google scopes:
openid, https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/userinfo.profile. Dynamic client registration is the easy path for public loopback MCP clients.
The service supports authorization code flow, refresh token flow, PKCE with S256, dynamic client registration, and direct bearer-token authentication without running MCP OAuth.
Discovery documents are host-level (not tenant-specific):
https://<host>/.well-known/openid-configurationhttps://<host>/.well-known/oauth-authorization-server
issuer, authorization_endpoint, token_endpoint, and registration_endpoint values returned.
OAuth flow (summary)
- Discover authorization server metadata.
- Dynamically register the client if needed.
- Start an authorization-code flow with PKCE.
- Complete Google sign-in and consent in the browser.
- Exchange the authorization code at the token endpoint.
- Store access and refresh tokens.
- On each tool call, AODocs checks that the account is authorized for the tenant in the MCP URL.
Dynamic client registration
Registration endpoint:https://<host>/assistant/tools/mcp/v1/register.
Dynamic registration is the expected path for public loopback clients without a prior client_id. Only loopback redirect URIs are allowed:
http://localhost:*http://127.0.0.1:*
token_endpoint_auth_method="none"); the proxy does not issue a usable client_secret.
Registration fields follow the standard OAuth client metadata model used by the MCP SDK (redirect_uris required; optional grant_types, response_types, scope, client_name, and related metadata fields). Defaults include grant_types: ["authorization_code", "refresh_token"] and response_types: ["code"].
Token response shape
expires_in as authoritative. Persist the latest refresh token if rotation occurs.
Working client sequence
With MCP OAuth: discover → register (if needed) → authorize with PKCE → exchange code → open MCP URL →initialize → notifications/initialized → tools/list → tools/call.
With an existing AODocs REST API token: open the tenant MCP URL with Authorization: Bearer <access-token> (same tokens as documented under Access APIs with Bearer tokens), then the same MCP initialize / tools flow.
Tools
Tool availability can differ by environment. Calltools/list; if a tool is absent, that feature is disabled in the current deployment.
Annotations
Always available
ask_aodocs
Natural-language question over documents the user can access.
Returns
answer and sources (document/attachment references and quotes).
get_document_content
Download URLs for a document’s attachments (documentId required; optional versionId, attachmentIds). Treat downloadHeaders as mandatory when present; URLs may be time-limited.
search_fulltext
Keyword/fulltext search (query required; optional libraryIds, sort with fieldName / order, pageSize, pageToken). Returns hits, total, totalPrecision, nextPageToken.
get_document_metadata
Document metadata (documentId required; optional versionId, including draft / HEAD / LATEST / CURRENT semantics as documented in the integration guide).
create_document
Create a document (title, libraryId required; optional documentClassId, content as plain text or Markdown).
create_attachment
Add a text attachment (documentId, title required without file extension; optional content).
When semantic search is enabled
search_libraries— find libraries by name or semantic description (queryrequired;*lists all accessible; optionallimit,include_metadata).search_document_semantic— semantic search over indexed content (queryrequired; optionaldocumentIds,libraryIds,limit).
When text extraction is enabled
get_document_text— extract text from attachments (documentIdrequired; optionalversionId,attachmentId).
Permissions
All tool results are filtered by the authenticated user’s permissions. Tenant access is enforced before any tool runs. Write operations may fail without the required document or library permissions.Errors
OAuth exchange may also return standard errors such as
invalid_client, invalid_grant, unauthorized_client, invalid_request, or access_denied.