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. To create one, run pnpm dlx eve@latest init my-agent, then cd my-agent.
  • 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.

Add tools to the connection with either allow or block, but not both. For example, tools: { allow: ['search_issues', 'get_issue'] } lets the model discover only those two tools, while block hides specific tools from a larger set. Prefer allow when the server also exposes tools that write data. eve names each tool <connection>__<tool>, such as linear__search_issues. See Tool filters in the eve documentation.

Yes. Set approval on the connection. The never(), once(), always(), and auto() helpers apply one policy to every tool on the connection. For finer control, pass a function that receives toolName, toolInput, and toolAnnotations and returns 'user-approval' to pause for a person or 'not-applicable' to run the call. toolName includes the connection prefix, so match it with endsWith(). While the agent waits for an answer, eve suspends the session's workflow until the answer arrives. See Approval gates.

Yes. Return { token } from auth.getToken, and eve sends it as an Authorization: Bearer header on every request. Use headers for a server that expects a different header, and omit both only for a public server. Store the key in an environment variable. You don't need Vercel Connect for a static credential. To connect Sanity Context this way, pass an organization API token with Context permissions. The Sandbox data analysis guide uses this approach to connect eve to an MCP server that runs SQL and Python in Vercel Sandbox.

Yes. Create agent/channels/mcp.ts and export mcpChannel from eve/channels/mcp with an auth strategy, which the channel requires. The channel serves Streamable HTTP at /eve/v1/mcp. Clients such as Claude Code start work with the agent_start tool and check on it with agent_get. Once agent_start returns, the work survives restarts and redeploys. Set tools: true to also publish the agent's own tools for clients to call directly. See MCP channel.

On Vercel, eve sends model requests through AI Gateway and authenticates with your project's OIDC identity, so you don't add a provider API key. Each session runs on Vercel Workflows, which checkpoints progress and resumes pending work after interruptions. Vercel Sandbox isolates code that the agent runs. Vercel Connect stores each user's OAuth grant and issues tokens for MCP connections. See eve on Vercel.

Last updated September 15, 2026

Was this helpful?

supported.