Welcome to the Coin MCP Server – your one-stop shop for snagging the latest cryptocurrency prices faster than you can say "To the moon!" 🌙 Built with FastMCP and spiced up with zod for validation, this little server is here to fetch token prices from Bitget’s API like a trusty crypto butler. 🧑💼 中文文档 | English This project spins up a server that lets you query the current price of any cryptocur
Add this skill
npx mdskills install pwh-pwh/coin-mcp-serverProvides real-time cryptocurrency price queries via Bitget API with clear setup and multiple tools
1# Coin MCP Server 🚀💰23Welcome to the **Coin MCP Server** – your one-stop shop for snagging the latest cryptocurrency prices faster than you can say "To the moon!" 🌙 Built with `FastMCP` and spiced up with `zod` for validation, this little server is here to fetch token prices from Bitget’s API like a trusty crypto butler. 🧑💼45[中文文档](README-cn.md) | English67---89## What Does It Do? 🤔1011This project spins up a server that lets you query the current price of any cryptocurrency (paired with USDT) using Bitget’s slick API. Want to know how much your favorite token is worth right now? Just ask, and boom – the price is yours! 💸1213- **Tool**: `getTokenPrice`14- **Mission**: Fetch the latest price of a token (e.g., `BGB`, `BTC`, `ETH`).15- **Superpower**: It’s fast, it’s simple, and it’s powered by `FastMCP`! ⚡1617- **Tool**: `getAnnoucements`18- **Mission**: get annoucements1920- **Tool**: `getCoinInfo`21- **Mission**: Get detailed information about a specified token.22- **Superpower**: Provides detailed information such as token transferability, supported chain list, chain network status, etc.2324---2526## Features 🌟2728- 🎯 **Dead-Simple API**: Pass a token symbol, get a price. No fuss, no muss.29- 🛡️ **Zod Validation**: Parameters are checked tighter than a vault door.30- 📡 **Bitget Integration**: Pulls live data straight from Bitget’s market ticker API.31- 🧠 **Error Handling**: Catches hiccups like a pro and logs them for you to giggle at later.3233---3435## Getting Started 🏁3637Ready to dive into the crypto price pool? Here’s how to get this baby running:3839### Prerequisites40- **Deno**: You’ll need Deno installed because we’re fancy and modern. Grab it [here](https://deno.land/).41- **Bitget API Access**: No API key needed – we’re hitting the public endpoint like champs! But if you’ve got a custom `BGURL`, set it as an environment variable.4243### Installation441. Clone this repo like it’s hot:45 ```bash46 git clone https://github.com/pwh-pwh/coin-mcp-server.git47 cd coin-mcp-server48 ```492. Install dependencies (Deno handles this automagically via imports!).5051### Running the Server52Fire it up with:53```bash54deno run --allow-net --allow-env --allow-read main.ts55```5657or58```bash59deno run --allow-net --allow-env --allow-read https://deno.land/x/coin_mcp_server/main.ts60```6162- `--allow-net`: Lets us talk to Bitget’s API.63- `--allow-env`: Grabs your `BGURL` env variable if you’ve set one.6465The server will start in `stdio` mode, ready to serve up prices like a crypto vending machine! 🍔66673. Support installation-free, directly deploy to deno, fork this project, log in dash.deno.com, set the environment variable StartType=sse to use the domain name provided by deno to connect in sse mode6869---7071### Configuration7273config.json74```json75{76 "mcpServers": {77 "coin-mcp": {78 "command": "deno",79 "args": [80 "run",81 "--allow-net",82 "--allow-read",83 "--allow-env",84 "https://deno.land/x/coin_mcp_server/main.ts"85 ]86 }87 }88}89```9091## Usage Example 🎮9293Here’s how you’d call `getTokenPrice`:94```json95{96 "tool": "getTokenPrice",97 "parameters": {98 "token": "BGB"99 }100}101```102103**Response**:104```105"42.069" // The latest BGB/USDT price (not a real price, just vibes!)106```107108If the token doesn’t exist or the API hiccups, it’ll throw an error with a cheeky log to remind you it tried its best. 😅109110---111112## Code Sneak Peek 👀113114Here’s the magic behind the curtain:115- **FastMCP**: Spins up the server with a cool name and version.116- **Zod**: Keeps your `token` parameter in check.117- **Bitget API**: Fetches ticker data from `https://api.bitget.com/api/v2/spot/market/tickers`.118119The `getBitgetPrice` function is the MVP, grabbing that sweet `lastPr` (last price) from the response. Check the logs for price updates or error comedy gold! 😂120121---122123## Environment Variables 🌍124125- `BGURL`: Custom Bitget API base URL (defaults to `https://api.bitget.com` if not set). Set it like:126 ```bash127 export BGURL="https://your-custom-bitget-url.com"128 ```129130---131132## Troubleshooting 🛠️133134- **“HTTP error! status: 404”**: Double-check your token symbol. `BGBUSDT` isn’t the same as `BGB`!135- **“Network error”**: Make sure you’ve got internet and Deno’s `--allow-net` flag.136- **Still stuck?**: Yell into the void (or open an issue). We’ll figure it out together! 🙌137138---139140## Why This Exists 🎉141142Because who doesn’t want to know the price of their crypto stash in real-time? Whether you’re a trader, a HODLer, or just crypto-curious, this server’s got your back. Plus, it’s a fun way to flex some Deno skills and play with APIs. 😎143144---145146## Contributing 🤝147148Got ideas? Found a bug? Want to add a feature like moon phase price predictions? Fork it, tweak it, PR it! Let’s make this the coolest MCP server in the galaxy. 🌌149150---151152## License 📜153154MIT – Do whatever you want with it, just don’t blame me if your token moons or dumps! 🌑📉155156---157158Happy crypto hunting, and may your bags always be green! 💚159
Full transparency — inspect the skill content before installing.