WISTX MCP Server - DevOps compliance and pricing context for coding agents
Project description
WISTX - MCP Context Server for DevOps
MCP (Model Context Protocol) server providing compliance, pricing, and best practices context for DevOps infrastructure.
๐ฏ What is WISTX?
WISTX is an MCP server that provides context to LLMs (Claude, GPT-4, etc.) about:
- Compliance Requirements (PCI-DSS, HIPAA, CIS, SOC2, NIST, ISO 27001)
- Infrastructure Pricing (AWS, GCP, Azure)
- Code Examples (Terraform, Kubernetes, Docker)
- Best Practices (DevOps, security, cost optimization)
Users interact with WISTX through:
- MCP Protocol - Native integration with Claude Desktop, Cursor, Windsurf
- REST API - For CI/CD pipelines, scripts, and programmatic access
Features
- ๐ MCP Server - Native Claude Desktop integration
- ๐ REST API - Simple HTTP endpoints for context retrieval
- ๐ Vector Search - Semantic search across 50K+ compliance controls
- ๐ฐ Cost Calculator - Real-time infrastructure pricing
- ๐ Code Examples - 500K+ Terraform/K8s examples
- ๐ API Key Authentication - Secure access control
- ๐ Usage Tracking - Monitor API usage and billing
Requirements
- Python 3.11 or higher
- uv (install with:
curl -LsSf https://astral.sh/uv/install.sh | sh) - MongoDB (for data storage)
- Docker (optional, for containerized deployment)
Installation
Development Setup
-
Clone the repository:
git clone <repository-url> cd wistx-model
-
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Copy environment variables:
cp .env.example .env # Edit .env with your configuration # IMPORTANT: Add your OpenAI API key for data processing: # OPENAI_API_KEY=your-openai-api-key-here
-
Install the project and dependencies:
uv sync -
Run the API server:
uv run uvicorn api.main:app --reload
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Claude Desktop / Cursor / Windsurf โ
โ (User asks: "Create compliant RDS") โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Protocol
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WISTX MCP Server โ
โ โโ get_compliance_requirements โ
โ โโ calculate_infrastructure_cost โ
โ โโ get_code_examples โ
โ โโ search_best_practices โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MongoDB Atlas โ
โ โโ compliance_controls (50K+) โ
โ โโ pricing_data (105K+) โ
โ โโ code_examples (500K+) โ
โ โโ best_practices (100K+) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Project Structure
wistx-model/
โโโ api/ # REST API (FastAPI)
โ โโโ routers/v1/ # API endpoints
โ โ โโโ health.py # GET /health
โ โ โโโ usage.py # GET /v1/usage
โ โ โโโ compliance.py # GET /v1/compliance (TODO)
โ โ โโโ pricing.py # GET /v1/pricing (TODO)
โ โ โโโ code.py # GET /v1/code-examples (TODO)
โ โโโ middleware/ # API middleware
โ โ โโโ auth.py # API key authentication
โ โ โโโ rate_limit.py # Rate limiting
โ โ โโโ logging.py # Request logging
โ โโโ services/ # Business logic
โ โ โโโ billing_service.py # Billing logic
โ โ โโโ usage_tracker.py # Usage tracking
โ โ โโโ token_counter.py # Token counting
โ โโโ database/ # MongoDB connection
โ โโโ auth/ # Authentication
โ
โโโ wistx_mcp/ # MCP Server (TODO - Week 5)
โ โโโ server.py # MCP server main
โ โโโ tools/ # MCP tools
โ โโโ compliance.py # Compliance context
โ โโโ pricing.py # Pricing context
โ โโโ code_examples.py # Code examples
โ โโโ lib/ # Shared utilities
โ โโโ mongodb_client.py # MongoDB queries
โ โโโ vector_search.py # Vector search
โ โโโ context_builder.py # Context formatting
โ
โโโ data-pipelines/ # Data collection & processing
โ โโโ collectors/ # Data collectors
โ โโโ processors/ # Data processors
โ โโโ loaders/ # MongoDB loaders
โ โโโ models/ # Data models
โ
โโโ scripts/ # Utility scripts
โ โโโ setup_mongodb.py # MongoDB setup
โ โโโ run_compliance_collection.py # Data collection
โ โโโ validate_mongodb_complete.py # Validation
โ
โโโ tests/ # Test suite
โโโ pyproject.toml # Project configuration
โโโ docker-compose.yml # Docker Compose setup
โโโ README.md
Data Processing Pipeline
The data processing pipeline collects, processes, embeds, and loads compliance data into MongoDB and Pinecone.
Prerequisites
-
Environment Variables - Ensure your
.envfile includes:# Required for data processing OPENAI_API_KEY=your-openai-api-key-here MONGODB_URL=mongodb://localhost:27017 MONGODB_DATABASE=wistx-production PINECONE_API_KEY=your-pinecone-api-key PINECONE_INDEX_NAME=wistx-index
-
MongoDB Setup - Initialize MongoDB collections and indexes:
python scripts/setup_mongodb.py -
Dependencies - Install required packages:
uv sync # Optional: For PDF processing uv add docling
Running the Pipeline
Process a single compliance standard (full pipeline):
python scripts/run_pipeline.py --standard PCI-DSS --mode streaming
Process all compliance standards:
python scripts/run_pipeline.py --mode streaming
Skip collection stage (use existing raw data):
python scripts/run_pipeline.py --standard PCI-DSS --mode streaming --no-collection
Development mode (saves intermediate files for debugging):
python scripts/run_pipeline.py --standard PCI-DSS --mode checkpointing
Pipeline Modes
- Streaming Mode (
--mode streaming): Production mode - no intermediate files saved, faster execution - Checkpointing Mode (
--mode checkpointing): Development mode - saves intermediate files at each stage for debugging and resuming
Available Standards
PCI-DSS,CIS,HIPAA,SOC2,NIST-800-53,ISO-27001,GDPR,FedRAMP,CCPA,SOX,GLBA
Pipeline Stages
- Collection - Scrapes URLs/web pages (Crawl4AI) and processes PDFs (Docling)
- Processing - Standardizes raw data into
ComplianceControlmodels - Embedding - Generates vector embeddings using OpenAI API
- Loading - Stores documents in MongoDB and vectors in Pinecone
For detailed pipeline documentation, see data-pipelines/HOW_TO_RUN_PIPELINE.md
Development
Running Tests
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov
# Run specific test file
uv run pytest tests/api/test_messages.py
Code Quality
# Format code with black
uv run black .
# Lint with ruff
uv run ruff check .
# Type check with mypy
uv run mypy .
Adding Dependencies
# Add a runtime dependency
uv add <package-name>
# Add a development dependency
uv add --group dev <package-name>
Docker Deployment
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
API Endpoints
Current
GET /health- Health checkGET /v1/usage- Get usage statistics
Planned (Week 6)
GET /v1/compliance- Get compliance requirementsGET /v1/pricing- Calculate infrastructure costsGET /v1/code-examples- Search code examplesGET /v1/best-practices- Search best practices
OpenAPI Specification
The REST API exposes an OpenAPI specification:
- OpenAPI spec: http://localhost:8000/openapi.json
- Interactive docs: http://localhost:8000/docs
SDKs can be generated from the OpenAPI spec using openapi-generator if needed.
The MCP server provides these tools:
get_compliance_requirements- Get compliance controls for resourcescalculate_infrastructure_cost- Calculate costs for infrastructureget_code_examples- Get relevant code examplessearch_best_practices- Search DevOps best practicescheck_compliance_violations- Check code for compliance issuessuggest_cost_optimizations- Suggest cost savings
Documentation
- MCP Architecture Guide - Complete MCP implementation guide
- MongoDB Setup - MongoDB configuration and schema
- Data Pipeline - Data collection and processing
- Architecture Review - Migration details
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wistx_mcp-1.0.1.tar.gz.
File metadata
- Download URL: wistx_mcp-1.0.1.tar.gz
- Upload date:
- Size: 870.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf56337cbea8de552ae580106197aeea4a37f1a1c5d2b692e891b04d085e65aa
|
|
| MD5 |
4721fc560c3bcb9f29e890ce662d753d
|
|
| BLAKE2b-256 |
c00977cd2bcd6fc4973d4676ef381a4806a5c3141fc5a6a0d799db379d3f43e8
|
File details
Details for the file wistx_mcp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: wistx_mcp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 131.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
417a1b0908c53e880b7aa03fd22fd0684905e983adc2eaedc6ab39b82aa30a6b
|
|
| MD5 |
a0952cd3089a20491c073b508edfb6df
|
|
| BLAKE2b-256 |
8a281d419b3916481780bcff7f62cbbe39a834269166d9240881257673d4a117
|