C3 AI Documentation Home

MCP Client Overview

MCP Client is the outbound side of the Model Context Protocol in C3. Where MCP Server exposes your C3 application's tools and prompts to external IDEs, MCP Client lets your application call out to MCP servers that other vendors or teams host, and use their tools, prompts, and resources from C3 agents, notebooks, and services.

The client manages the connection, handles authentication, and gives you typed methods to discover and invoke whatever the server exposes.

Capabilities

A registered MCP client supports six operations against the connected server:

OperationMethod on GenaiCore.Mcp.Client
Discover toolslistTools
Call a toolcallTool
Discover promptslistPrompts
Get a promptgetPrompt
Discover resourceslistResources
Read a resourcereadResource

For a full reference, see Use Tools, Prompts, and Resources from an MCP Client.

Shared and user clients

Every MCP client extends a common base type, but you register it as one of two variants depending on who authenticates to the external server:

  • Shared: all users in the application share one set of credentials. The application authenticates on behalf of users with a single identity managed by administrators. Credentials live at the APP, ENV, or CLUSTER override level. Use GenaiCore.Mcp.Client.Shared when the MCP server treats your application as a single client (service tokens, shared API keys).

  • User: each signed-in user gets their own credentials to the MCP server. Credentials are stored at the USER override level and are not visible to other users or administrators. Use GenaiCore.Mcp.Client.User when the MCP server needs to identify the human caller (per-user consent, per-user data, audit trails).

The two variants implement the same capability surface (listing and calling tools, prompts, and resources), but differ in how they capture and store credentials.

How registration works

Registration creates a configured client identified by name. Subsequent calls look up the client with forName. Both variants take the same three inputs:

InputWhat it is
nameAn identifier unique to the application
urlThe MCP server's base URL
specA GenaiCore.Mcp.Client.RegisterSpec (or a subtype) carrying credentials and registration options

The RegisterSpec base type defines headers (the auth headers to attach to every request), failIfExists (set to true to error if a client with that name already exists, otherwise registration upserts), and override (the config override level to write to; auto-selected if omitted).

The user variant adds three optional OAuth fields — authorizationServer, clientId, and scope — on top of the base spec. These are only needed if the client will use the OAuth 2.0 PKCE flow (beginPkceAuthorization / completePkceAuthorization). If the caller already has a token or uses a different auth mechanism, registration works with just the inherited headers field and the OAuth fields can be omitted.

How OAuth works for user clients

When the MCP server requires OAuth, register the user client and then run the OAuth 2.0 authorization code flow with PKCE (RFC 7636) in three steps:

  1. Begin authorization. The client returns a code verifier, state, and an authorization URL to redirect to.
  2. The user signs in with the OAuth provider, consents, and is redirected back to your application with a code.
  3. Complete authorization. The client exchanges the code for an access token and stores it on the user's USER-scoped config.

C3 also supports OAuth authorization server discovery via well-known URLs and RFC 9728 resource metadata, plus dynamic client registration (RFC 7591) when no static clientId is provided.

For a step-by-step walkthrough, see Connect a User to an MCP Server.

MCP Client page map

The recommended path is: register a client (shared or user), then call its capabilities.

Register a shared client

Pick this when one set of credentials covers every user.

Continue with Register a Shared App MCP Client.

Connect a user via a user-level MCP Client

Pick this when each user authenticates as themselves with the MCP server.

Continue with Connect a User to an MCP Server.

Use tools, prompts, and resources

Reference for calling the six capability methods on a registered client.

Continue with Use Tools, Prompts, and Resources from an MCP Client.

See also

Was this page helpful?