LessTokens Logo
Mcp Server
Cursor Ide

Documentation

Getting Started

  • Overview
  • Account Setup
  • First API Key
  • First Request
  • Understanding Metrics

API Reference

  • Overview
  • Authentication
  • Compressionnew
  • MCP Servernew
  • Errors

Integrations

  • Node.js / TypeScript
  • Python
  • cURL

Resources

  • Best Practices

Need help?

Join our community or contact support for assistance.

Contact Support →

Cursor IDE Integration

Integrate LessToken's compression capabilities into your Cursor IDE workflow. Use compression tools while coding to optimize prompts and reduce token usage.

Overview

Cursor IDE is an AI-powered code editor that integrates with various AI models and tools. By configuring Cursor to use our MCP server, you can access compression tools directly in your development workflow.

This integration allows you to compress code prompts, documentation, and other text before sending them to AI models, reducing token usage and improving efficiency.

Prerequisites

  • Cursor IDE installed on your system
  • A LessToken API key (get one here)
  • Access to Cursor settings and configuration

Configuration Steps

1

Open Cursor Settings

Open Cursor IDE and navigate to Settings. You can access settings via:

  • macOS: Cursor → Settings (or Cmd + ,)
  • Windows/Linux: File → Preferences → Settings (or Ctrl + ,)
2

Configure MCP Server

In Cursor settings, navigate to the MCP (Model Context Protocol) section and add a new MCP server configuration:

Cursor MCP Configuration
{
  "mcpServers": {
    "less-token-compression": {
      "url": "https://lesstokens.hive-hub.ai/api/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY_HERE"
      }
    }
  }
}
Important: Replace YOUR_API_KEY_HERE with your actual LessToken API key. Keep this configuration secure.
3

Restart Cursor

After saving the configuration, restart Cursor IDE completely. The MCP server will be connected when Cursor starts.

4

Verify Integration

In Cursor, you should now see the compress_text tool available in the AI assistant. You can verify this by checking available tools or using compression in your conversations.

Usage Examples

Example 1: Compress Code Comments

Compress verbose code comments before sending to AI:

Cursor Chat
You: Can you compress these code comments using compress_text?
// This is a very long comment that explains what this function does
// It has multiple lines and contains redundant information
// We want to optimize it for token efficiency

AI: I'll compress those comments for you.

[AI uses compress_text tool]

Compressed: "Function explanation comment - optimized"

Example 2: Optimize Documentation

Compress documentation before including it in prompts:

Cursor Chat
You: I need to send this documentation to an AI model, but it's too long.
Can you compress it first?

AI: I'll compress the documentation using compress_text to reduce token usage.

[AI uses compress_text tool]

Here's the optimized version...

Troubleshooting

MCP Server Not Connecting

  • Verify your API key is correct in the configuration
  • Ensure Cursor has been restarted after configuration changes
  • Check Cursor's developer console for connection errors
  • Verify the MCP server URL is accessible from your network

Tool Not Available

  • Confirm the configuration syntax is correct (valid JSON)
  • Check that the MCP server name matches: less-token-compression
  • Try removing and re-adding the MCP server configuration
  • Check Cursor's MCP server status in settings

Additional Resources

MCP Server Docs

Return to the main MCP server documentation.

Cursor Docs

Official Cursor IDE documentation.