Skip to content
Docs

eve with MCP

Connect an eve agent to a Model Context Protocol (MCP) server by adding a connection under agent/connections/. The example below connects to Linear so your agent can discover tools and read your assigned issues. Vercel Connect handles authorization and provider tokens.

Before you begin, you need:

  • An existing eve project. Start with the eve overview if you don't have one.
  • A Vercel account and Vercel CLI installed.
  • A Linear workspace you can authorize.
  • An authenticated eve channel. Built-in platform channels identify the user from the sender. For a web channel, configure route authentication to return principalType: 'user' so eve can associate the connection with the current user.

Install Vercel Connect in your existing eve project:

Terminal
pnpm i @vercel/connect eve
Terminal
yarn add @vercel/connect eve
Terminal
npm i @vercel/connect eve
Terminal
bun add @vercel/connect eve

Link the directory to a Vercel project, then pull its environment variables:

Terminal
vercel link
vercel env pull

The second command creates .env.local with a short-lived VERCEL_OIDC_TOKEN. Vercel Connect uses this token to authenticate your project. When you deploy to Vercel, token management happens automatically.

Create a Linear connector:

Terminal
vercel connect create linear --name acme-linear

Select the MCP connection method in the CLI prompts and complete any requested authorization. Then attach the connector to your linked project:

Terminal
vercel connect attach linear/acme-linear

This links the connector to the project's Production, Preview, and Development environments. If you already have a Linear connector, attach that connector and use its UID or scl_... ID in the connection below.

Create agent/connections/linear.ts:

agent/connections/linear.ts
import { connect } from '@vercel/connect/eve';
import { defineMcpClientConnection } from 'eve/connections';
 
export default defineMcpClientConnection({
  url: 'https://mcp.linear.app/mcp',
  description: 'Linear issues, projects, cycles, and comments.',
  auth: connect({
    connector: 'linear/acme-linear',
    autoProvision: false,
  }),
});

eve discovers connections from the filesystem. The filename gives this connection the name linear, and the description helps the agent find relevant tools at runtime.

PropertyPurpose
urlThe MCP server endpoint.
descriptionThe services and tasks the connection supports, so the agent can discover relevant tools.
authThe result of connect() from @vercel/connect/eve, using your connector's UID or ID.

The example explicitly keeps autoProvision: false, the default, because you created and linked the connector. To opt in to runtime provisioning, set autoProvision: true. When a token or authorization request reports a missing connector or project link, Vercel Connect uses the connection URL and a provisionable connector UID to create or link a managed OAuth connector, then retries the request.

User authorization is the default. eve identifies the current user from the channel, and Vercel Connect keeps a separate authorization grant for each user. Linking the connector to the project allows the project to request tokens; each user still authorizes access to their own account.

Send a message to your agent through its authenticated channel:

Agent prompt
Use the Linear connection to list my assigned issues.

When you first use the connection:

  1. eve requests a token for the current user from Vercel Connect.
  2. If the user has no valid grant, eve pauses the turn and presents an authorization URL or device code.
  3. Complete the authorization in your browser. Vercel Connect resumes eve through its callback or secure webhook.
  4. eve requests the token again, then discovers and calls the Linear tools needed to answer your prompt.

The agent can return the issues your account has permission to read. Subsequent requests use the existing grant while it remains valid.

Choose the authorization mode based on whose account the agent should use:

ModeUse whenConsent behavior
user (default)Each person connects their own provider account.eve can pause the turn and ask the user to authorize.
appA background agent shares one installed credential.Authorization is non-interactive and requires an app credential to be installed beforehand.

For an app connection, set principalType: 'app' in the connect() options. If the app credential is missing, eve reports an authorization failure that an operator must resolve. It does not start a user consent flow.

For an example that uses app authorization to investigate deployment failures, follow Manage Vercel projects with a software factory. It connects an eve agent to Vercel MCP with access to build logs, runtime errors, and deployment history.

ProblemWhat to check
The first tool call fails with principal_required.Ensure the channel authenticates the caller as a user principal. For a web channel, route authentication must return principalType: 'user'.
Local requests fail after previously working.Run vercel env pull to refresh an expired development OIDC token, then restart your local process so it loads the updated environment.
The connector is unavailable to the project.Check that the UID in connect() matches your connector and run vercel connect attach <connector> for the linked project. Custom Environments require an explicit environment link.
App authorization fails because no credential is installed.Install the app credential before invoking the agent. App authorization cannot prompt an end user for consent.
Last updated September 15, 2026

Was this helpful?

supported.