Aller au contenu

Agents · travail en cours

Serveur MCP

Identvia expose un serveur MCP sans état pour que les assistants puissent demander à un utilisateur l’accès à des sites AgentPass et l’utiliser, tandis que l’utilisateur reste maître.

Copiez le prompt pour votre agent IA

Vous utilisez un agent de code ? Ce prompt l’oriente vers cette documentation et liste les règles qu’il doit suivre. Relisez ce qu’il écrit comme n’importe quel autre code.

You are helping me add "Sign in with Identvia" to my app (PHP). Identvia is an OpenID Connect provider.

Read these first (they are plain Markdown and are the source of truth; prefer them over anything you remember):
- https://id.identvia.com/developers/docs/quickstart.md
- https://id.identvia.com/developers/docs/oidc.md
- https://id.identvia.com/developers/docs/security.md
- Discovery: https://id.identvia.com/.well-known/openid-configuration

Stack: plain PHP 8.1+ (no framework). Use the official SDK identvia/identvia-php (composer require identvia/identvia-php, or the zip with vendor/ from https://id.identvia.com/developers/docs/php for hosts without Composer). Create identvia.php (config), login.php (redirectToSignIn), callback.php (handleCallback, then session_regenerate_id(true) and store sub) and logout.php. Read secrets from environment variables or a config file outside the web root.

Requirements:
1. Authorization code flow with PKCE (S256 only), a random state and a nonce per sign-in. No implicit flow.
2. Validate the ID token: RS256 signature from the JWKS, iss = https://id.identvia.com, aud contains my client_id, exp/iat, and the nonce.
3. Identify users by sub (it is pairwise: different for every app). Treat email as optional, because the person may choose not to share it.
4. Redirect URIs must match exactly. Keep the client secret and refresh tokens server-side; never log tokens.
5. Ask only for the scopes I need (openid, plus email/profile if used). Handle the user canceling (error=access_denied) gracefully.

Optional, only if I ask for AI-agent access later:
- AgentPass (agents acting for a user with single-use, holder-bound passes): https://id.identvia.com/developers/docs/agentpass.md
- MCP server for agent clients: https://id.identvia.com/developers/docs/mcp.md
- Token exchange, rich authorization requests and CIBA: https://id.identvia.com/developers/docs/delegation.md

Before writing code, tell me which files you will add or change. Don't invent endpoints or options that aren't in the docs; if something is unclear, ask me.

Connecter

URL du serveur : https://id.identvia.com/mcp (HTTP Streamable, réponses JSON, sans sessions ni SSE). Les clients découvrent l’autorisation via /.well-known/oauth-protected-resource/mcp, puis utilisent OAuth 2.1 avec PKCE et resource=https://id.identvia.com/mcp. Ils peuvent s’identifier avec un Client ID Metadata Document (un client_id HTTPS) ou s’enregistrer dynamiquement. Les révisions de protocole 2026-07-28 et 2025-11-25 / 2025-06-18 / 2025-03-26 sont prises en charge.

Portées

  • profile : qui est l’utilisateur (whoami).
  • grants:read : lister l’accès des agents et les demandes en attente.
  • grants:revoke : révoquer l’accès des agents.
  • agent:request : demander l’accès, le vérifier et appeler le site avec.

Outils

  • whoami, list_grants, revoke_grant
  • request_access : envoie une demande AgentPass dans la boîte de l’utilisateur.
  • check_access : une fois l’utilisateur approuvé, Identvia échange le laissez-passer et renvoie un credential_handle. Le jeton lui-même n’est jamais renvoyé au client.
  • call_service : une requête HTTPS uniquement vers le site accordé (10 s, 256 KB).

Il n’y a pas d’outil d’approbation. L’approbation a lieu uniquement dans Identvia, par l’utilisateur connecté, avec une clé d’accès ou une application d’authentification.