SoftwareOne Marketplace MCP Server
by marcserrat
README.md
# SoftwareOne Marketplace MCP Server
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io/)
[](https://docs.platform.softwareone.com/developer-resources/rest-api/resource-query-language)
A **Model Context Protocol (MCP)** server that provides AI assistants with access to the [SoftwareOne Marketplace API](https://docs.platform.softwareone.com/). Features full RQL (Resource Query Language) support, intelligent caching, and streamlined tool interface.
---
## ๐ Quick Start
```bash
# 1. Clone and setup
git clone <repository-url>
cd mpt-mcp
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment
cp config/env.example .env
# Edit .env with your API credentials
# 5. Start the server
./scripts/start/start_server.sh
```
See **[docs/QUICKSTART.md](docs/QUICKSTART.md)** for detailed instructions.
---
## โจ Features
### ๐ฏ Streamlined Tool Interface
- **Single `marketplace_query` tool** instead of 200+ individual tools
- Supports all 263 GET endpoints from the SoftwareOne API
- Simple resource-based access: `catalog.products`, `commerce.orders`, etc.
### ๐ Full RQL Support
- **Complete implementation** of [Resource Query Language](https://docs.platform.softwareone.com/developer-resources/rest-api/resource-query-language)
- Filtering: `eq()`, `ilike()`, `and()`, `or()`, `not()`, `in()`, `out()`
- Field selection, sorting, pagination
- See **[docs/guides/RQL_GUIDE.md](docs/guides/RQL_GUIDE.md)**
### โก Intelligent Caching
- **24-hour TTL** for OpenAPI spec
- Fast startup (uses cached spec when available)
- Automatic cache refresh
- Offline mode support
### ๐ Dual Transport Modes
- **Stdio** - Local Cursor integration (single-user) ๐
- **SSE** - Cloud deployment (multi-tenant capable) โ๏ธ๐ฅ
- Intelligent credential handling: client or server credentials
- Case-insensitive header support (X-MPT-Authorization, X-MPT-Endpoint)
- See **[docs/guides/SSE_DEPLOYMENT.md](docs/guides/SSE_DEPLOYMENT.md)**
### ๐ Cloud-Ready (SSE Mode)
- **Docker support** with provided Dockerfile
- **Docker Compose** for easy deployment
- **Multi-tenant capable** - Each client uses their own credentials
- **Flexible fallback** - Server credentials when client doesn't provide
- **CORS configuration** for secure remote access
- **Cloud platform examples** (AWS, GCP, Azure, Heroku)
- See **[docs/guides/MULTITENANT_GUIDE.md](docs/guides/MULTITENANT_GUIDE.md)**
---
## ๐ Current Stats
- **9,582** products available in marketplace
- **263** API endpoints supported
- **5** tools (vs 200+ with old approach)
- **24-hour** cache TTL
---
## ๐ Project Structure
```
mpt-mcp/
โโโ README.md # You are here
โโโ requirements.txt # Python dependencies
โโโ .env # Your configuration (create from config/env.example)
โ
โโโ src/ # ๐ง Source code
โ โโโ server_stdio.py # Stdio MCP server (local)
โ โโโ api_client.py # API client with RQL support
โ โโโ config.py # Configuration management
โ โโโ cache_manager.py # Caching system
โ โโโ openapi_parser.py # OpenAPI spec parser
โ
โโโ scripts/ # ๐ ๏ธ Utility scripts
โ โโโ setup/ # Setup scripts
โ โโโ start/ # Server startup
โ โโโ utils/ # Utilities
โ
โโโ tests/ # ๐งช Tests
โ โโโ test_rql.py # RQL implementation tests
โ โโโ test_mcp_json.py # MCP protocol tests
โ โโโ test_stdio_server.py # Server tests
โ
โโโ docs/ # ๐ Documentation
โ โโโ QUICKSTART.md # Quick start guide
โ โโโ setup/ # Setup guides
โ โโโ guides/ # User guides (RQL, caching, etc.)
โ โโโ reference/ # Technical reference
โ
โโโ config/ # โ๏ธ Configuration examples
โโโ cursor_mcp_config.json # Cursor MCP configuration
โโโ env.example # Environment template
```
---
## ๐ง Usage
### Query Products
```python
# Get product count
marketplace_query(resource="catalog.products", limit=1)
# Returns: 9,582 products
# Search for Microsoft products
marketplace_query(
resource="catalog.products",
rql="ilike(name,*Microsoft*)",
limit=50
)
# Filter by status
marketplace_query(
resource="catalog.products",
rql="eq(status,Published)",
select="+id,+name,+vendor",
limit=100
)
```
### Available Resources
```python
# List all available resources
marketplace_resources()
# Get details about a specific resource
marketplace_resource_info(resource="catalog.products")
```
### Cache Management
```python
# Check cache status
marketplace_cache_info()
# Force refresh
marketplace_refresh_cache()
```
---
## ๐ Documentation
### Getting Started
- **[Quick Start Guide](docs/QUICKSTART.md)** - Get up and running in minutes
- **[Setup Guide](docs/setup/SETUP.md)** - Detailed setup instructions
- **[Cursor Integration](docs/setup/CURSOR_SETUP.md)** - Use with Cursor AI
### Guides
- **[RQL Guide](docs/guides/RQL_GUIDE.md)** - Complete RQL usage guide
- **[RQL Reference](docs/guides/RQL_REFERENCE.md)** - Quick operator reference
- **[RQL Implementation](docs/guides/RQL_IMPLEMENTATION.md)** - Implementation details
- **[Caching Guide](docs/guides/CACHING.md)** - How caching works
- **[SSE Deployment](docs/guides/SSE_DEPLOYMENT.md)** - Cloud deployment guide โ๏ธ
- **[Multi-Tenant Guide](docs/guides/MULTITENANT_GUIDE.md)** - Multiple clients with own credentials ๐ฅ
### Reference
- **[Architecture](docs/reference/ARCHITECTURE.md)** - System architecture
- **[Features](docs/reference/FEATURES.md)** - Complete feature list
- **[Setup Scripts](docs/SETUP_SCRIPTS.md)** - Script reference guide
---
## ๐งช Testing
```bash
# Run all tests
cd /path/to/mpt-mcp
# Test RQL implementation
./venv/bin/python tests/test_rql.py
# Test MCP protocol
./venv/bin/python tests/test_mcp_json.py
# Test server initialization
pytest tests/test_stdio_server.py
# Get current product count
./venv/bin/python scripts/utils/get_product_count.py
```
---
## ๐ฏ Use Cases
### For AI Assistants (via Cursor)
Ask natural language questions:
- "How many products are in the SoftwareOne marketplace?"
- "Find all Microsoft Office products"
- "Show me active orders from the last week"
- "Get invoices for customer X"
### For Developers
Query the API programmatically:
```python
from src.api_client import APIClient
from src.config import config
client = APIClient(
base_url=config.marketplace_api_base_url,
token=config.marketplace_api_token
)
# Query with RQL
result = await client.get(
"/public/v1/catalog/products",
params={"rql": "ilike(name,*Microsoft*)", "limit": 50}
)
```
---
## ๐ Configuration
Create a `.env` file in the project root:
```bash
# Copy the example
cp config/env.example .env
# Edit with your credentials
MARKETPLACE_API_BASE_URL=https://api.s1.show
MARKETPLACE_API_TOKEN=your_token_here
OPENAPI_SPEC_URL=https://api.s1.show/public/v1/openapi.json
```
See **[docs/setup/SETUP.md](docs/setup/SETUP.md)** for details.
---
## ๐ Troubleshooting
### Server won't start
```bash
# Verify setup
./scripts/utils/verify_cursor_setup.sh
# Check environment
source venv/bin/activate
python -c "from src.config import config; config.validate()"
```
### Cursor can't connect
```bash
# View logs
./scripts/utils/view_logs.sh
# Or in Cursor: Cmd+Shift+U โ Select "MCP: softwareone-marketplace"
```
See **[docs/setup/TROUBLESHOOTING.md](docs/setup/TROUBLESHOOTING.md)** for more help.
---
## ๐ฆ Requirements
- **Python 3.12+**
- **httpx** - Async HTTP client
- **fastmcp** - MCP server framework
- **pydantic** - Data validation
- **python-dotenv** - Environment management
See `requirements.txt` for complete list.
---
## ๐ค Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Submit a pull request
---
## ๐ License
[Add your license here]
---
## ๐ Links
- **[SoftwareOne Marketplace](https://www.softwareone.com/)**
- **[SoftwareOne API Docs](https://docs.platform.softwareone.com/)**
- **[Model Context Protocol](https://modelcontextprotocol.io/)**
- **[RQL Documentation](https://docs.platform.softwareone.com/developer-resources/rest-api/resource-query-language)**
---
## ๐ Support
For issues or questions:
1. Check the **[Troubleshooting Guide](docs/setup/TROUBLESHOOTING.md)**
2. Review **[Documentation](docs/)**
3. Open an issue on GitHub
---
**Made with โค๏ธ for SoftwareOne**