Skip to content

MCP as tools

AgentKit supports using Claude’s Model Context Protocol as tools.

Using MCP as tools allows you to use any MCP server as a tool in your AgentKit network, enabling your Agent to access thousands of pre-built tools to interact with. Our integration with Smithery provides a registry of MCP servers for common use cases, with more than 2,000 servers across multiple use cases.

AgentKit supports configuring MCP servers via Streamable HTTP, SSE or WS transports:

import { createAgent } from "@inngest/agent-kit";
const neonAgent = createAgent({
name: "neon-agent",
system: `You are a helpful assistant that help manage a Neon account.
`,
mcpServers: [
{
name: "neon",
transport: {
type: "ws",
url: "ws://localhost:8080",
},
},
],
});

The mcpServers parameter allows you to configure Model Context Protocol servers that provide tools for your agent. AgentKit automatically fetches the list of available tools from these servers and makes them available to your agent.

mcpServers MCP.Server[]

An array of MCP server configurations.

name string required

A short name for the MCP server (e.g., “github”, “neon”). This name is used to namespace tools for each MCP server. Tools from this server will be prefixed with this name (e.g., “neon-createBranch”).

transport TransportSSE | TransportWebsocket required

The transport configuration for connecting to the MCP server.

type 'sse' required

Specifies that the transport is Server-Sent Events.

url string required

The URL of the SSE endpoint.

eventSourceInit EventSourceInit

Optional configuration for the EventSource.

requestInit RequestInit

Optional request configuration.

type 'ws' required

Specifies that the transport is WebSocket.

url string required

The WebSocket URL of the MCP server.