MCP makes Eino more powerful: a practical guide

Written by
Silas Grey
Updated on:July-10th-2025
Recommendation

The deep integration of Eino and MCP protocol creates a new experience of efficient server-side development.

Core content:
1. Analysis of the new architecture of Eino supporting MCP protocol
2. Steps of transforming MCP Server from stdio to sse
3. Practical exercises on using Eino to build Agent and connect to MCP Server

Yang Fangxian
Founder of 53AI/Most Valuable Expert of Tencent Cloud (TVP)
I recently saw an update to Eino, which mentioned that it already supports the MCP protocol. Today we will take a look at its usage.
The whole architecture is as follows:
As can be seen from the architecture diagram, when Eino builds the Agent, it uses the MCP Client to connect to the MCP Server and obtain relevant Tools. Finally, the Tools are converted into Eino's ToolNode to participate in the final workflow arrangement.
Practical Demonstration
We still use   the current time MCP Server mentioned in the article MCP Practice: Use Go to quickly build MCP Server as an example.
However, because Eino is generally used for server-side development, we need to change the MCP Server from stdio to sse.
Step 1: Modify the current time MCP Server monitoring mode to support SSE
// Only check for "sse" since stdio is the defaultif transport == "sse" { serverUrl := "http://" + serverlisten sseServer := server.NewSSEServer(s, server.WithBaseURL(serverUrl)) log.Printf("SSE server listening on %s", serverlisten) if err := sseServer.Start(serverlisten); err != nil { log.Fatalf("Server error: %v", err) }} else { if err := server.ServeStdio(s); err != nil { log.Fatalf("Server error: %v", err) }}
Step 2: Build the agent using Eino
// Initialize MCP client using SSEctx := context.Background ( )cli, _ := client. NewSSEMCPClient ( "http://localhost:8080/sse" )cli.Start (ctx )defer cli. Close ()
// Send init requestinitRequest := mcp.InitializeRequest{}initRequest.Params.ProtocolVersion = mcp.LATEST_PROTOCOL_VERSIONinitRequest.Params.ClientInfo = mcp.Implementation{    Name:     "current-time" ,    Version:  "1.0.0" ,}cli.Initialize (ctx, initRequest )
// Query the tools provided by MCP Servertools, _ := eino_mcp. GetTools (ctx, &eino_mcp.Config{ Cli : cli})
// Bind MCP Tools to Einollm, _ := openai. NewChatModel (context. Background (), &openai.ChatModelConfig{    BaseURL : os. Getenv ( "OPENAI_API_URL" ),    Model : os. Getenv ( "MODEL_ID" ),    APIKey : os. Getenv ( "OPENAI_API_KEY" ),})agent, _ := react. NewAgent (ctx, &react.AgentConfig{    Model : llm,    ToolsConfig : compose.ToolsNodeConfig{ Tools : tools},})run (agent)
Step 3: Run the result
  • First start the mcp server, which listens to port 8080 by default
$ go run tools/mcp-time/main.go --transport sse2025/03/23 18:55:03 SSE server listening on localhost:8080
  • Run eino mcp demo
$ go run main.go
Welcome to use eino  with  mcp demo.
Please enter the operation: Beijing current timeThe current time in Beijing is  2025-03-23  ​​18 : 56 : 59.061851  + 0800  CST. Please note that this may be an answer based on an assumed date and the actual time will vary.
Please enter the operation: Chicago current timeThe current  time in  Chicago is 23 March 2025 05:57:13  ( CDT ) .
Please input operation: tell me shanghai  current  timeThe  current  time  in  Shanghai  is  2025-03-23  ​​18 : 57 : 26.192551  + 0800  CST.
Please enter the operation: byeWelcome to use again, goodbye.
Summarize

Eino moves really fast. It took only a few weeks from the time community users proposed the MCP requirement to its final implementation. The main point is to listen to advice.

After Eino has converted the Tools of the remote MCP Server into its own available ToolNode for unified orchestration capabilities, when building intelligent entities in the cloud, it can consider unified management of some reusable public capabilities through the MCP Server, without the need for each Eino Agent to actually implement them. With the MCP Server, it is more convenient for the openness and fine-grained management of data in various departments of the enterprise.