feat(eve): add pluggable-auth MCP agent channel#1203
Draft
allenzhou101 wants to merge 6 commits into
Draft
Conversation
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Signed-off-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
Signed-off-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcpChannel({ auth: bearerAuth(verifyToken, options) })McpAuthstrategy that packages the portable MCP SDKAuthInfoverifier, required scopes, protected-resource metadata/challenges, and optionalSessionAuthContextprojectionauthis omitted; anonymous exposure requires explicitpublicMcpAuth()auth: vercelMcpAuth()orauth: betterAuthMcpAuth(auth), without adding provider behavior to evemcpChanneloptions limited to auth plus transport/exposure concerns such aspath; its MCP server name andagent_startdescription derive from compiled root-agent metadataagent_startinvocation, rather than channel identityresourceagent_start,agent_get,agent_update,agent_cancel, plusagent_sendfor conversation-mode continuationAuthoring API
Design rationale
This preserves the verifier contract established by
mcp-handler'swithMcpAuth, while fitting eve's compiled channel-definition model.mcpChannelconsumes one declarative auth strategy instead of requiring callers to wrap a compiled channel.The strategy owns only generic MCP protocol policy. Provider token verification, Vercel introspection, Better Auth, DCR/CIMD, OAuth token issuance, and provider-specific resource-server behavior remain external and swappable.
A channel is already attached to the compiled root agent, so duplicating
{ description, outputSchema }inmcpChannelcreates two sources of truth. The runtime supplies the compiled agent name and description to the MCP adapter. Per-invocationoutputSchemacontinues to flow throughagent_start; an authored default remains part of the agent definition and is enforced by the existing runtime.Verified bearer material remains request-local; only a token-free
SessionAuthContextidentity projection crosses into the eve session. A gateway integration must verify a signed forwarded identity through the same strategy contract rather than trusting an identity header.The implementation builds on:
origin/mcp-agent/transport-spikeorigin/mcp-agent/invocation-serviceorigin/mcp-agent/channel-demoVerification
pnpm --filter eve run typecheckpnpm --filter eve run buildpnpm run docs:checkoxlintoxfmt --checkCoverage includes fail-closed omission, explicit public mode, portable verifier and custom identity projection, required scopes and 401/403 challenges, protected-resource derivation/overrides, compiled agent metadata, and MCP transport.
Security and limitations
publicMcpAuth()is intentionally conspicuous and should only be used for deliberate public exposure.