get_usage_stats
Check current Cursor Pro usage statistics and limits for AI services including Sonnet 4.5, Gemini, and GPT-5 to monitor API quotas and subscription limits.
Instructions
Get current Cursor Pro usage statistics and limits
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:178-210 (handler)MCP tool handler for 'get_usage_stats'. Retrieves UsageStats from the monitor and formats it into a detailed Markdown response with current usage, percentages, remaining requests, and subscription tier.private async handleGetUsageStats() { const stats = this.monitor.getUsageStats(); const content = ` # Cursor Pro Usage Statistics ## Subscription Tier: ${stats.quotas.tier.toUpperCase()} ## Current Usage (Monthly) - **Sonnet 4.5**: ${stats.limits.sonnet45Requests}/${stats.quotas.maxSonnet45Requests} (${stats.usagePercentages.sonnet45.toFixed(1)}%) - **Gemini**: ${stats.limits.geminiRequests}/${stats.quotas.maxGeminiRequests} (${stats.usagePercentages.gemini.toFixed(1)}%) - **GPT-5**: ${stats.limits.gpt5Requests}/${stats.quotas.maxGpt5Requests} (${stats.usagePercentages.gpt5.toFixed(1)}%) - **Total**: ${stats.limits.totalRequests}/${stats.quotas.maxTotalRequests} (${stats.usagePercentages.total.toFixed(1)}%) ## Remaining Requests (This Month) - **Sonnet 4.5**: ${stats.remaining.sonnet45} - **Gemini**: ${stats.remaining.gemini} - **GPT-5**: ${stats.remaining.gpt5} - **Total**: ${stats.remaining.total} ## Last Updated ${stats.limits.lastUpdated.toISOString()} `.trim(); return { content: [ { type: 'text', text: content, }, ], }; }
- src/cursorLimitsMonitor.ts:102-144 (helper)Core helper method in CursorLimitsMonitor that computes detailed UsageStats object, including usage percentages and remaining requests for each service.public getUsageStats(): UsageStats { const usagePercentages = { sonnet45: this.calculatePercentage( this.limits.sonnet45Requests, this.quotas.maxSonnet45Requests ), gemini: this.calculatePercentage( this.limits.geminiRequests, this.quotas.maxGeminiRequests ), gpt5: this.calculatePercentage( this.limits.gpt5Requests, this.quotas.maxGpt5Requests ), total: this.calculatePercentage( this.limits.totalRequests, this.quotas.maxTotalRequests ), }; const remaining = { sonnet45: Math.max( 0, this.quotas.maxSonnet45Requests - this.limits.sonnet45Requests ), gemini: Math.max( 0, this.quotas.maxGeminiRequests - this.limits.geminiRequests ), gpt5: Math.max(0, this.quotas.maxGpt5Requests - this.limits.gpt5Requests), total: Math.max( 0, this.quotas.maxTotalRequests - this.limits.totalRequests ), }; return { limits: { ...this.limits }, quotas: { ...this.quotas }, usagePercentages, remaining, }; }
- src/index.ts:40-47 (registration)Registration of the 'get_usage_stats' tool in the ListToolsRequestSchema handler, including name, description, and empty input schema (no parameters required).{ name: 'get_usage_stats', description: 'Get current Cursor Pro usage statistics and limits', inputSchema: { type: 'object', properties: {}, }, },
- src/types.ts:33-50 (schema)Type definition (schema) for UsageStats, the core data structure returned by getUsageStats(), defining limits, quotas, usage percentages, and remaining requests.export interface UsageStats { limits: CursorProLimits; quotas: CursorProQuotas; /** Usage percentage for each service */ usagePercentages: { sonnet45: number; gemini: number; gpt5: number; total: number; }; /** Remaining requests for each service */ remaining: { sonnet45: number; gemini: number; gpt5: number; total: number; }; }
- src/index.ts:130-131 (registration)Tool dispatch/registration in the CallToolRequestSchema switch statement, routing 'get_usage_stats' calls to the handler.case 'get_usage_stats': return await this.handleGetUsageStats();