How to Use MCP Tools with LangChain Agents
This document provides a developer-focused guide on how to integrate Vinci’s MCP server with your own LangChain agent. It’s structured as a cookbook with recipes to guide you through the implementation.Overview
This guide shows how you can connect your LangChain agent to Vinci’s MCP (Multi-tool Control Plane) server. This enables your agent to dynamically discover and utilize our powerful external tools, extending its capabilities beyond simple chat.Prerequisites
Before you begin, make sure you have the necessary packages installed.Configuration
To run the examples in this guide, you need to configure the following environment variables in your.env file.
Use the same Vinci API key for MCP that you use for the public REST API.
Recipes
How to Fetch Tools from the MCP Server
This recipe shows how to connect to Vinci’s MCP server, retrieve the available tools, and print their names and descriptions. This is the foundational step for integrating Vinci’s tools into any LangChain agent. Code:How to Integrate Tools with a LangChain Agent
Once you can fetch the tools, you can integrate them into a LangChain agent. This example demonstrates how to build an agent that can use the Vinci tools to perform tasks. Code:Local OSS daemon tools
The open-source daemon (vinci-daemon, POST /mcp) exposes the same tool names an agent calls against a running Studio. These three map onto the Axis adapt pipeline:
vinci.presets_list returns generic, partner, and custom presets. Each row has source set to generic, partner, or custom. vinci.adapts_run enqueues one batch item and returns batch_id. vinci.batch_status reports per-item status (queued, running, done, failed), output asset ids, and per-preset checks for dimensions, byte cap, and safe-area margins.
Point an MCP client at http://127.0.0.1:4310/mcp (see vinci mcp print-config). Completed exports stay downloadable at GET /assets/{id}/file, and a finished batch is also GET /adapts/batch/{batch_id}/bundle.zip.