CV

crydevok/vastai-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

13 stars 7 forks 质量 57 趋势 20

1. : - 登录到coper.vast.ai - 转到账户 > API 密钥 - 创建或复制您的 API 密钥

概览

1. : - 登录到coper.vast.ai - 转到账户 > API 密钥 - 创建或复制您的 API 密钥 3. (对于克洛德桌面或其他MCP客户端):更新您的MCP配置文件(~/.cursor/mcp.json for Cursor): 对于完整的功能,请确保设置 SSH 密钥 : 2. :您应当同时看到 id rsa(私人)和 id rsa.pub(公共)文件。 - 确定您的 SSH 密钥有正确的权限 : - 校验您的 API 密钥正确, 并在 Vast.ai 有适当的权限 - 确保您能够从您的网络到达控制台.vast.ai 该文件描述了如何使用Vast.ai MCP(模式上下文协议)服务器与Vast.ai GPU云平台互动.

概述(AI 翻译)

□ macOS 安装指南

· 先决条件

  1. ** 安装u**(Python包管理器):

· 安装 Vast.ai MCP 服务器

  1. ** 登记存放处**:

  2. ** 使用v**建立依赖关系:

  3. ** 将服务器安装为工具**:

QQ 配置

  1. 获取您的 Vast.ai API 密钥**:
  1. ** 配置MCP客户端**(为克洛德桌面或其他MCP客户端):

更新您的 Cursor MCP 配置文件 :

QQ 验证安装

  1. ** 直接测试服务器**:

SSH 密钥设置( 建议)

对于完整的功能,请确保设置 SSH 密钥 :

  1. Generate SSH 键对(如果你没有:

  2. ** 验证存在的关键文件**:

您应该同时看到[T1和[T2文件。

  • 解决问题
  • ** 被拒绝**: 确保您的 SSH 密钥有正确的权限 :

  • ** API关键问题**: 校验您的 API 密钥正确, 在 Vast.ai 有适当的权限

  • ** 网络问题**:确保从网络中达到console.vast.ai

Vast.ai MCP 服务器使用指南

这份文件描述了如何使用"瓦斯".

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Installation

macOS Installation Guide

Prerequisites

  1. Install uv (Python package manager):
    brew install uv
    

Install the Vast.ai MCP Server

  1. Clone the repository:

    git clone https://github.com/your-repo/vastai-mcp.git
    cd vastai-mcp
    
  2. Install dependencies using uv:

    uv sync
    
  3. Install the server as a tool:

    uv tool install -e .   # Install from current directory
    

Configuration

  1. Get your Vast.ai API key:

    • Log in to console.vast.ai
    • Go to Account > API Keys
    • Create or copy your API key
  2. Configure MCP client (for Claude Desktop or other MCP clients):

    Update your MCP configuration file (~/.cursor/mcp.json for Cursor):

    {
      "mcpServers": {
         "vast-ai": {
           "command": "uv",
           "args": [
               "run",
               "vast-mcp-server"
           ],
           "env": {
               "VAST_API_KEY": "your_vast_api_key_here",
               "SSH_KEY_FILE": "~/.ssh/id_rsa",
               "SSH_KEY_PUBLIC_FILE": "~/.ssh/id_rsa.pub"
           }
         }
      }
    }
    

Verify Installation

  1. Test the server directly:
    uv tool run vast-mcp-server --help
    

For full functionality, ensure you have SSH keys set up:

  1. Generate SSH key pair (if you don’t have one):

    ssh-keygen -t rsa -b 4096 -C "[email protected]"
    
  2. Verify key files exist:

    ls -la ~/.ssh/id_rsa*
    

    You should see both id_rsa (private) and id_rsa.pub (public) files.

Troubleshooting

  • Permission denied: Make sure your SSH key has correct permissions:

    chmod 600 ~/.ssh/id_rsa
    chmod 644 ~/.ssh/id_rsa.pub
    
  • API key issues: Verify your API key is correct and has proper permissions on Vast.ai

  • Network issues: Ensure you can reach console.vast.ai from your network

Vast.ai MCP Server Usage Guide

This document describes how to use the Vast.ai MCP (Model Context Protocol) server to interact with the Vast.ai GPU cloud platform.

Available Tools

This server provides 23 tools for managing Vast.ai GPU instances:

1. show_user_info()

Show current user information and account balance.

Returns:

  • Username, email, account balance, user ID
  • SSH key information (if available)
  • Total spent amount

2. show_instances(owner: str = “me”)

Show user’s instances (running, stopped, etc.)

Parameters:

  • owner (optional): Owner of instances to show (default: “me”)

Returns:

  • List of all instances with their details:
    • Instance ID and status
    • Label and machine ID
    • GPU type and specifications
    • Hourly cost
    • Docker image
    • Public IP address (if available)
    • Creation date

3. search_offers(query: str = “”, limit: int = 20, order: str = “score-”)

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "vast-ai": { "command": "uv", "args": [ "run", "vast-mcp-server" ], "env": { "VAST_API_KEY": "your_vast_api_key_here", "SSH_KEY_FILE": "~/.ssh/id_rsa", "SSH_KEY_PUBLIC_FILE": "~/.ssh/id_rsa.pub" } } } }