LODA API MCP Server
A Model Context Protocol (MCP) server for the LODA Language API, providing seamless access to the LODA language and integer sequences from the On-Line Encyclopedia of Integer Sequences® (OEIS®).
🌟 Overview
LODA (Lexicographic Ordering of Divide-and-conquer Algorithms) is an assembly language and computational model for mining programs that compute integer sequences. This MCP server enables you to:
- 🔍 Explore OEIS sequences with rich metadata and formatting
- 🔧 Discover LODA programs that compute specific sequences
- ⚡ Execute programs in real-time and compute sequence terms
- ⛏️ Mine new programs using LODA's distributed mining system
- 📊 Monitor operations and access project statistics
✨ Features
Core Capabilities
- Complete OEIS Integration: Access any sequence with proper A-number formatting
- Program Discovery: Find existing LODA programs for sequences
- Real-time Execution: Run LODA programs and see results instantly
- Mining Operations: Start and monitor program discovery for sequences
- Rich Formatting: Beautiful, emoji-enhanced output with clear structure
- Robust Error Handling: Comprehensive validation and error messages
- Production Ready: Full TypeScript implementation with proper types
Available Tools
Tool | Description | Primary Use Case |
---|---|---|
get_oeis_sequence | Get detailed OEIS sequence information | Research mathematical sequences |
get_program | Retrieve specific LODA program by ID | Analyze program implementations |
get_programs_for_sequence | Find all programs for a sequence | Compare different algorithmic approaches |
run_program | Execute LODA programs | Test and validate program correctness |
start_mining | Begin mining new programs | Discover new implementations |
get_mining_status | Check mining operation progress | Monitor long-running discoveries |
get_stats | View LODA project statistics | Understand project scope and growth |
🚀 Quick Start
Prerequisites
- Node.js 18.0.0 or higher
- npm 8.0.0 or higher
Installation
- Create and set up project:
- Install dependencies:
- Build the server:
- Test the installation:
Development Workflow
⚙️ Configuration
Claude Desktop Integration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Environment Variables
Variable | Description | Default |
---|---|---|
LODA_API_BASE_URL | LODA API endpoint override | https://api.loda-lang.org/v2 |
📖 Usage Examples
🔢 Exploring OEIS Sequences
🔧 Working with LODA Programs
⚡ Running Programs
⛏️ Mining New Programs
📊 Project Statistics
🔧 API Reference
Tool Schemas
All tools use strict JSON schemas with proper validation:
get_oeis_sequence
run_program
start_mining
Response Format
All responses include:
- Rich formatting with emojis and visual structure
- Clear status indicators (✅ success, ⏱️ timeout, ❌ error)
- Contextual information and helpful tips
- Proper error messages with actionable guidance
🏗️ Architecture
Core Components
Error Handling Strategy
- Input Validation: Strict parameter checking with clear error messages
- Network Resilience: Retry logic and connection error handling
- API Error Translation: Convert HTTP errors to meaningful user messages
- Graceful Degradation: Partial results when possible
🔍 Troubleshooting
Common Issues
Issue | Solution |
---|---|
Server won't start | Check Node.js version (18+), verify build completed |
API connection failed | Test with npm run test-connection , check firewall |
Tool not found | Verify tool name spelling, check MCP client connection |
Invalid parameters | Check parameter types match schema exactly |
Mining timeout | Use shorter max_runtime, check sequence exists |
Debug Mode
Health Checks
🤝 Contributing
Development Setup
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make changes with proper TypeScript types
- Test thoroughly:
npm run type-check
- Submit a pull request
Code Standards
- TypeScript: Strict mode with full type coverage
- Error Handling: Always use McpError for user-facing errors
- Validation: Validate all inputs before API calls
- Documentation: Clear JSDoc comments for public methods
- Formatting: Consistent emoji usage and output structure
🔗 Resources
- LODA Language Website - Official LODA project
- OEIS Website - The On-Line Encyclopedia of Integer Sequences
- MCP Specification - Model Context Protocol docs
- LODA API Documentation - OpenAPI specification
📄 API Endpoints
Based on the official OpenAPI specification:
Endpoint | Method | Description |
---|---|---|
/oeis/{oeis_id} | GET | Get OEIS sequence information |
/programs/{program_id} | GET | Get LODA program details |
/oeis/{oeis_id}/programs | GET | Get programs for sequence |
/programs/run | POST | Execute LODA program |
/mine | POST | Start mining operation |
/mine/{mine_id} | GET | Get mining status |
/stats | GET | Get project statistics |
📝 License
Apache 2.0
🙏 Acknowledgments
- LODA Project Team - For creating this amazing mathematical tool
- OEIS Contributors - For maintaining the world's most important sequence database
- MCP Community - For the excellent protocol and SDK
- Mathematical Community - For continuous sequence discoveries and research
Made with ❤️ for mathematical discovery and algorithmic research
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables exploration and computation of mathematical integer sequences from OEIS using the LODA assembly language. Supports sequence discovery, program execution, algorithmic mining, and real-time computation of mathematical sequences.