我如何在一個週末構建 3 個 MCP 伺服器(以及我的心得)
How I Built 3 MCP Servers in a Weekend (and what I learned)
一名開發者在一個週末構建了 3 個 MCP 伺服器,分別用於查詢 160 多種貨幣的即時匯率、篩查全球制裁名單,以及為產品分類 HS code。三個伺服器均為開源,並可在 Glama.ai 使用。作者表示,使用 SDK 約 30 行程式碼便可構建一個伺服器。
I've been building B2B APIs for a while, but recently I got into MCP (Model Context Protocol). It's a game-changer for AI agents.
In this post, I'll share how I built 3 MCP servers in a weekend — and what I learned.
What is MCP?
MCP is a protocol that allows AI agents (like Claude, ChatGPT) to call external tools. Instead of giving an AI a huge prompt, you give it a tool it can call. It's faster, cheaper, and more reliable.
The 3 MCP Servers
1. Currency Exchange MCP
What it does: Gets real-time exchange rates for 160+ currencies.
Why I built it: Most AI agents don't have access to live currency data. This fixes that.
GitHub: currency-exchange-mcp
2. Sanctions MCP
What it does: Screens entities against global sanctions lists (OFAC, UK, EU, UN).
Why I built it: Compliance is a huge pain for fintech. This makes it easy for AI agents to do it.
GitHub: sanctions-mcp
3. HS Codes MCP
What it does: Classifies any product into a Harmonized System (HS) code.
Why I built it: Importers and exporters need this. Now AI agents can do it in seconds.
GitHub: hs-codes-mcp
What I Learned
- MCP is simple. The SDK is well-designed. You can build a server in ~30 lines of code.
- Glama.ai is the best directory. They accepted my servers in minutes.
- AI agents are the future. More and more people will use MCP to connect tools.
Try Them Out
All 3 servers are open-source and available on Glama.ai.
You can also check out my other APIs at jsonexlab.com.
What are you building with MCP? Let me know in the comments!
來源:DEV Community · dev.to