API配额监控服务

Cursor Pro Limits MCP Server是一款用于监控Cursor Pro使用限制和API配额的服务器,帮助用户跟踪不同AI服务的每日使用情况并保持在限制范围内。

  • by mehmetfiskindal
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 mehmetfiskindal/cursor-pro-limits-mcp

使用说明

Cursor Pro限制MCP服务器

模型上下文协议(MCP)服务器,用于监控Cursor Pro的使用限制和API配额。此服务器可帮助您跟踪不同AI服务的日常使用情况,并保持在Cursor Pro的限制范围内。

特性

  • 📊 实时使用监控:跟踪Sonnet 4.5、Gemini和GPT-5请求使用情况
  • 🚨 警报系统:接近极限时收到警告
  • 📈 使用统计:当前使用与限制的详细细分
  • 🔧 易于集成:适用于任何兼容MCP的客户端
  • 🎯 TypeScript:完全类型化,具有严格的TypeScript配置

Cursor Pro限额(每月)

基于Cursor Pro订阅限制:

专业级别

  • 十四行诗4.5:225个请求/月
  • 双子座:550次请求/月
  • GPT-5:500个请求/月
  • 总计:1275次请求/月

专业+等级

  • 十四行诗4.5:675个请求/月
  • 双子座每月1650次请求
  • GPT-5:1500个请求/月
  • 总计:3825个请求/月

超等级

  • 十四行诗4.5:4500个请求/月
  • 双子座:11000次请求/月
  • GPT-5:10000次请求/月
  • 总计:25500次请求/月

安装

npm install cursor-pro-limits-mcp

用法

作为MCP服务器

  1. 配置您的MCP客户端 要使用此服务器,请执行以下操作:
{
  "mcpServers": {
    "cursor-pro-limits": {
      "command": "npx",
      "args": ["cursor-pro-limits-mcp"]
    }
  }
}
  1. 可用工具:

get_usage_stats

获取所有服务的全面使用统计数据。

// Returns current usage, limits, percentages, and remaining requests

get_service_usage

获取特定服务的详细用法。

参数:

  • service: "sonnet45" | "gemini" | "gpt5" | "total"

check_alerts

检查服务是否接近或超过限制。

update_usage

更新使用统计数据(用于测试或手动更新)。

参数:

  • sonnet45Requests (可选):十四行诗4.5请求数
  • geminiRequests (可选):Gemini请求数
  • gpt5Requests (可选):GPT-5请求数
  • totalRequests (可选):请求总数

set_subscription_tier

设置订阅级别(专业、专业+、超级)。

参数:

  • tier:订阅级别(“专业”、“专业+”或“超级”)

get_subscription_info

获取当前订阅级别和限制信息。

程序化使用

import { CursorLimitsMonitor } from 'cursor-pro-limits-mcp';

// Create monitor for Pro tier (default)
const monitor = new CursorLimitsMonitor('pro');

// Get current usage stats
const stats = monitor.getUsageStats();
console.log(`Sonnet 4.5: ${stats.limits.sonnet45Requests}/${stats.quotas.maxSonnet45Requests}`);

// Check for alerts
const alerts = monitor.checkAlerts();
if (alerts.length > 0) {
  console.log('Warning: Approaching limits!');
}

// Update usage (e.g., from API response)
monitor.updateLimits({
  sonnet45Requests: 150,
  geminiRequests: 300,
  gpt5Requests: 200,
  totalRequests: 650
});

// Switch to Pro+ tier for higher limits
monitor.updateTier('pro-plus');
console.log(`Switched to ${monitor.getCurrentTier()} tier`);

发展

先决条件

  • Node.js 18.0.0或更高版本
  • npm或纱线

设置

# Clone the repository
git clone <repository-url>
cd cursor-pro-limits-mcp

# Install dependencies
npm install

# Build the project
npm run build

可用脚本

# Build TypeScript
npm run build

# Watch mode for development
npm run dev

# Start the server
npm start

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

# Format code
npm run format

# Check formatting
npm run format:check

# Clean build directory
npm run clean

代码质量

本项目使用:

  • TypeScript 具有严格的配置
  • ESLint 用于代码过滤
  • 更漂亮 用于代码格式化
  • 不 any 类型 -全类型代码库

api参考

类型

interface CursorProLimits {
  sonnet45Requests: number;
  geminiRequests: number;
  gpt5Requests: number;
  totalRequests: number;
  lastUpdated: Date;
}

interface UsageStats {
  limits: CursorProLimits;
  quotas: CursorProQuotas;
  usagePercentages: {
    sonnet45: number;
    gemini: number;
    gpt5: number;
    total: number;
  };
  remaining: {
    sonnet45: number;
    gemini: number;
    gpt5: number;
    total: number;
  };
}

方法

CursorLimitsMonitor

  • getUsageStats():获取全面的使用统计数据
  • getServiceUsage(service):获取特定服务的使用情况
  • checkAlerts():检查服务是否接近极限
  • updateLimits(limits):更新使用统计信息
  • onUpdate(callback):订阅使用情况更新

贡献

  1. 复刻仓库
  2. 创建要素分支: git checkout -b feature/amazing-feature
  3. 进行更改
  4. 运行测试和梳理: npm run lint && npm run format:check
  5. 提交您的更改: git commit -m 'Add amazing feature'
  6. 推到分支: git push origin feature/amazing-feature
  7. 打开拉取请求

许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

支持

对于问题和疑问:

  • 在GitHub上打开一个问题
  • 检查文档
  • 查看用于API参考的TypeScript类型