Enterprise-grade Model Context Protocol (MCP) server for the Vibe APIs, enabling seamless AI agent integration with production-ready architecture.
- Enterprise Architecture: Modular, scalable, and maintainable codebase
- Production-Ready: Comprehensive error handling, logging, and monitoring
- Async/Await: Full async implementation for high performance
- Type Safety: Pydantic models for all request/response validation
- Retry Logic: Automatic exponential backoff for transient failures
- Observability: Structured JSON logging for debugging and monitoring
- Connection Pooling: Efficient HTTP client with connection reuse
- Token Management: Secure Bearer token authentication
app/
├── config/ # Configuration management
│ └── settings.py # Environment-based settings
├── core/ # Core infrastructure
│ ├── constants.py # Centralized constants
│ ├── exceptions.py # Application exception hierarchy
│ ├── http_client.py # Reusable HTTP client with retries
│ ├── lifecycle.py # Application startup/shutdown
│ └── logging.py # Structured logging configuration
├── models/ # Pydantic request/response models
│ ├── activity.py
│ ├── bucket.py
│ ├── code.py
│ ├── project.py
│ └── repository.py
├── services/ # Business logic layer
│ └── vibe_api.py # High-level Vibe API client
├── tools/ # MCP tool implementations
│ └── vibe_tools.py # Tool wrappers for MCP
└── main.py # MCP server entry point
- Python 3.12+
uvpackage manager.envfile with configuration
-
Clone and navigate to the project:
cd McpServer_Vibe -
Create and activate virtual environment:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
uv pip install -e ".[dev]"
-
Copy environment template:
cp .env.example .env
-
Update
.envwith your credentials:VIBE_BASE_URL= VIBE_ACCESS_TOKEN= LOG_LEVEL=INFO MCP_TRANSPORT=stdio
python -m app.mainuv run app/main.pyvibe-mcpRetrieve all projects from the Vibe system.
Parameters:
environment(optional): Environment name (default: "production")
Example:
{
"environment": "production"
}Create a new repository in the Vibe system.
Parameters:
repo_id(required): Unique repository IDproject_id(required): Associated project IDrepo_name(required): Repository namerepo_description(optional): Repository descriptionfunctional_area(optional): Functional areaallow_ui_execution(optional): UI execution flag (0 or 1)sync_status(optional): Sync statuscomments(optional): Additional commentsversion_id(optional): Version ID
Create a bucket for test execution organization.
Parameters:
bucket_id(required): Unique bucket IDexecution_order(required): Execution orderbucket_name(required): Bucket namebucket_description(optional): Descriptionfunctional_area(optional): Functional areabucket_type(optional): Bucket typeversion_id(optional): Version IDrepo_id(optional): Repository IDenvironment(optional): Environment name
Retrieve activity details by bucket ID.
Parameters:
bucket_id(required): Bucket IDversion_id(required): Version IDenvironment(optional): Environment name
Retrieve code/script by query ID.
Parameters:
query_id(required): Query/Code IDversion_id(required): Version ID
Verify Vibe API server health and accessibility.
Parameters: None
- Create/update Claude config (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS, or%APPDATA%\Claude\claude_desktop_config.jsonon Windows):
{
"mcpServers": {
"vibe": {
"command": "python",
"args": ["-m", "app.main"],
"env": {
"VIBE_BASE_URL": "your_url_here",
"VIBE_ACCESS_TOKEN": "your_token_here"
}
}
}
}- Restart Claude Desktop to load the MCP server.
Similar configuration as Claude Desktop, update your Cursor MCP settings.
Install the MCP Client extension and add to your settings:
{
"mcp.servers": {
"vibe": {
"command": "python",
"args": ["-m", "app.main"],
"env": {
"VIBE_BASE_URL": "your_url_here",
"VIBE_ACCESS_TOKEN": "your_token_here"
}
}
}
}All configuration is managed through environment variables in .env file:
| Variable | Default | Description |
|---|---|---|
VIBE_BASE_URL |
your_url_here |
Vibe API base URL |
VIBE_ACCESS_TOKEN |
Required | Bearer token for authentication |
LOG_LEVEL |
INFO |
Logging level (DEBUG, INFO, WARNING, ERROR) |
VIBE_MAX_RETRIES |
3 |
Max retry attempts for failed requests |
VIBE_RETRY_BACKOFF_SECONDS |
0.5 |
Initial backoff time (exponential) |
MCP_TRANSPORT |
stdio |
MCP transport (stdio, sse) |
MCP_HOST |
0.0.0.0 |
MCP server host |
MCP_PORT |
9000 |
MCP server port |
ENABLE_HEALTH_CHECK |
true |
Enable health check tool |
ENABLE_METRICS |
true |
Enable metrics collection |
# Install dev dependencies
uv sync --extra dev
# Run all tests
uv run pytest tests/ -v
# Run with coverage report
uv run pytest tests/ --cov=app --cov-report=html
# Run specific test
uv run pytest tests/test_vibe_server.py::TestHttpClient -vSee TESTING.md for comprehensive testing documentation.
# Lint with ruff
uv run ruff check app/
# Type checking with pyright
uv run pyright app/LOG_LEVEL=DEBUG uv run app/main.pyThe server implements enterprise-grade error handling:
- VibeAuthenticationError: Invalid or expired token (HTTP 401)
- VibeNotFoundError: Resource not found (HTTP 404)
- VibeValidationError: Request validation failure
- VibeTimeoutError: Request timeout
- VibeConnectionError: Network connectivity issues
All errors are automatically logged with structured context for debugging.
Failed requests are automatically retried with exponential backoff:
- Max retries: Configurable (default: 3)
- Backoff multiplier: Exponential (1, 2, 4, 8 seconds)
- Retryable errors: Timeouts, connection errors, server errors
- Non-retryable: Authentication errors (401), validation errors
Structured JSON logging provides detailed observability:
{
"event": "HTTP request successful",
"timestamp": "2024-05-19T10:30:45.123456Z",
"level": "info",
"logger": "http_client",
"method": "GET",
"endpoint": "/api/Project/GetProjectList",
"status_code": 200
}Enable debug logging for detailed request/response traces:
LOG_LEVEL=DEBUG python -m app.main- Connection Pooling: HTTP client maintains persistent connections (10 max)
- Timeout Configuration: 30-second request timeout, 10-second connect timeout
- Async Processing: All operations are async for concurrent execution
- Memory Efficiency: Structured streaming responses for large datasets
- Token Handling: Bearer tokens are stored securely in
SecretStrand never logged - HTTPS: All connections use HTTPS by default
- Input Validation: All inputs validated against Pydantic models
- Output Sanitization: Responses are validated before returning to clients
-
Verify network connectivity:
curl -H "Authorization: Bearer $VIBE_ACCESS_TOKEN" \ "your_url_here"
-
Check VPN/Proxy if required for your network
-
Enable debug logging:
LOG_LEVEL=DEBUG python -m app.main
- Verify token is valid and not expired
- Check token format: Should be
Bearer <token> - Ensure
.envfile is loaded:cat .env | grep VIBE_ACCESS_TOKEN
- Increase timeout in production (edit
http_client.py) - Check network latency to Vibe API
- Reduce concurrent requests if hitting rate limits
For contributing to this project:
- Follow PEP 8 style guide
- Add type annotations to all functions
- Write tests for new features
- Update documentation
- Run linting and type checks before submitting
This project is proprietary and maintained by the engineering team.
For issues or questions:
- Check the troubleshooting section
- Review structured logs for error context
- Contact the engineering team with:
- Error message and stack trace
- Relevant log output
- Steps to reproduce the issue