How to Use the FastGPT MCP in LangChain
Feed your LangChain chains live knowledge base context and automate document ingestion with FastGPT.
Works with every AI agent you already use
…and any MCP-compatible client
Connect FastGPT MCP to LangChain
Create your Vinkius account to connect FastGPT to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Chain-linked knowledge ingestion in LangChain
`push_dataset_data` feeds raw documents directly into your LangChain runs to build dynamic data pipelines. Your agent grabs fresh data from a web scraping step, runs it through an extraction chain, and writes it straight to your knowledge base without manual exports. You manage the entire lifecycle programmatically inside LangGraph by calling `create_dataset` and `update_dataset_data`. This keeps your retrieval sources fresh because every step in the pipeline feeds into the next tool in the sequence.
Observable semantic search pipelines
`search_dataset_data` queries your knowledge base during LangChain execution to pull ground-truth facts. You see exactly how the agent formulated the query, what semantic matches came back, and how much context was sent to the LLM inside your LangSmith dashboard. Running `get_embeddings` lets you compare vector representations before you push them to the server. You verify alignment between your local text processing steps and the FastGPT backend using a single, traced MCP Server call.
Multi-step conversational context tracking
`chat_completions` keeps track of user interactions across complex LangChain agent loops using explicit session IDs. Your agent retains thread history across dozens of turns without you having to manually manage memory state in your code. Combining this with `list_apps` and `get_app_detail` lets your agent dynamically inspect which FastGPT application configuration matches the current user's intent. The agent switches context on the fly based on the application metadata it reads.
Set up FastGPT MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes FastGPT tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"fastgpt-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent FastGPT transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by FastGPT. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about FastGPT MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the FastGPT MCP today
We host it, we monitor it, we maintain it. You just paste one token.