Uses OpenAI's text-embedding-3-small model to generate embeddings for semantic search and document processing of MAGMA handbook content.
Uses Supabase's pgvector extension as the vector database backend for storing and performing lightning-fast semantic similarity search across indexed MAGMA handbook documentation chunks.
π§ββοΈ MCP MAGMA Handbook Server
An intelligent MCP (Model Context Protocol) server that provides AI assistants with comprehensive access to the MAGMA computational algebra system handbook through advanced vector search and semantic understanding.
β¨ Features
π Semantic Search: Natural language queries across the entire MAGMA handbook
π Smart Examples: Retrieve code examples categorized by complexity and topic
π§ Code Explanation: Get detailed, contextual explanations of MAGMA code
π·οΈ Category Filtering: Search within specific categories (syntax, functions, algorithms, examples, theory)
β‘ Vector Database: Powered by Supabase pgvector for lightning-fast similarity search
π― MAGMA-Optimized: Specialized parsing and understanding of MAGMA syntax and concepts
π― Perfect For
π¬ Researchers working with computational algebra
π¨βπ Students learning MAGMA and algebraic computation
π» Developers building mathematical software
π Anyone needing quick access to MAGMA documentation
π Quick Start
Installation
Prerequisites
Node.js 18+
OpenAI API key (for embeddings)
Supabase account (free tier works great!)
MAGMA Handbook PDF
Setup
Place your MAGMA handbook PDF in the
data/pdfs/directory:mkdir -p data/pdfs cp /path/to/MAGMA_HANDBOOK.pdf data/pdfs/Index the handbook:
npm run indexConfigure your MCP client (e.g., Claude Desktop):
{ "mcpServers": { "magma-handbook": { "command": "npx", "args": ["mcp-magma-handbook"], "env": { "OPENAI_API_KEY": "your-api-key-here" } } } }
Usage
Once configured, the AI assistant can use these tools:
search_magma
Search for specific topics in the MAGMA handbook:
get_magma_example
Get code examples for mathematical topics:
explain_magma_code
Get explanations for MAGMA code:
π¬ Example Conversations
Once configured, you can ask Claude questions like:
Basic Syntax:
"How do I define a finite field in MAGMA?"
Code Examples:
"Show me examples of computing with elliptic curves over finite fields"
Code Explanation:
"Explain this MAGMA code:
G := PerfectClosure(GF(8)); H := AutomorphismGroup(G);"
Advanced Topics:
"Find algorithms for computing Galois groups of polynomials"
Research Help:
"What are the available functions for working with algebraic curves in MAGMA?"
Environment Variables
OPENAI_API_KEY: Required for embedding generation (uses text-embedding-3-small)CHROMA_SERVER_HOST: Optional, for remote ChromaDB instanceCHROMA_SERVER_PORT: Optional, for remote ChromaDB instance
Development
π οΈ Technical Details
Architecture
Backend: Node.js with TypeScript
Vector DB: Supabase with pgvector extension
Embeddings: OpenAI text-embedding-3-small
Document Processing: LangChain with optimized chunking
Protocol: MCP (Model Context Protocol) 1.0
Performance
8,730+ indexed document chunks
~175 batches for efficient processing
Sub-second search responses
Semantic similarity scoring
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
π License
MIT License - see LICENSE file for details.
π Acknowledgments
MAGMA Team for the comprehensive computational algebra system
Anthropic for the Model Context Protocol
Supabase for the excellent vector database platform
OpenAI for powerful embedding models
Made with β€οΈ for the computational algebra community
This server cannot be installed