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.