TokenLens
БесплатноНе проверенAnalyze AI conversations to estimate token costs, detect waste, and generate optimized prompts directly from your editor.
Описание
Analyze AI conversations to estimate token costs, detect waste, and generate optimized prompts directly from your editor.
README
Token intelligence layer for AI editors — analyze conversations, estimate costs, detect waste, and generate optimized prompts.
Quick Start
npm install
cp .env.example .env # fill in your values
npm run build
npm start # HTTP server on port 3000
npm run stdio # stdio transport for Claude Desktop
MCP Tools
| Tool | Description |
|---|---|
analyze_conversation |
Token count, cost estimate, waste detection |
improve_prompt |
Rewrite vague prompts into precise ones (local, no API) |
smart_compress |
Compress context by importance score |
estimate_cost |
Pre-flight cost estimate across all models |
get_budget_status |
Daily token budget and alert level |
weekly_summary |
Weekly usage vs last week |
export_report |
Markdown report saved to ~/.tokenlens/reports/ |
REST Endpoints (Chrome Extension)
POST /analyze-direct Analyze a conversation (no auth)
POST /improve-prompt Local prompt improvement (no auth)
POST /improve-prompt-ai AI-powered prompt improvement (user API key)
POST /generate-prompt AI prompt generation (user API key)
GET /dashboard Web UI
GET /health Health check
Configuration
Copy .env.example to .env and set:
PORT=3000
ADMIN_SECRET=<strong-random-secret>
AI provider keys are not required on the server — the Chrome Extension passes the user's own key per-request. Server-side keys are only needed if you add server-managed AI features.
Security
Your API keys are never stored on our servers. All keys are stored locally on your device only.
- The Chrome Extension saves API keys to browser
localStorage— they never leave your machine - The
/generate-promptand/improve-prompt-aiendpoints receive your key only for the duration of the API call and do not log or persist it - The MCP server stores session analytics in a local SQLite database (
~/.tokenlens/sessions.db) — no data is sent to external services - Set a strong
ADMIN_SECRETin your.envbefore exposing the server to any network
Hosted Server
The production server is available at:
https://tokenlens-mcp-production.up.railway.app
| Endpoint | URL |
|---|---|
| Health | https://tokenlens-mcp-production.up.railway.app/health |
| SSE (MCP) | https://tokenlens-mcp-production.up.railway.app/sse |
| Dashboard | https://tokenlens-mcp-production.up.railway.app/dashboard |
| Chrome Extension default server URL | https://tokenlens-mcp-production.up.railway.app |
Claude Desktop Setup
Option A — Hosted (recommended): connect via SSE to the production server.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"tokenlens": {
"url": "https://tokenlens-mcp-production.up.railway.app/sse",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}
Option B — Local stdio: run the server on your own machine.
{
"mcpServers": {
"tokenlens": {
"command": "node",
"args": ["/path/to/TokenLens MCP/dist/stdio.js"]
}
}
}
Установка TokenLens
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/im43ii/tokenlens-mcpFAQ
TokenLens MCP бесплатный?
Да, TokenLens MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для TokenLens?
Нет, TokenLens работает без API-ключей и переменных окружения.
TokenLens — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить TokenLens в Claude Desktop, Claude Code или Cursor?
Открой TokenLens на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare TokenLens with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
