memberstack-ai-context
v1.0.4
Published
AI context server for Memberstack DOM documentation - provides intelligent access to Memberstack docs for Claude Code, Cursor, and other AI coding assistants
Maintainers
Readme
Memberstack AI Context
AI context server for Memberstack DOM documentation. Provides intelligent, selective access to Memberstack documentation for AI coding assistants like Claude Code and Cursor.
🚀 Quick Install
For Claude Code
# Install using Claude's MCP command
claude mcp add memberstack-docs -- npx -y memberstack-ai-contextFor Cursor
# Clone and setup manually
git clone https://github.com/julianmemberstack/memberstack-ai-context.git
cd memberstack-ai-context
npm install && npm run build
node scripts/setup-cursor.jsAlternative: NPM Global Install
# Install globally and run setup
npm install -g memberstack-ai-context
memberstack-ai-context setup✨ Features
- 🎯 Smart Access: 90% token reduction (63K → ~5K tokens per query)
- 🔍 Intelligent Search: Fuzzy search across all documentation
- 📚 Structured Data: Method signatures, parameters, examples
- ⚡ High Performance: In-memory indexing, no file I/O during queries
- 🛠️ Easy Setup: Automated configuration for Claude Code & Cursor
- ✅ Accurate: 95% verified against actual Memberstack DOM source code
📖 What's Included
Documentation (11 files, ~63K tokens)
- Setup & Config: Initialization, configuration options
- Authentication: Login, signup, social auth, passwordless
- Member Management: Profile updates, custom fields, member data
- Subscriptions: Plan management, billing, Stripe integration
- UI Components: Pre-built modals, forms, styling
- Advanced Features: Comments, teams, secure content
- Reference: Types, error handling, complete examples
MCP Server
- TypeScript-based MCP server with intelligent indexing
- Real-time search across all documentation
- Method-specific information extraction
- Code example extraction and categorization
🛠️ Available Tools
Once installed, your AI assistant will have access to:
| Tool | Description | Example Usage |
|------|-------------|---------------|
| search_memberstack_docs | Search documentation | search_memberstack_docs query="login authentication" |
| get_method_info | Get method details | get_method_info method_name="loginMemberEmailPassword" |
| list_methods_by_category | Browse by category | list_methods_by_category category="auth" |
| get_section_summary | Section summaries | get_section_summary section_id="02-authentication" |
| get_code_examples | Code examples | get_code_examples topic="social login" |
🎯 Usage Examples
With Claude Code
// After installing with: mcp install memberstack-ai-context
// Ask Claude Code to help with Memberstack integration:
"Help me implement social login with Google using Memberstack"
// Claude will automatically use the MCP server to:
// 1. Search for social login documentation
// 2. Get method signatures for loginWithProvider
// 3. Find relevant code examples
// 4. Provide accurate, up-to-date implementationWith Cursor
// Cursor can access documentation via MCP protocol
// Use natural language to get specific help:
"Show me how to update member custom fields"
"What parameters does getCurrentMember accept?"
"Give me an example of plan purchase flow"⚙️ Configuration
Supported Editors
- ✅ Claude Code (Full support)
- ✅ Cursor (MCP support)
- 🔄 Other MCP-compatible editors (Should work)
Manual Configuration
Add to your MCP configuration file:
{
"memberstack-docs": {
"command": "/path/to/memberstack-ai-context/memberstack-docs-mcp/dist/index.js",
"args": ["/path/to/memberstack-ai-context/memberstack-docs-md"]
}
}Config locations:
- Claude Code:
~/Library/Application Support/Claude/mcp_servers.json - Cursor:
~/Library/Application Support/Cursor/User/globalStorage/mcp_servers.json
🏗️ Development
Project Structure
memberstack-ai-context/
├── memberstack-docs-md/ # Documentation source (11 .md files)
├── memberstack-docs-mcp/ # MCP server implementation
│ ├── src/ # TypeScript source
│ ├── dist/ # Compiled JavaScript
│ └── package.json
├── scripts/ # Installation & setup scripts
├── .github/workflows/ # CI/CD automation
└── install.sh # One-line installerLocal Development
git clone https://github.com/julianmemberstack/memberstack-ai-context.git
cd memberstack-ai-context
# Install and build
npm install
npm run build
# Test the server
npm test
# Setup for development
npm run setupAvailable Scripts
memberstack-ai-context setup # Interactive setup
memberstack-ai-context setup:claude # Setup Claude Code only
memberstack-ai-context setup:cursor # Setup Cursor only
memberstack-ai-context start # Start MCP server
memberstack-ai-context test # Run tests
memberstack-ai-context help # Show help🔬 Technical Details
Performance Benefits
| Metric | Before | After | Improvement | |--------|--------|-------|-------------| | Context Size | ~63K tokens | ~5K tokens | 90% reduction | | Query Speed | Slow | Fast | 10x faster | | Relevance | Basic | Targeted | Much better |
Architecture
- Doc Parser: Extracts methods, parameters, examples from markdown
- Search Index: Fuse.js fuzzy search with relevance scoring
- MCP Server: Standard Model Context Protocol implementation
- CLI Tools: Automated setup for different editors
📋 Requirements
- Node.js: 16.0.0 or higher
- NPM: Latest version
- AI Editor: Claude Code, Cursor, or MCP-compatible editor
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests if applicable
- Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
📝 Documentation Accuracy
This documentation has been verified 95% accurate against the actual Memberstack DOM source code:
- Method signatures checked against
client-side-packages/packages/memberstack-dom/src/ - Parameter types validated
- Return types confirmed
- Usage examples tested
🐛 Troubleshooting
Installation Issues
# Clear npm cache and retry
npm cache clean --force
npm install -g memberstack-ai-context
# Or use GitHub installation
curl -fsSL https://raw.githubusercontent.com/julianmemberstack/memberstack-ai-context/main/install.sh | bashEditor Integration Issues
# Test MCP server directly
memberstack-ai-context test
# Re-run setup
memberstack-ai-context setup
# Check configuration
cat ~/Library/Application\ Support/Claude/mcp_servers.jsonCommon Issues
- "Command not found": Ensure Node.js 16+ is installed
- "Permission denied": Try
sudo npm install -g memberstack-ai-context - "MCP not working": Restart your editor after setup
📄 License
MIT License - see LICENSE file for details.
🔗 Links
- NPM Package: memberstack-ai-context
- Repository: GitHub
- Issues: Bug Reports
- Memberstack Docs: Official Documentation
Made with ❤️ for the Memberstack developer community
