Gemini Daily MCP Server (Compressed)

Gemini Daily MCP Server (Compressed)

Token-optimized MCP server that integrates Google Gemini CLI for AI-powered coding assistance with 43.8% token savings through progressive disclosure, supporting multi-turn conversations and multiple Gemini models.

Category
访问服务器

README

Gemini Daily MCP Server (Compressed) ⚡

npm version license

Token-optimized MCP server for Google Gemini CLI with 43.8% token savings through Progressive Disclosure strategy.

🎯 Why Compressed Version?

This is an experimental token-optimized variant of gemini-daily-mcp that reduces tool schema overhead by 43.8% while maintaining full functionality.

Token Savings Comparison

Version Schema Size Tokens Savings
Original 1,227 bytes 306 tokens -
Compressed ⚡ 691 bytes 172 tokens 43.8%

Impact:

  • Per conversation: Save 134 tokens
  • 3,000 conversations/month: Save ~$1.61/month
  • Scale to 50 tools: Save ~$66/month (61%)

💡 How It Works: Progressive Disclosure

Traditional Approach (Verbose Schema)

{
  "name": "gemini",
  "description": "Execute Gemini CLI in non-interactive mode for AI assistance with high Token efficiency",
  "inputSchema": {
    "properties": {
      "prompt": {
        "type": "string",
        "description": "The coding task, question, or analysis request"
      },
      "sessionId": {
        "type": "string",
        "description": "Optional session ID for conversational context (saves up to 74% tokens in multi-turn conversations)"
      }
    }
  }
}

Size: 731 bytes ≈ 182 tokens

Progressive Disclosure (Compressed Schema)

{
  "name": "gemini",
  "description": "Execute Gemini CLI. Use help for details",
  "inputSchema": {
    "properties": {
      "prompt": {"type": "string"},
      "sessionId": {"type": "string"}
    }
  }
}

Size: 281 bytes ≈ 70 tokens (61.6% savings)

Where Did the Details Go?

They're in the enhanced help tool! When Claude needs details:

# Claude calls: mcp__gemini-daily-compressed__help
# Returns comprehensive documentation:

# Gemini Daily MCP - Detailed Documentation

## gemini Tool

Execute Gemini CLI in non-interactive mode for AI assistance.

**Parameters:**
- prompt (required, string): The coding task, question, or analysis request
- sessionId (optional, string): Session ID for conversational context
  - Saves up to 74% tokens in multi-turn conversations
  - Obtained from previous gemini call's _meta.sessionId
- resetSession (optional, boolean): Reset session history before processing
- model (optional, string): Specify which Gemini model to use
  - Default: gemini-2.5-flash
  - Options: gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-pro-preview

**Example:**
{
  "prompt": "Write a Python function to calculate fibonacci",
  "sessionId": "session-abc123",
  "model": "gemini-2.5-flash"
}
...

Result:

  • ✅ 90% of conversations: Don't need details → Save tokens
  • ✅ 10% of conversations: Call help once → Get full docs
  • ✅ Overall: 43.8% token savings

🚀 Features

Same Functionality as Original

  • ✅ Full Gemini CLI integration
  • ✅ Session management (saves up to 74% tokens in multi-turn conversations)
  • ✅ Gemini 3 support (gemini-3-pro-preview with fallback)
  • ✅ Multi-model selection (Flash, Flash-Lite, Pro, Gemini 3)
  • ✅ Comprehensive error handling

Token Optimization

  • ⚡ 43.8% smaller tool schemas
  • ⚡ Progressive Disclosure via enhanced help tool
  • ⚡ Preserves all type information
  • ⚡ Maintains parameter validation

📦 Installation

Prerequisites

  • Google Gemini CLI must be pre-installed and configured
    • Install: Follow Google's official Gemini CLI installation guide
    • Setup: Run gemini auth login with your Google account
    • API Key: Set GOOGLE_API_KEY environment variable or configure via gemini config
  • Claude Code or Claude Desktop installed

Claude Code

# Clone this repository
git clone https://github.com/kdoooh000h/gemini-daily-mcp-compressed.git
cd gemini-daily-mcp-compressed

# Install dependencies
npm install

# Build
npm run build

# Add to Claude Code
# Edit your .mcp.json:
{
  "mcpServers": {
    "gemini-daily-compressed": {
      "command": "node",
      "args": ["/path/to/gemini-daily-mcp-compressed/dist/index.js"],
      "env": {
        "GEMINI_ENABLED": "true",
        "SESSION_TTL_HOURS": "24",
        "MAX_SESSIONS": "100",
        "GEMINI_CLI_COMMAND": "gemini",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Claude Desktop

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "gemini-daily-compressed": {
      "command": "node",
      "args": ["/path/to/gemini-daily-mcp-compressed/dist/index.js"],
      "env": {
        "GEMINI_ENABLED": "true",
        "SESSION_TTL_HOURS": "24",
        "GEMINI_CLI_COMMAND": "gemini"
      }
    }
  }
}

🔧 Tools

gemini - AI Coding Assistant

Execute Gemini CLI with optional session support.

Basic Usage:

Use gemini to explain this Python function

Advanced Usage:

# With session for multi-turn conversation
Use gemini with sessionId "my-session" to analyze this code

# Continue conversation
Use gemini with sessionId "my-session" to implement the improvements

# Specify model
Use gemini with model "gemini-3-pro-preview" for complex analysis

# Reset session
Use gemini with sessionId "my-session" and resetSession true to start fresh

listSessions - Session Management

List all active conversation sessions.

ping - Connection Test

Test if the MCP server is working properly.

help - Enhanced Documentation

Get detailed documentation for all tools (this is where the detailed info lives in the compressed version).

📊 Compression Details

Strategy

  1. Remove verbose descriptions from tool schemas
  2. Preserve all functionality:
    • Parameter names
    • Type information
    • Required fields
    • Enum values
  3. Enhance help tool to provide complete documentation

Token Breakdown

Tool Original Compressed Savings
gemini 182 tokens 70 tokens 61.6%
ping 49 tokens 37 tokens 24.5%
help 33 tokens 32 tokens 3.0%
listSessions 40 tokens 33 tokens 17.5%
Total 306 tokens 172 tokens 43.8%

Trade-offs

Pros ✅:

  • Significant token savings (43.8%)
  • Lower costs ($66/month for 3K conversations with 50 tools)
  • Full functionality preserved
  • Claude understands compressed schemas

Cons ⚠️:

  • ~10% of conversations may need an extra help call
  • Schema less readable for developers
  • Need to maintain documentation in two places (schema + help tool)

📈 When to Use Compressed Version?

Recommended For ✅

  • High-frequency usage (>100 conversations/day)
  • Many tools (>20 tools in your MCP setup)
  • Cost-sensitive projects
  • Complex tool schemas with verbose descriptions

Use Original Version Instead

  • Low-frequency usage (<100 conversations/day)
  • Few tools (<10 tools)
  • Need maximum schema readability
  • Occasional use

🧪 Experimental Status

This is an experimental project to validate the Progressive Disclosure approach for MCP tool schemas.

Testing Results (from lab-02-testbed):

  • ✅ All tools function normally
  • ✅ help tool provides complete documentation
  • ✅ Claude understands compressed schemas
  • ✅ 43.8% token savings confirmed
  • ⚠️ ~10% scenarios require help call (adds 1 tool invocation)

Feedback Welcome: Please open issues if you encounter any problems or have suggestions.

🔗 Related Projects

📚 Documentation

  • MODELS.md: Gemini model compatibility and selection guide
  • CODEX-TO-GEMINI-ADAPTATION.md: How this was adapted from codex-mcp-server
  • API Reference: Use the help tool within Claude for detailed documentation

🛠️ Development

# Install dependencies
npm install

# Development mode
npm run dev

# Build
npm run build

# Test
npm test

# Lint
npm run lint

📝 Version Compatibility

This MCP server is compatible with:

  • Gemini CLI: v0.17.0+ (with Gemini 3 support)
  • Claude Code: Latest version
  • Claude Desktop: Latest version
  • MCP SDK: @modelcontextprotocol/sdk ^1.17.3

🤝 Contributing

This is an experimental project. Contributions, issues, and feature requests are welcome!

📄 License

ISC

💬 Questions?

  • Use the help tool: mcp__gemini-daily-compressed__help
  • Open an issue: GitHub Issues
  • Original project: gemini-daily-mcp

⚡ Compressed. Efficient. Same Power.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选