MoonBit documentation and source code search powered by Gemini's Interactions API and MCP (Model Context Protocol).
This is a TypeScript command-line tool that implements an MCP Server. It reads text files from the store/ directory (documentation) and source/ directory (MoonBit core repository), uses Gemini's Interactions API to provide AI-powered search and question answering.
- 🚀 MCP Server implementation for integration with Claude Desktop and other MCP clients
- 📚 Automatic document ingestion from
store/directory - 💻 Source code analysis from
source/directory (MoonBit core repository) - 🔍 AI-powered semantic search using Gemini's Interactions API
- 💬 Dual query modes: documentation and source code
- 📝 Support for text, markdown, JSON, and MoonBit source files
- Node.js 18.0.0 or higher
- A Google AI (Gemini) API key
- MoonBit core repository (optional, for source code queries)
- Clone the repository:
git clone <repository-url>
cd moonverse.ts- Install dependencies:
yarn install- Build the project:
yarn buildSet your Gemini API key as an environment variable:
export GEMINI_API_KEY='your-api-key-here'You can get a Gemini API key from Google AI Studio.
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"moonverse": {
"command": "node",
"args": ["/path/to/moonverse.ts/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}# Development mode with tsx
yarn dev
# Production mode
yarn startPlace your documentation files in the store/ directory. Supported file types:
.txt- Plain text files.md- Markdown files
The project includes sample MoonBit documentation:
llms.txt- General MoonBit language informationAgents.mbt.md- MoonBit agent documentationide.md- IDE integration information
Place the MoonBit core repository in the source/ directory for source code queries. Supported file types:
.mbt- MoonBit source files.md- Markdown documentation.json- JSON configuration files.txt- Plain text files
This enables querying about:
- Latest API features
- Implementation details
- Pre-release functionality
- Internal code structure
The server provides the following tools:
Query the MoonBit documentation using AI-powered semantic search.
Parameters:
query(string): The question to ask about the MoonBit documentation
Example:
Use the query_moonbit_docs tool to ask: "What are the key features of MoonBit?"
Query the MoonBit core source code repository to understand latest API features and implementations.
Parameters:
query(string): The question to ask about MoonBit source code or latest features
Example:
Use the query_moonbit_source tool to ask: "How is the type inference system implemented?"
This project uses:
# Build the project
yarn build
# Run in development mode
yarn devISC
Contributions are welcome! Please feel free to submit a Pull Request.