TokenLens MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TokenLens MCPanalyze my recent conversation token costs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TokenLens MCP
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 DesktopRelated MCP server: Ambiance MCP Server
MCP Tools
Tool | Description |
| Token count, cost estimate, waste detection |
| Rewrite vague prompts into precise ones (local, no API) |
| Compress context by importance score |
| Pre-flight cost estimate across all models |
| Daily token budget and alert level |
| Weekly usage vs last week |
| Markdown report saved to |
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 checkConfiguration
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 machineThe
/generate-promptand/improve-prompt-aiendpoints receive your key only for the duration of the API call and do not log or persist itThe MCP server stores session analytics in a local SQLite database (
~/.tokenlens/sessions.db) — no data is sent to external servicesSet 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.appEndpoint | URL |
Health |
|
SSE (MCP) |
|
Dashboard |
|
Chrome Extension default server URL |
|
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"]
}
}
}This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/im43ii/tokenlens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server