Skip to content

Latest commit

 

History

History
120 lines (88 loc) · 2.96 KB

File metadata and controls

120 lines (88 loc) · 2.96 KB

Usage Guide

Quick Start

  1. Set up your API key:
export GEMINI_API_KEY='your-api-key-here'
  1. Build the project:
yarn install
yarn build
  1. Configure Claude Desktop:

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your OS:

{
  "mcpServers": {
    "moonverse": {
      "command": "node",
      "args": ["/absolute/path/to/moonverse.ts/dist/index.js"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}
  1. Restart Claude Desktop

Using the Tool

Once configured, you can use both tools in Claude Desktop:

Documentation Queries

Basic questions:

Use query_moonbit_docs to ask: "What is MoonBit?"

Technical questions:

Use query_moonbit_docs to ask: "How do I use the moon ide command for code navigation?"

Feature inquiries:

Use query_moonbit_docs to ask: "What are the key features of MoonBit's type system?"

Source Code Queries

API questions:

Use query_moonbit_source to ask: "What are the latest API additions in the core library?"

Implementation questions:

Use query_moonbit_source to ask: "How is pattern matching implemented?"

Pre-release features:

Use query_moonbit_source to ask: "What new features are in development?"

Adding More Documents

To add more documentation to the search:

  1. Place .txt or .md files in the store/ directory for documentation
  2. Place MoonBit source files (.mbt, .md, .json) in the source/ directory for source code queries
  3. Restart the MCP server (restart Claude Desktop)
  4. The new files will be automatically uploaded and included in searches

Supported File Types

Documentation (store/ directory):

  • .txt - Plain text files
  • .md - Markdown files

Source Code (source/ directory):

  • .mbt - MoonBit source files
  • .md - Markdown documentation
  • .json - JSON configuration
  • .txt - Plain text files

How It Works

  1. On startup, the server prepares to read from both store/ (documentation) and source/ (code) directories
  2. When you query docs, files from store/ are uploaded to Gemini's Interactions API
  3. When you query source, files from source/ are uploaded to Gemini's Interactions API
  4. Files are uploaded lazily on first query and cached in memory
  5. The AI provides context-aware answers based on the uploaded files

Troubleshooting

"GEMINI_API_KEY environment variable is not set"

Make sure you've set the GEMINI_API_KEY in your environment or in the Claude Desktop config.

"No text or markdown files found in store directory"

Ensure you have .txt or .md files in the store/ directory.

Files not updating

Restart Claude Desktop to reload the MCP server and re-upload files.

API Rate Limits

Be aware of Gemini API rate limits. The free tier has:

  • 60 requests per minute
  • 1,500 requests per day

For production use, consider the paid tier for higher limits.