MCP Integration Guide: Building AI Assistant Plugins and Connectors

    Learn what the Model Context Protocol (MCP) is, how MCP tool and resource calls differ from host-native plugins, and how to evaluate enterprise integrations. This guide covers architecture choices, permissions, data governance, error handling, idempotency, and practical use cases across sales, finance, and human resources.

    What Is MCP, and What Problems Does It Solve?

    The Model Context Protocol (MCP) is an open protocol that enables large language models to interact with external tools and data sources. Anthropic released it in November 2024, and its message format uses JSON-RPC 2.0.

    Under the official specification, the roles are divided as follows:

    • Host: The application that runs the language model, such as an AI assistant or an IDE.
    • Client: Created by the host and maintained as a one-to-one connection with a server.
    • Server: Exposes three types of capabilities: tools, resources, and prompt templates.

    MCP’s core purpose is to give models a consistent way to discover tools, read data, and execute actions. It does not define the user interface, nor does it move an entire third-party application into a chat window. MCP versions follow the official specification and use date-based version numbers. Always review the change notes before upgrading.

    Chat Previews and Full Applications Are Different Mechanisms

    Early connectors often appeared as cards inside a conversation. The AI called an external API and rendered the result as a Markdown table or a simple card. This approach works well for lightweight tasks such as checking the weather or an order status. However, it has three limitations in more complex office workflows:

    • Users must switch between the chat window and the native application.
    • Cards generally support only read-only operations or simple form submissions.
    • Stateless API calls make it difficult to preserve context across multiple operations.

    The industry has also explored another approach: running a third-party application with a complete interface inside the host. This approach is often confused with MCP tool calling, but the two solve different problems and use different implementation models.

    Layer 1: MCP Tool and Resource Calls

    This layer focuses on what the model can call. A server declares the available tools. The model determines when to use them during a conversation, the host forwards the call to the server, and the result is returned to the model.

    The following simplified messages show how a client can list tools and initiate a call:

    1. {"jsonrpc":"2.0","id":1,"method":"tools/list"}
    2. {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_orders","arguments":{"customer_name":"Example Customer Co., Ltd.","limit":10}}}

    The server returns a result containing a content array, which the model uses to generate its response. Tool descriptions and parameter schemas directly affect whether the model selects a tool correctly. Descriptions should therefore be specific and should clearly identify side effects.

    Layer 2: Host-Native Plugins or Application Containers

    This layer belongs to the host platform’s own extension system. The host determines how third-party interfaces are loaded, how they are isolated, and what data permissions they receive. Implementations vary significantly. Some use sandboxed front-end containers, while others rely on custom manifest files.

    The MCP specification does not standardize this layer. Developers should follow the documentation for the target platform and should not assume that a plugin will behave consistently across different hosts.

    A practical rule is:

    • If the requirement is to let the model read or write data in another system, start with MCP tools and resources.
    • If users need to operate a complete interface directly inside a conversation, check whether the target platform supports host-native applications and evaluate its permission model.

    Choosing an Enterprise Integration: A Decision Checklist

    Before selecting an approach, answer the following questions in order:

    1. Does the task only require reading data or performing a small number of actions? If so, MCP tools are usually sufficient.
    2. Do users need rich-text editing, drag-and-drop interactions, or multi-step forms? If so, evaluate host-native application capabilities.
    3. Does the data include customer, financial, or human resources information? If so, first confirm whether the data may pass through a third-party model or server.
    4. Does the team need to reuse the same capability across multiple AI assistants? If so, protocol standardization becomes more valuable.
    5. Can the workflow be rolled back if something fails? If a write operation cannot be undone, require human confirmation by default.

    This checklist does not replace an architecture review, but it helps move the discussion from “Should we connect AI?” to “Which layer should we integrate, and how much access should we expose?”

    Permissions, Security, and Data Egress

    The primary risks in enterprise integrations involve permissions and data flows. The following principles are recommended:

    • Least privilege: Each tool should request only the data needed to complete its task. Avoid general-purpose administrator tokens.
    • User-level authorization: Execute calls on behalf of the specific user, and retain audit logs recording the caller, timestamp, parameter summary, and result status.
    • Confirmation for write operations: Require explicit user confirmation for actions such as deletion, sending messages, changing amounts, or modifying permissions.
    • Data masking: Mask or truncate fields such as government ID numbers, bank card numbers, and salary details before they enter the model context.
    • Data-egress review: Confirm the regions in which the model provider, connector server, and logging system operate, as well as their data-retention periods. Ensure that these arrangements meet internal compliance requirements.

    For third-party interfaces running in isolated containers, also review their network egress policies. Permission declarations should specify the types of data and network ranges that the interface can access. Complete a permission audit or security test before deployment.

    Common Mistakes and How to Avoid Them

    Many integration problems result not from the protocol itself, but from design and operational oversights. The following issues are especially common.

    Vague Tool Descriptions

    When a tool description is too general, the model cannot determine when it should be used. This can lead to unnecessary or missed calls. Describe the meaning of every input parameter, the returned fields, and situations in which the tool must not be used.

    Missing Error Handling

    JSON-RPC defines standard error codes. For example:

    • -32602 indicates invalid parameters.
    • -32601 indicates that the method does not exist.
    • -32603 indicates an internal error.

    Servers should return readable error messages and distinguish between retryable and non-retryable errors.

    Repeating an Operation After a Timeout

    A write operation that is retried after a network timeout can create duplicate orders or duplicate emails. Write APIs should support idempotency keys. Before retrying, the client should first check the status of the original operation.

    Validating Only with Demonstration Data

    Using sample data instead of real test scenarios can hide issues before launch. Run complete critical workflows in a test environment and record the success rate, average response time, and error distribution.

    Enterprise Use Cases: Sales, Finance, and Human Resources

    In a sales-preparation workflow, a CRM server can provide tools for querying historical orders and communication records by customer name. The model can summarize the information and generate a meeting outline. Because this scenario requires read-only access, it presents relatively low risk and is suitable for an initial pilot.

    Financial data in an ERP system is generally more sensitive. A safer approach is to expose only report-reading tools. The model can identify unusual changes and generate explanations, while voucher updates and payment operations remain in the original system.

    In human resources, employees can use natural language to query their own leave balance or performance rating. Queries involving other employees must rely on organizational structure and role-based permissions; they cannot depend solely on the model’s judgment. Features such as filtering employees or drafting emails should first be validated with masked data before real data is gradually introduced.

    The common pattern across all three cases is to start with read operations, defer write operations, require human confirmation at each step, and retain audit logs.

    Coordinating Native Office Components with External Systems

    AI-native spreadsheets, whiteboards, and data-analysis tools are capabilities provided by the host itself and do not depend on a third-party protocol. They can receive natural-language instructions.