Integrate LessToken's compression capabilities directly into Claude Desktop conversations. Use the compress_text tool to optimize prompts and reduce token usage.
Claude Desktop is Anthropic's official desktop application for interacting with Claude AI. By configuring Claude Desktop to use our MCP server, you can access compression tools directly in your conversations with Claude.
This integration allows you to compress long prompts before sending them to Claude, reducing token usage and costs while maintaining semantic meaning.
Claude Desktop stores its configuration in a JSON file. The location depends on your operating system:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonOpen the configuration file in a text editor and add the MCP server configuration. If the file doesn't exist, create it with the following structure:
{
"mcpServers": {
"less-token-compression": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-http",
"https://lesstokens.hive-hub.ai/api/mcp"
],
"env": {
"X_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}YOUR_API_KEY_HERE with your actual LessToken API key. Keep this file secure and never commit it to version control.After saving the configuration file, restart Claude Desktop completely. The MCP server will be automatically connected when Claude Desktop starts.
In Claude Desktop, you should now see the compress_text tool available. You can verify this by asking Claude about available tools or by trying to use compression.
You can ask Claude to compress a prompt before using it:
You: Can you compress this prompt for me using the compress_text tool?
"The quick brown fox jumps over the lazy dog. This is a test sentence
with some redundancy and unnecessary verbosity that we want to optimize."
Claude: I'll compress that prompt for you using the compress_text tool.
[Claude uses compress_text tool]
The compressed version is: "Quick brown fox jumps lazy dog. Test sentence."
Original tokens: 28, Compressed tokens: 12, Tokens saved: 16 (57% reduction)Claude can automatically compress prompts when they're too long:
You: I have a very long prompt that I want to send to another AI model.
Can you help me compress it first?
Claude: I'll compress your prompt using the compress_text tool to reduce
token usage while preserving the key information.
[Claude uses compress_text tool]
Here's the compressed version optimized for token efficiency...less-token-compressionX_API_KEY environment variable is set correctly