{"id":4440,"date":"2026-11-17T16:00:00","date_gmt":"2026-11-17T16:00:00","guid":{"rendered":"https:\/\/wiro.ai\/blog\/?p=4440"},"modified":"2026-11-06T23:15:45","modified_gmt":"2026-11-06T23:15:45","slug":"mcp-oauth-ai-assistants","status":"publish","type":"post","link":"https:\/\/wiro.ai\/blog\/mcp-oauth-ai-assistants\/","title":{"rendered":"MCP OAuth vs API Keys: How AI Assistants Sign In"},"content":{"rendered":"<p><strong>MCP OAuth<\/strong> gives an AI assistant a way to reach a remote MCP server without handing a long-lived secret to every app that needs access. That matters because a remote server can expose protected tools and data on behalf of a person or team. The sign-in choice shapes who grants access, how long it lasts, and how easily it can be withdrawn.<\/p>\n<p>If MCP is new territory, start with <a href=\"https:\/\/wiro.ai\/blog\/what-is-mcp\/\">What Is MCP?<\/a>. This article focuses on the next question: how an assistant proves it can call a remote server, and when OAuth or an API key makes sense.<\/p>\n<nav><strong>In this guide<\/strong><\/p>\n<ul>\n<li><a href=\"#why-authorization-matters\">Why remote MCP servers need authorization<\/a><\/li>\n<li><a href=\"#how-mcp-oauth-works\">How MCP OAuth works<\/a><\/li>\n<li><a href=\"#api-keys\">How API keys work<\/a><\/li>\n<li><a href=\"#choosing\">Choosing the right sign-in method<\/a><\/li>\n<li><a href=\"#wiro-mcp\">Signing in to Wiro MCP<\/a><\/li>\n<\/ul>\n<\/nav>\n<h2 id=\"why-authorization-matters\">Why a remote MCP server needs authorization<\/h2>\n<p>A remote MCP server receives requests over HTTP. Some requests may use tools tied to a project, account, or team. The server needs a way to tell whether the client has permission before it handles a protected request.<\/p>\n<p>In the MCP authorization model, the server is a protected resource. The AI application is the client. An authorization server handles the user-facing sign-in and issues access tokens for the client to present to the MCP server. This separates the login experience from the actual tool request.<\/p>\n<p>The authorization part is optional for MCP implementations. When an HTTP-based MCP server supports it, the specification describes an OAuth-based approach. The client sends a bearer access token in the Authorization header on every protected HTTP request. Tokens do not go in a URL query string.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" width=\"2528\" height=\"1696\" class=\"wp-image-4437\" src=\"https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow.jpeg\" alt=\"MCP OAuth authorization flow between an AI assistant and a protected server\" srcset=\"https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow.jpeg 2528w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow-510x342.jpeg 510w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow-900x604.jpeg 900w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow-768x515.jpeg 768w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow-1536x1030.jpeg 1536w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-oauth-flow-2048x1374.jpeg 2048w\" sizes=\"auto, (max-width: 2528px) 100vw, 2528px\" \/><figcaption>An abstract view of an authorization flow between an MCP client, an authorization server, and a protected resource.<\/figcaption><\/figure>\n<h2 id=\"how-mcp-oauth-works\">How MCP OAuth works at a high level<\/h2>\n<p>MCP OAuth starts when a client tries a request without a token. The protected resource can respond with a challenge that points the client to protected resource metadata. That metadata tells the client which authorization server or servers are associated with the MCP server.<\/p>\n<p>The client then discovers the authorization server metadata. This is where it learns the endpoints and capabilities it needs for the sign-in flow. The MCP specification requires clients to use protected resource metadata for authorization server discovery. It also calls for support for authorization server metadata discovery.<\/p>\n<h3>Registering the client<\/h3>\n<p>Before the flow begins, the client obtains a client ID. MCP recognizes client ID metadata documents, pre-registration, and dynamic client registration. The specification prefers the metadata document path when it is available, while dynamic registration remains for compatibility.<\/p>\n<h3>Using authorization code flow with PKCE<\/h3>\n<p>The client creates PKCE values, records the expected issuer, selects the resource it wants to access, and opens the browser authorization request. The person signs in and approves access there. The browser returns an authorization code to the client callback. The client validates the issuer, then exchanges the code and its PKCE verifier for an access token.<\/p>\n<p>The resource parameter identifies the MCP server the token is meant for. This helps the authorization server issue a token for the intended resource, and the MCP server checks that the token is valid for its own resource. The client then sends <code>Authorization: Bearer &lt;access-token&gt;<\/code> with its MCP requests.<\/p>\n<p>Access tokens expire. A client may receive a refresh token, but it must not assume one will be issued. When a connection is revoked or a token no longer works, the next protected request can receive a 401 response and the app can ask the person to sign in again. The <a href=\"https:\/\/modelcontextprotocol.io\/specification\/2026-07-28\/basic\/authorization\" target=\"_blank\" rel=\"noopener\">MCP authorization specification<\/a> explains the roles and token rules, while its <a href=\"https:\/\/modelcontextprotocol.io\/specification\/2026-07-28\/basic\/authorization\/authorization-server-discovery\" target=\"_blank\" rel=\"noopener\">authorization server discovery guide<\/a> describes the metadata path.<\/p>\n<h2 id=\"api-keys\">How an API key in a request header works<\/h2>\n<p>An API key takes a simpler route. The client stores a credential and sends it with each request, usually in an Authorization header. The server validates that credential and decides whether the request can continue.<\/p>\n<p>That pattern fits clients that can send custom request headers and already have a safe place to hold a project credential. There is no browser approval step for each connection. The setup is direct, but the key becomes the credential the client must protect.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" width=\"2528\" height=\"1696\" class=\"wp-image-4439\" src=\"https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key.jpeg\" alt=\"API key sent in a request header to a protected MCP server\" srcset=\"https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key.jpeg 2528w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key-510x342.jpeg 510w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key-900x604.jpeg 900w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key-768x515.jpeg 768w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key-1536x1030.jpeg 1536w, https:\/\/wiro.ai\/blog\/wp-content\/uploads\/2026\/11\/mcp-api-key-2048x1374.jpeg 2048w\" sizes=\"auto, (max-width: 2528px) 100vw, 2528px\" \/><figcaption>An abstract view of a project credential traveling in a request header.<\/figcaption><\/figure>\n<h2 id=\"choosing\">When OAuth and API keys fit<\/h2>\n<p>Choose MCP OAuth when an app supports browser sign-in and the connection should be tied to a person granting access. OAuth makes it practical to review a connection, choose its duration, and disconnect it later without sharing a project key with the application.<\/p>\n<p>Choose an API key when the MCP client supports custom headers and the connection is designed to authenticate with a project credential. This can fit a configured client or a controlled environment where the credential is handled directly by that client.<\/p>\n<p>Both routes deserve basic hygiene. Use one project or account per connection so each client has a clear boundary. Decide how long a connection should last rather than treating every connection as permanent. Review connected apps from time to time, then disconnect anything that is no longer needed.<\/p>\n<h2 id=\"wiro-mcp\">Signing in to Wiro MCP<\/h2>\n<p><a href=\"https:\/\/wiro.ai\/mcp\">Wiro MCP<\/a> offers a browser sign-in for apps that support it. Add https:\/\/mcp.wiro.ai\/v1 as a remote MCP server in the app and leave out the Authorization header. The app opens Wiro in the browser, where you sign in or create an account. Next, pick a project and a connection length. Finally, click Allow and return to the app.<\/p>\n<p>Wiro connections can last 7 days, 30 days, 90 days by default, 180 days, 1 year, or unlimited. Wiro access tokens last one hour and renew on their own. The <a href=\"https:\/\/wiro.ai\/docs\/wiro-mcp-server\">Wiro MCP server guide<\/a> also explains the API key route for clients that send custom headers. A key sent in a header is never stored on the hosted server.<\/p>\n<p>Each Wiro connection uses one project. A personal project uses a personal wallet, while a team project uses the team wallet. Team members can connect projects they created. Team admins and the organization owner can connect any project in the team.<\/p>\n<p>On the Connected Apps page, each app shows its project, last use, and end date. You can change the connection length or disconnect the app there. Disconnecting ends access within a minute, and the app asks for sign-in again the next time it connects.<\/p>\n<h2>Keep the connection deliberate<\/h2>\n<p>MCP OAuth and API keys solve the same basic problem: proving that an AI assistant may call a protected remote server. OAuth centers the browser approval and a renewable token. API keys center a credential sent in a header. Pick the route your client supports, keep each connection scoped to the right project, and review it when the work changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MCP OAuth gives an AI assistant a way to reach a remote MCP server without handing a long-lived secret to every app&hellip;<\/p>\n","protected":false},"author":1,"featured_media":4438,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[211],"tags":[212,312,315],"class_list":["post-4440","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-agents","tag-ai-agents","tag-mcp","tag-oauth"],"_links":{"self":[{"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/posts\/4440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/comments?post=4440"}],"version-history":[{"count":1,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/posts\/4440\/revisions"}],"predecessor-version":[{"id":4441,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/posts\/4440\/revisions\/4441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/media\/4438"}],"wp:attachment":[{"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/media?parent=4440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/categories?post=4440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiro.ai\/blog\/wp-json\/wp\/v2\/tags?post=4440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}