Open the WaytoAGI knowledge base on Feishu · 100M+ visits, open to everyone →
WaytoAGI

Knowledge Base · Learning paths

Agent, MCP, Skill, CLI, Model Explained: Concept Map and 3 Paths to Integrate Legacy Systems with AI

This guide clearly explains the relationships and collaboration mechanisms between Agent, MCP, Skill, CLI, and Model. It also outlines three practical paths for connecting legacy enterprise systems to AI: wrapping APIs as MCPs, CLI packaging, and RPA as a fallback. Includes concept maps, call flows, MCP implementation types, and security best practices for real-world adoption.

AI integrationlegacy systemsMCPAI AgentAI skills

Translated from Chinese by AI. Spotted an issue? Use the feedback button.

🔗 Original link: https://mp.weixin.qq.com/s/mUA-UziZPe0L1IfiMBss8w

Tencent Programmer · WeChat Official Account · Tencent Technology Engineering · 2026-10-12 17:36

📌 This article is reprinted. Copyright belongs to the original author. The full text is subject to the original link.

Author: robinji

This article attempts to answer two questions: First, what exactly is the relationship among the five concepts — Agent, Skill, MCP, CLI, and Model — and who calls whom? Second, for legacy systems that have been running in enterprises for many years, where should we start so that AI can actually be put to use? The content includes a high-level diagram of the relationships among the five concepts, a complete relay of a single tool call, three pathways for integrating legacy systems (API encapsulation, CLI wrapping, and RPA fallback), a full classification of MCP implementation forms, and practical case studies of both BS and CS architectures.

I. How It All Started

The client is the IT team of a research institute under a large domestic automobile group. The group’s management assigned them a task: “Let AI go deep into legacy business systems.” Notably, the directive did not say “deploy a new AI system.” The difference between these two statements is huge. Anyone who has worked in enterprise IT understands that deploying a new system is a procurement issue, while integrating deeply into legacy systems is an engineering challenge. Since management had specifically named the topic, there was no avoiding it.

The IT team’s first difficulty lay at the conceptual level. Terms like Agent, Skill, MCP, CLI, and Model are now everywhere. What exactly is the relationship between them? Who calls whom? Which are the standards and which are the tools? No one had ever explained this systematically.

A more practical problem was how to approach the old systems that had been running for eight or ten years — leave request systems, PLM, various internal platforms — and where to start so that AI could actually be used. The client’s need was very straightforward: explain it clearly first, then talk about how to modify the systems. This led to the exchange and the 42-page PPT.

II. The Five Concepts Form a Team

The client’s first question was: what exactly is the relationship between these concepts? Our approach was to use an analogy. Instead of memorizing technical terms, imagine the entire AI system as a new digital team joining the company.

Concept Team Role Responsibility
Model (Large Language Model) Brain Responsible for thinking — the engine for reasoning and generation
Agent Digital Employee Responsible for doing — a goal-driven, autonomous planning and closed-loop execution entity that calls tools
Skill Job Skills Manual Responsible for knowing — encapsulates processes and experience into skill packages that Agents can load
MCP Universal Adapter Responsible for connecting — an open standard protocol that links AI with external systems
CLI Walkie-talkie Responsible for communicating — a clear, receipt-confirmed, recordable interaction channel

Let’s break each one down.

  1. The Model is the brain. It has attributes such as parameter count, context window, and multimodality. But no matter how smart the brain is, without hands and feet it cannot do any work. The model itself cannot touch a single row of data in your database.

  2. The Agent is the digital employee. Give it a goal, and it will break down the task, find tools, execute, observe the results, and adjust accordingly. Perception, planning, action, observation, and replanning — this is a closed loop. One point that is most easily confused should be clarified first: An Agent is a complete system, and the Model is merely one of its components.

  3. Skill is the job manual. When a new employee joins, they are given a manual that turns a generalist into a domain expert. This is exactly what a Skill does: it combines trigger conditions, operational procedures, domain knowledge, and a tool list into an engineered, version-controllable process asset. It differs from a Prompt. A Prompt is a casual verbal instruction; a Skill is an SOP written into the employee handbook.

  4. MCP is the universal adapter and the focus of this article. Its official name is Model Context Protocol, an open standard protocol. On one side is the Agent; on the other side can be any system — databases, APIs, files, devices. No matter what kind of plug it is, it uses a unified interface standard.

  5. CLI is the walkie-talkie — the Command Line Interface. It has a dual identity: for engineers, it is an efficient way to operate; for Agents, it is a structured calling mechanism.

After laying out the five concepts, there is one important relationship that is often overlooked: MCP and CLI can be nested. The internal implementation of an MCP Server is often just a wrapped CLI. The simplest example is wrapping git bash as an MCP Server. The Agent calls git commands indirectly through the MCP protocol. To the Agent, it only sees the standard MCP shell; it does not need to know whether the backend is a CLI, an API, or a script. To put it more plainly: CLI governs how the tool is executed, while MCP governs how the tool is standardly exposed to AI. Keep this nesting relationship in mind — it will be used repeatedly when we discuss legacy system transformation.

III. How They Collaborate

After explaining the concepts, the second question naturally arises: when a user says something, what exactly happens behind the scenes? Let’s take the sentence “Help me check last week’s leave records” as an example. Once this sentence is received, a relay race begins behind the scenes.

User says this in the CLI or any other conversational interface. The Agent receives the goal and hands the task to the Model for planning. The Model determines that it needs to check the HR system, where the employee handbook contains the standard procedure. The Agent then loads the corresponding Skill, follows the process to identify the tool to call, and initiates a call to the Leave & Return MCP Server via the MCP protocol. The MCP server in turn calls the legacy system’s REST API. The result travels back up the chain, and the Agent tells the user in natural language: “You took two days of annual leave last week, with 8.5 days remaining.”

Here is a mapping between traditional software concepts and their AI counterparts to make it easier to understand.

Traditional Software World AI World
Microservice Agent
OpenAPI / REST MCP
Internal Wiki / SOP Skill
SDK / Command Line CLI

Once you understand this table, so-called “AI architecture” is no longer buzzword soup. It’s the same architecture diagrams you’ve been drawing for over a decade — only the labels on top have changed.

Four: How to Modernize Legacy Systems

This is the part customers care about most, and the core issue for management.

Our first piece of advice is a bit disappointing: there is no silver bullet. The right approach depends on the results of a thorough assessment.

The assessment examines four dimensions: API openness, documentation completeness, authentication system, and tolerance for change risk. After the assessment, a decision tree leads to one of three paths.

  • Path 1: Wrap the API as MCP (Recommended). If the system already has open APIs, add a thin MCP Server wrapper in front. This requires the smallest changes, offers the highest stability, and supports gradual rollout. The only rule is: the wrapper must only perform protocol translation and must not touch business logic.

  • Path 2: CLI Wrapping (Secondary Option). If there is no API but command-line tools or maintenance scripts exist, encapsulate the scripts into a structured CLI and wrap it with an MCP layer. The earlier Git Bash example is the smallest viable sample of this path. The technical requirement is that CLI output must be structured — preferably JSON — so the Agent can consume it reliably.

  • Path 3: Browser Automation or RPA (Last Resort). When only a web interface remains and no scripts are available, use browser automation to simulate human operations. It works, but it is fragile — any UI change breaks it. This is a transitional solution and should not be treated as the final state.

The three paths are listed in descending order of priority. As priority decreases, transformation depth decreases while fragility increases.

A cold shower on security is also necessary here. Authentication and security must be evaluated case by case. When an Agent acts on behalf of a human to operate systems, how identity is passed from user to Agent to system, how permissions are minimized, how operations are audited, and whether sensitive actions require human confirmation — the industry currently has no universal standard. Every system requires individual review. Anyone who claims there is a ready-made solution has never done real enterprise-grade deployment.

Finally, prioritization. Draw a “Usage Frequency vs Business Value” four-quadrant chart and start with high-frequency, low-risk systems that already have APIs. The reason is practical: the first battle must be won, and it must be won cheaply.

Five: Implementation Forms of MCP

Before the discussion, the customer had done their homework and asked whether MCP supports three implementations: stdio, HTTP, and SSE. The answer is yes, but not entirely accurate.

There is a fact that many technical articles still get wrong. The official MCP specification defines only two standard transport methods: stdio and Streamable HTTP. SSE has been deprecated since March 2025 and is now a legacy approach.

The complete picture falls into four categories:

  • Two official standards: stdio and Streamable HTTP — these are the default choices.
  • One historical legacy: HTTP + SSE — only use it for migrating existing implementations; do not create new ones.
  • A group of community extensions: WebSocket, WebRTC, in-process RPC, etc. These grew outside the standard and should be adopted as needed.

There is also a category that is most easily confused: MCP Gateways, Proxies, and hosted MCP solutions. These belong to deployment architecture and have nothing to do with the new protocol, yet they are most often mixed up with transport methods. First, establish this understanding: MCP is transport-agnostic. The protocol logic remains the same; only the way messages are delivered changes.

A brief explanation of each form:

  • stdio: The host program directly spawns a local subprocess and communicates via standard input/output. This is the standard approach for local development and desktop Agents. The trade-off is that it is limited to a single machine and single client, with trust established only at the process level.

  • Streamable HTTP: A single HTTP endpoint. Requests are sent via POST, and streams are established via GET to receive push updates. It supports session persistence and reconnection, works with OAuth 2.0, and is suitable for centralized enterprise deployment and multi-team sharing. It is the only officially recommended remote transport method.

  • SSE: An early dual-endpoint scheme. If you see it, the only recommended action is to plan a migration.

  • WebSocket: Full-duplex, low-latency. Typical use case is browser bridging, such as an Agent connecting to a Chrome extension for browser automation. The cost is that load balancers must support sticky sessions, and enterprise firewalls may block the upgrade handshake.

Selection can be condensed into four sentences:
For local development, use stdio. For enterprise sharing, use Streamable HTTP with OAuth. SSE is only for migrating legacy systems. WebSocket should be reserved for real-time and browser scenarios.

VI. Two Real-World Cases

Customers are rarely convinced by methodology alone — they need real cases. We selected two: one BS architecture and one CS architecture.

The first case is a leave management system from a leading Chinese automaker, built on a BS architecture and following the first path. It was a Java Web system with REST APIs, serving high-frequency HR scenarios. The pain points were very concrete: employees had to go through five steps in the system just to check their leave balance, and HR had to manually reconcile data every month. The solution was straightforward — we placed an MCP Server in front of the existing REST APIs, deployed Streamable HTTP centrally, and integrated authentication with the company’s SSO. Not a single line of code was changed in the legacy system. After the upgrade, an employee could simply say in the chat window, “Help me apply for a half-day annual leave tomorrow afternoon,” turning a five-step process into a single sentence.

The second case is a PLM system from a European commercial vehicle manufacturer, built on a CS architecture and following the second path. It was a traditional desktop client with no open REST APIs, but it came with its own internal API and SDK. The main pain point was data silos — engineers had to manually copy BOMs and drawings between systems. For the transformation, we deployed a local wrapper service next to the PLM client, wrapped the client’s API into structured interfaces, and then added an MCP layer on top. Sessions and permissions continued to use the existing login state of the client.

Looking at these two cases side by side, three reusable lessons emerged:

  1. Conduct a thorough assessment before choosing a path — don’t go around with a hammer looking for nails.
  2. Keep the wrapper thin and avoid touching business logic. The thinner the encapsulation layer, the longer the project will survive.
  3. Treat authentication as a case-by-case matter. Include it in the project plan from the beginning instead of treating it as an unexpected issue.

VII. Outcomes

After the session, the customer gave very positive feedback. In their words, this sharing clearly explained the relationship between concepts like Agent and MCP, and the three-path decision tree could be taken back and directly applied to their own legacy systems.

From our own retrospective, a technical exchange with a customer can be considered a pass if it reaches this level. There is only one standard: after listening, the other party feels that this is something they can implement themselves.