Prerequisites
This guide assumes you already have tool calling set up and working with Layercode. If not, start here first:👉 Tool calling in Next.js with Layercode Once that’s working, you can extend your agent with MCP-based tools.
Example Setup
Note: The MCP URLhttps://docs.layercode.com/mcp
below is just an example endpoint that connects to the Layercode Docs MCP server.
Replace this with your own MCP server URL — for example, one that connects to your company’s data, APIs, or private knowledge.