@samscarrow/lmstudio-mcp
v2.0.0
Published
LM Studio MCP server with concurrent multi-agent support and memory safety
Maintainers
Readme
@samscarrow/lmstudio-mcp
LM Studio MCP Server with concurrent multi-agent support and memory safety features.
Quick Start
# Run directly with NPX (recommended)
npx @samscarrow/lmstudio-mcp
# Or install globally
npm install -g @samscarrow/lmstudio-mcp
lmstudio-mcpRequirements
- Node.js 16+ - To run this NPM package
- Python 3.7+ - For the MCP server itself
- LM Studio - Running with a model loaded
The Python components are automatically downloaded and set up on first run.
Configuration
Environment Variables
# LM Studio API endpoint (default: http://localhost:1234/v1)
export LMSTUDIO_API_BASE="http://localhost:1234/v1"
# Logging level
export LOG_LEVEL="INFO"Command Line Options
# Custom API base
npx @samscarrow/lmstudio-mcp --api-base http://192.168.1.100:1234/v1
# Custom log level
npx @samscarrow/lmstudio-mcp --log-level DEBUG
# Show help
npx @samscarrow/lmstudio-mcp --help
# Show version
npx @samscarrow/lmstudio-mcp --versionFeatures
- 🚀 Concurrent Multi-Agent Support - Handle multiple requests simultaneously
- 🛡️ Memory Safety - Intelligent memory management and limits
- 📊 Real-time Monitoring - Track performance and resource usage
- 🔄 Auto-retry Logic - Robust error handling and recovery
- 🎯 Load Balancing - Distribute requests across available resources
- 📈 Scaling Support - Handle increased load automatically
Programmatic Usage
You can also use this package programmatically in your Node.js applications:
const LMStudioMCP = require('@samscarrow/lmstudio-mcp');
// Create instance with custom options
const server = new LMStudioMCP({
apiBase: 'http://localhost:1234/v1',
logLevel: 'INFO'
});
// Start the server
server.start()
.then(() => console.log('Server started'))
.catch(console.error);Troubleshooting
Python Not Found
If you get Python-related errors:
# Install Python 3 (macOS with Homebrew)
brew install python3
# Install Python 3 (Ubuntu/Debian)
sudo apt update && sudo apt install python3 python3-pip
# Windows - download from python.orgLM Studio Connection Issues
- Ensure LM Studio is running
- Check that a model is loaded in LM Studio
- Verify the API endpoint is correct (default: http://localhost:1234/v1)
- Try using
127.0.0.1instead oflocalhost
Port Already in Use
The MCP server uses stdio communication, not HTTP ports. If you see port errors, they're likely from LM Studio itself.
Installation Locations
Files are installed to:
- macOS/Linux:
~/.lmstudio-mcp/ - Windows:
%USERPROFILE%\.lmstudio-mcp\
Development
# Clone the repository
git clone https://github.com/samscarrow/lmstudio-mcp.git
# Install dependencies
npm install
# Run locally
node bin/lmstudio-mcp.jsLicense
MIT - see LICENSE file for details.
Support
- 📖 Documentation: https://github.com/samscarrow/lmstudio-mcp
- 🐛 Issues: https://github.com/samscarrow/lmstudio-mcp/issues
- 💬 Discussions: https://github.com/samscarrow/lmstudio-mcp/discussions
Related
- LM Studio - Local LLM runtime
- Model Context Protocol - MCP specification
- Claude Code - AI coding assistant
