Token导航 LogoToken导航TokenDH.com
MCP Bitoin Price logo
金融服务stdio官方级别未说明来源级核验

MCP Bitoin Price

MCP Server

MCP Server是一个从Binance API获取实时加密货币价格并与GitHub Copilot集成的服务。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
加密货币API集成PythonVS CodeGitHub CopilotVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

tindoantrong

提供方

tindoantrong

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

Crypto Price MCP Server

MCP Server để lấy giá cryptocurrency từ Binance API, tích hợp với GitHub Copilot.

🚀 Tính năng

  • ✅ Lấy giá crypto real-time từ Binance
  • ✅ Hỗ trợ nhiều loại transport: stdio, WebSocket, HTTP
  • ✅ Tích hợp với GitHub Copilot
  • ✅ Auto-retry và error handling

📦 Cài đặt

pip install -r requirements.txt

🔧 Cách sử dụng

1. Sử dụng với GitHub Copilot (RECOMMENDED)

Cấu hình stdio (Đơn giản nhất):

Thêm vào file cấu hình MCP của GitHub Copilot:

Windows: %APPDATA%\Code\User\globalStorage\github.copilot-chat\mcpServers.json

macOS: ~/Library/Application Support/Code/User/globalStorage/github.copilot-chat/mcpServers.json

Linux: ~/.config/Code/User/globalStorage/github.copilot-chat/mcpServers.json

Nội dung:

{
  "mcpServers": {
    "crypto-price": {
      "type": "stdio",
      "command": "python",
      "args": ["F:\\wampp\\www\\mcp-bitoin-price\\crypto_price.py"]
    }
  }
}

Lưu ý: Thay đường dẫn bằng đường dẫn tuyệt đối đến file crypto_price.py trên máy bạn.

Sau đó:

  1. Restart VS Code
  2. Mở GitHub Copilot Chat
  3. Server sẽ tự động khởi động khi cần

2. Sử dụng HTTP Server (Nếu stdio không hoạt động)

Chạy server:

python mcp_http_server.py

Server chạy tại: http://127.0.0.1:8765

Cấu hình cho GitHub Copilot:

{
  "mcpServers": {
    "crypto-price": {
      "type": "streamablehttp",
      "url": "http://127.0.0.1:8765"
    }
  }
}

3. Sử dụng WebSocket Server

Chạy server:

python mcp_websocket.py

Server chạy tại: ws://localhost:8766

4. Sử dụng với mcp_pipe (Remote WebSocket)

Set environment variable:

# Windows (PowerShell)
$env:MCP_ENDPOINT = "ws://your-server.com:8766"

# Linux/Mac
export MCP_ENDPOINT="ws://your-server.com:8766"

Chạy:

python mcp_pipe.py

📝 Tools có sẵn

1. get_crypto_price

Lấy giá của một cryptocurrency.

Parameters:

  • symbol (string): Mã cryptocurrency (e.g., 'BTC', 'ETH', 'ADA')

Example:

Get price of BTC
Get current price of Ethereum
What is the price of Cardano?

2. get_multiple_prices

Lấy giá của nhiều cryptocurrencies cùng lúc.

Parameters:

  • symbols (string): Danh sách mã currencies cách nhau bởi dấu phẩy

Example:

Get prices of BTC, ETH, ADA, BNB
Show me Bitcoin, Ethereum and Cardano prices

🧪 Test thử

Test trực tiếp với curl:

# Test HTTP server
curl -X POST http://127.0.0.1:8765 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/list",
    "id": 1
  }'

Test với GitHub Copilot:

Sau khi cấu hình xong, mở GitHub Copilot Chat và thử:

  • "What is the current price of Bitcoin?"
  • "Get me the prices of BTC, ETH, and ADA"
  • "Show me Cardano price"

🔍 Troubleshooting

Lỗi 405 Method Not Allowed

→ Sử dụng stdio transport thay vì HTTP/SSE

Server không khởi động

→ Kiểm tra Python đã được cài đặt: python --version → Kiểm tra dependencies: pip install -r requirements.txt

GitHub Copilot không nhận diện tools

  1. Kiểm tra đường dẫn file trong config
  2. Restart VS Code
  3. Kiểm tra log của GitHub Copilot
  4. Thử chạy trực tiếp: python crypto_price.py

Port đã được sử dụng

→ Thay đổi port trong file server (default: 8765, 8766)

📂 Cấu trúc Project

mcp-bitcoin-price/
├── crypto_price.py          # MCP server chính (stdio)
├── mcp_http_server.py       # HTTP/Streamable transport
├── mcp_websocket.py         # WebSocket broker
├── mcp_pipe.py              # Remote WebSocket client
├── mcp_server.py            # FastAPI server (SSE)
├── requirements.txt         # Python dependencies
├── copilot_config_stdio.json       # Config mẫu (stdio)
├── copilot_config_example.json     # Config mẫu (HTTP)
└── README.md

🛠️ Development

Xem logs:

Server sẽ output logs ra stderr. Quan sát để debug.

Thêm tools mới:

Edit crypto_price.py và thêm decorator @mcp.tool():

@mcp.tool()
def your_new_tool(param: str) -> dict:
    """Tool description"""
    # Your code here
    return {"result": "data"}

📄 License

MIT

🤝 Contributing

Pull requests are welcome!

目录标签

目录标签

加密货币API集成PythonVS CodeGitHub Copilot本地部署实时数据GitHubCopilot

支持客户端

VS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP