MCP-Server-for-Indonesian-Custom-Tarif
The project is an example MCP server implementation for educational purposes, focusing on Indonesian customs tariff data and Hascode API integration. It demonstrates how MCP can standardize data access to APIs, providing a structured way to connect to various data sources. The server supports AI tools by offering resources, tools, and prompts for accessing customs information.
MCP Server Example for Indonesian Customs Tariff & Hascode API
This repository provides an example implementation of a Model Context Protocol (MCP) server, customized for educational use in the context of Indonesian customs tariff data and Hascode API integration. The project demonstrates how to build a functional MCP server that connects to APIs such as Hascode to fetch tariff and HS code information for AI models.
What is MCP?
MCP (Model Context Protocol) is an open standard designed to provide structured context to Large Language Models (LLMs). MCP offers a standardized way to plug models into various external data sources, such as customs tariff APIs, HS code lookups, or logistics databases.
Key Benefits
- Pre-built integrations for services like the Hascode API, providing real-time HS code and duty rate information
- Flexibility to work across different LLM providers
- A clean abstraction layer for securely accessing regulated data
Architecture Overview
MCP uses a client-server architecture that supports multiple data access points:
- MCP Hosts: AI tools that request structured customs data
- MCP Clients: Protocol intermediaries for communication with servers
- MCP Servers: Components that expose data and capabilities
- Data Sources: Includes local files and remote APIs
Core MCP Concepts
An MCP server typically exposes:
- Resources: HS code datasets, tariff schedules, or API responses
- Tools: API functions for updated customs information
- Prompts: Pre-configured templates
System Requirements
- Python 3.10 or higher
- MCP SDK 1.2.0 or higher
uv
package manager
Getting Started
Installing uv
Package Manager
On MacOS/Linux:
Then restart your terminal to enable the uv
command.
Project Setup
- Initialize your MCP project
- Create the main server file
Example: Integrate with Hascode API
Define a resource to fetch tariff data using Hascode.
Connecting to Claude Desktop
- Install Claude Desktop
- Edit the config file
- Restart Claude Desktop
Troubleshooting
If Claude Desktop fails to detect your server:
- Check the config file path and syntax
- Use the absolute path for directories
- Ensure
uv
is installed - Review Claude logs
License
This project is licensed under the MIT License.