Skip to main content

MCP Server

What Is MCP?

Core Concepts

As AI agents continue to evolve, developers increasingly face common challenges when building and integrating tools:

  • No common standard, resulting in lower development efficiency.
  • Repeated integrations across different platforms, increasing development time and maintenance costs.
  • Inconsistent quality across community-built tools, making high-quality integrations difficult and expensive to maintain.

MCP (Model Context Protocol) was introduced to address these challenges. Developed by Anthropic, MCP is an open protocol that provides a standardized and secure way for large language models (LLMs) to communicate with external applications and data sources. It enables interoperable integrations and reduces fragmentation across AI ecosystems.

Think of MCP as a universal connector or USB interface for AI applications. It defines a standard protocol for exchanging data between applications and LLMs. Any AI model that supports MCP can interact with any MCP-compatible application.

Understanding Agents, MCP, and APIs (Tools) Through a Smart Assistant Analogy

Imagine having a smart personal assistant at home. You simply tell it what you need, and it takes care of everything for you. This is exactly the role of an AI Agent.

RoleIn the AnalogyTechnical EquivalentResponsibility
👤 UserThe homeownerEnd userDescribes the task and waits for the result.
🤖 AgentA smart personal assistantAI agentUnderstands the user's request, reasons through the task, and orchestrates the appropriate tools.

Responsibility: Determines what needs to be done and in what order.
Capability: Combines multiple tools into a complete workflow.
Think of it as: The brain and decision-making center.
🔌 MCPA universal power outlet (like USB-C)Protocol layerEven the smartest assistant would struggle if every tool had a different interface.

MCP standardizes how tools are discovered and invoked, allowing the agent to focus on solving tasks instead of adapting to different integrations.

• Standardizes tool invocation
• Hides implementation details from the agent
• Enables plug-and-play interoperability
🛠️ ToolIndividual tools (Weather, Flights, Email, etc.)API or serviceTools perform the actual work.

Weather tool → Returns weather information
Flight tool → Retrieves flight options
Email tool → Sends confirmation emails

Evolution of AI Integrations: API Documentation → Function Calling → MCP

Human Understanding → Model Understanding (Semi-Automated) → Direct Model Execution (Protocol-Based)

AspectAPI-based IntegrationFunction CallingMCP-based Integration
🧠 Who Interprets ItHuman developersAI model + developer (manual tool registration)AI model (automatic protocol discovery)
🎯 Primary InterfaceHuman-readable documentationFunction schema for AI modelsMachine-readable protocol definition
🚀 How It WorksRead the API docs → Write requests → Call the APIDefine function schemas → AI selects and calls functionsExpose an MCP server → AI automatically discovers and invokes capabilities
🧩 Tool SetupConfigure integrations separately for each platformRegister functions separately on each platformConfigure the MCP server once
🔍 Capability DiscoveryManual documentation lookupManual registrationAutomatic capability discovery
🔄 Capability UpdatesDocumentation changes must be synchronized manuallyFunction definitions must be maintained on every platformCapabilities are synchronized automatically through the MCP manifest
🧰 Integration ComplexityHigh — manual implementation and prompt engineering requiredMedium — function schemas must be definedLow — capabilities are exposed automatically through the protocol
🧠 Model UnderstandingPrompt-driven, based on documentationInfers usage from function descriptionsStructured protocol with built-in types for direct understanding
🔒 Invocation SafetyLow — incorrect parameters can easily cause failuresMedium — schemas validate parameter formatsHigh — protocol-level validation and contextual controls
💬 Analogy"Read the manual and do it yourself.""Read the function signature and call it.""Plug in a USB-C cable and everything just works."
⚙️ Abstraction LayerApplication layerSDK layerProtocol layer
🌐 ExtensibilityLow — platform-specific integrationsMedium — depends on platform supportHigh — unified capability discovery across platforms
👩‍💻 Developer ExperienceHuman-centric: write and maintain documentationSemi-automated: register and maintain functionsFully automated: integrate once, reuse across AI models

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 MCPHAP MCP
PurposeEnable the model to understand HAP API documentation.Allow the model to execute HAP application APIs.
AccessDocumentation: https://apifox.mingdao.com
Accessible from within the Application API Documentation panel.
Use CaseWhen 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.
CharacteristicsExposes 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.

Configure MCP

Get the HAP MCP Endpoint

  1. Open your application's API Documentation.
  2. Switch to the MCP tab.
  3. Copy the generated URL, which will be used in the following configuration steps.

Cursor

  1. Open CursorSettingsTools & MCP.
  2. Click New MCP Server.

After saving, a green status indicator means the connection has been established successfully.

Dify

Use MCP in an Agent App

  1. Click Plugins in the upper-right corner.
  2. Explore Marketplace.
  3. Search for MCP SSE / StreamableHTTP and install the plugin.

After installation, locate MCP SSE / StreamableHTTP in the installed plugins list.

Example configuration

Replace "hap-mcp" with any name you prefer, and replace the URL with the MCP endpoint generated by your HAP application.

{"hap-mcp":{"transport":"streamable_http","url":"<Generated MCP URL>"}}

Add the MCP tool and verify that it works as expected.

Use MCP in a Workflow

  1. Click Plugins in the upper-right corner.
  2. Explore Marketplace.
  3. Search for Agent Strategies (Support MCP Tools) and install it.

Example configuration

Replace "hap-mcp" with any name you prefer, and replace the URL with the MCP endpoint generated by your HAP application.

{"hap-mcp":{"transport":"streamable_http","url":"<Generated MCP URL>"}}

VS Code + Cline

  • Install the Cline Extension

  • Click MCP Server to configure the MCP server

Example configuration

"hap-mcp": {
"url": "<Generated MCP URL>",
"type": "streamableHttp",
"disabled": false,
"autoApprove": []
}

Was this document helpful?