MCP Server Developer Guide
This guide explains how to build a compliant and functional MCP server from scratch. You'll learn about:
- The core architecture and logic of an MCP server
- How to wrap existing APIs into MCP-compatible services
MCP Server
An MCP server is a standalone program (typically Node.js or Python) that exposes a list of tools or capabilities an AI client can invoke. MCP servers:
- Define tools using structured schemas (JSON /
zod
) - Accept input from clients via a known protocol (STDIO or SSE)
- Execute logic or call APIs
- Return structured results back to the client
Wrapping External APIs
Many MCP servers are just wrappers around public APIs (e.g., item ecosystems (oms, wms, bnp, tms), channels (Shopify, Amazon,) Perplexity, GitHub, Claude).
Common Example: Wrapping GitHub API
execute: async ({ repo }) => {
const res = await fetch(`https://api.github.com/repos/${repo}`);
const data = await res.json();
return { stars: data.stargazers_count };
}
Converting API to MCP Server via Channel Store in item DI
This guide focus on how to configure and register an external API in Item DI using the Channel Store, and convert it into an MCP-compatible server that can be used in Item MCP. This process is typically handled by developers and system integrators.
Step 1: Configure Basic Information
- Log into the Item DI system
- In the left-side menu, click Channel Store
- Click
+
to add a new channel - Fill in the connector's basic metadata:
Field | Description |
---|---|
Name | Name of the channel (shown to users) |
Connector Code | Unique identifier used internally |
Upload Logo | Optional visual icon |
Connector Type | Choose from: external channel, item internal system, etc. |
Country/Region | Supported region |
Help Document | URL to usage guide or help center |
Limit | Rate limit |
Limit Unit | Time unit for limit (days, hours, seconds) |
Dev URL / Stage URL / Prod URL | Environments for API endpoint switching |
Description | Short summary of the connector function |
- After all fields are completed, click Save.
Step 2: Configure Authentication Method
Based on the API’s specification, select the correct authorization type used to access the API. Supported types may include:
- API Key
- OAuth
- Client ID + Secret
- Authorization Code
- Password
- Session Token
- Basic Auth
Different authorization methods will trigger different configuration UI pages in Item DI.
Step 3: Configure Execute Operations
This is where you import the actual API specification and prepare it to be executed and tested.
-
Navigate to the Execute Operation tab
-
Click Import to begin adding the API endpoints
-
Choose an import method:
- Import File – drag in a Swagger/OpenAPI file directly
- Import from Apifox – input your API Key, Project ID, and File ID
-
After successful import, the available endpoints will appear in a list
-
Choose a specific endpoint and click Test to debug it
Notes
Before testing, you must create a corresponding channel under a merchant account. This enables the system to locate the associated connector in the Channel Store for testing and test connection behavior.
After completing these steps, the connector (API) becomes available in Item DI as a "channel". It is now also exposed to Item MCP as a server following the MCP protocol automatically. You can test or register it in Playground, or add it to MCP clients.