MCP Server
What is MCP?
Core Concepts
As Agent-based applications rapidly evolve, developers are encountering common challenges during tool development and integration: the lack of unified standards hampers efficiency; constant adaptation across different platforms increases time and manpower costs; and open-source tools vary in quality, making maintenance and consolidation of high-quality capabilities expensive.
That’s where MCP (Model Context Protocol) comes in. Released by Anthropic, MCP is a leading open protocol designed to establish a secure and consistent two-way connection between large language models (LLMs) and external data sources. It addresses the fragmentation in tool implementation and enables cross-model compatibility.
Think of MCP as a universal plug or a USB port—the protocol defines a consistent specification for transmitting data from applications to LLMs. Any model that supports MCP can seamlessly interact with any MCP-compliant application.

Understanding Agent / MCP / API (Tool) Through the Story of a Smart Butler
Imagine having a smart butler at home. You simply describe what you need, and they take care of everything on your behalf. That’s the role of an Agent.

| Role | Story Analogy | Technical Equivalent | Main Responsibilities |
|---|---|---|---|
| 👤 User | Homeowner | End User | Submits a request and waits for the result. |
| 🤖 Agent | Smart Butler | Intelligent Agent | Understands user intent, performs reasoning, and orchestrates tools. •Duties: Interpret user needs, decide execution steps and order. •Capability: Connect multiple tasks into a complete solution. •Analogy: The brain and decision-making center. |
| 🔌 MCP | Plug Standard (Type-C) | Protocol Layer | Even the smartest butler struggles if every tool works differently. MCP solves the “tool invocation standardization” issue, allowing the butler to focus on task planning instead of interface compatibility. • Unified tool invocation specification • Agent doesn't need to understand the internal logic of each tool • Plug-and-play after standardization |
| 🛠️ Tool | Tools (Weather / Flight / Email) | APIs or Services | Tools are the entities that perform the actual tasks: • Weather tool → returns weather info • Flight tool → provides flight data • Email tool → sends confirmation emails |
Evolution of Three Development Approaches: API Docs → Function Call → MCP
From “Human Understanding” → “Model-Assisted Understanding” → “Model Execution via Protocol”
| Dimension | API Documentation | Function Call | MCP Protocol |
|---|---|---|---|
| 🧠 Understanding Entity | Human Developer | Model + Human (manual tool registration) | Model (auto protocol interpretation) |
| 🎯 Target Audience | Human-readable docs | Model-readable function signatures | Machine-readable protocol description |
| 🚀 Usage Flow | Read docs → Write request → Execute | Manually define function schema → Model invokes | MCP auto-exposes capability → Model discovers and invokes |
| 🧩 Tool Setup | Requires separate wrappers per platform | Requires registering function per platform | Configure MCP service address once |
| 🔍 Discoverability | Via documentation | Manually registered | Auto-discovered by model (dynamic capability detection) |
| 🔄 Tool Update | Manual doc sync required | Each platform must update separately | MCP auto-syncs capability manifest |
| 🧰 Integration Complexity | High: manual wrappers & prompt tuning | Medium: schema definition required | Low: auto-exposed via protocol, no duplicate config |
| 🧠 Model Comprehension | Driven by prompt + doc interpretation | Depends on function schema clarity | Protocol-defined structured types enable native model understanding |
| 🔒 Invocation Security | Weak (prone to parameter errors) | Moderate (schema constrains input format) | Strong (protocol-level validation + context control) |
| 💬 Analogy | “Read the manual, do it yourself” | “Read function signature, follow the format” | “Plug in Type-C, auto-detect and run” |
| ⚙️ Abstraction Layer | Application layer | SDK layer | Protocol layer |
| 🌐 Extensibility | Low: custom wrappers needed | Medium: depends on platform support | High: cross-platform capability standardization |
| 👩💻 Developer Experience | Manual-centric: write & maintain docs | Semi-automated: still need schema + setup | Fully automated: integrate once, reuse across LLMs |
How to Use
APIfox MCP and HAP MCP serve different purposes depending on your integration needs:
- APIfox MCP allows large language models to read and understand the API documentation of HAP applications — ideal for “making the model API-aware.”
- HAP MCP enables direct access and manipulation of application data — designed for “executing business actions through the model.”
| APIfox MCP | HAP MCP | |
|---|---|---|
| Purpose | Enable the model to understand HAP API documentation. | Allow the model to execute HAP application APIs. |
| Entry Point | Documentation URL: https://apifox.mingdao.com ![]() | Accessible from within the Application API Documentation panel. ![]() |
| Use Case | When the goal is to understand available API structures for generating API call strategies or orchestrating workflows. 📍Example: For a Customer Case Management application, if you want to create a real-time data dashboard, you can let the model (via a client like Cursor) access the API documentation using APIfox MCP (preferably V3 APIs). | When the goal is to perform actions or access real-time data directly within a production environment. 📍Example: In an orchestration flow, the model may directly retrieve application data, perform analysis, map fields, or update records using HAP MCP. |
| Characteristics | Exposes API definitions, documentation, and examples (read-only). Helps the model act as a knowledgeable API assistant. Best suited for: project development, API discovery, documentation automation. | Exposes executable tools with permission and security control. Helps the model act as a capable operational agent. Best suited for: business execution, production system workflows, governance. |
MCP Configuration
Retrieve the MCP Configuration from HAP
-
Open the Application API Documentation, navigate to the MCP tab, and copy the generated URL for configuration.

Cursor Configuration
-
Go to [Settings] > [Tools & MCP] to add a new MCP server.

-
Once saved, return to the list. A green indicator means the connection is successful.

Dify Integration
Using MCP in Agent Applications
-
Click the Plugins button in the upper-right corner, explore the Marketplace, search for MCP, and locate “MCP SSE / StreamableHTTP”, then click Install.

-
After installation, locate “MCP SSE / StreamableHTTP” under your installed plugins.

-
Example Configuration:
Enter your MCP config. You can replace"hap-mcp"with any alias name. Theurlshould be the one generated from your application.{"hap-mcp":{"transport":"streamable_http","url":"your-mcp-url-here"}}

-
Add the MCP tool and run a test to verify

Using MCP in Workflows
-
Click the Plugins button in the upper-right corner. In the Marketplace, search for “Agent Strategy (Support MCP Tools)” and click Install.


-
Example Configuration:
Enter your MCP config. You can replace"hap-mcp"with any alias name. Theurlshould be the one generated from your application.{"hap-mcp":{"transport":"streamable_http","url":"your-mcp-url-here"}}
VS Code + Cline Plugin
-
Install the Cline Plugin

-
Click "MCP Servers" in the bottom-right corner of VS Code to complete the configuration

-
Example Configuration:
"hap-mcp": {
"url": "your-mcp-url-here",
"type": "streamableHttp",
"disabled": false,
"autoApprove": []
}

