VOLI 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
voli-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: VOLI
3
+ Version: 0.1.0
4
+ Summary: MCP server for forex session volatility analysis
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: mcp>=1.0.0
7
+ Requires-Dist: pandas>=2.0.0
8
+ Requires-Dist: numpy>=1.24.0
9
+ Requires-Dist: requests>=2.31.0
10
+ Requires-Dist: aiohttp>=3.9.0
11
+ Requires-Dist: pytz>=2024.1
12
+ Requires-Dist: python-dateutil>=2.8.2
13
+ Requires-Dist: python-dotenv>=1.0.0
voli-0.1.0/README.md ADDED
@@ -0,0 +1,455 @@
1
+ # VOLI-MCP {MCP Server for Forex Session Volatility Analysis}
2
+ _A MCP (Model Context Protocol) server that provides real-time forex session volatility analysis and trading guidance. Leverages historical pattern matching, market data, and economic calendar integration to deliver actionable insights for forex traders._
3
+
4
+ <p align="center">
5
+
6
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
8
+ [![MCP](https://img.shields.io/badge/MCP-1.0+-orange.svg)](https://modelcontextprotocol.io/)
9
+
10
+ </p>
11
+
12
+ ## CRACKED DEVS BEHIND THIS
13
+
14
+ <p align="center">
15
+ <img src="https://img.shields.io/badge/CONTRACTOR-X-blue?style=for-the-badge" />
16
+ <img src="https://img.shields.io/badge/MOH-DAKAI-green?style=for-the-badge" />
17
+ </p>
18
+
19
+ ## Table of Contents
20
+
21
+ - [Overview](#overview)
22
+ - [Key Features](#key-features)
23
+ - [Architecture](#architecture)
24
+ - [Installation](#installation)
25
+ - [Configuration](#configuration)
26
+ - [Usage](#usage)
27
+ - [API Reference](#api-reference)
28
+ - [Project Structure](#project-structure)
29
+ - [Data Flow](#data-flow)
30
+ - [Testing](#testing)
31
+ - [Contributing](#contributing)
32
+ - [License](#license)
33
+
34
+ ## Overview
35
+
36
+ VOLI-MCP (Volatility Analysis for Forex Sessions) is an MCP server designed to analyze forex market volatility during different trading sessions (Asian, London, New York). It combines:
37
+
38
+ - **Real-time market data** from Twelve Data API
39
+ - **Economic calendar integration** for event awareness
40
+ - **Historical pattern matching** using 30-60 days of data
41
+ - **Advanced volatility calculations** including range analysis and compression detection
42
+ - **Confidence scoring** based on historical accuracy
43
+ - **Agent-specific trading guidance** tailored to different trading styles
44
+
45
+ The server exposes a single MCP tool `analyze_forex_session` that accepts a currency pair and target session, returning comprehensive analysis including expected deviation, confidence levels, market drivers, and trading recommendations.
46
+
47
+ ## Key Features
48
+
49
+ ### Comprehensive Analysis
50
+ - **Session Detection**: Automatic detection of current/next trading sessions
51
+ - **Volatility Forecasting**: Expected deviation in pips for upcoming sessions
52
+ - **Pattern Recognition**: Historical pattern matching with similarity thresholds
53
+ - **Compression Analysis**: Detection of pre-session range compression indicating potential breakout
54
+
55
+ ### Data Integration
56
+ - **Market Data**: Real-time and historical forex data via Twelve Data API
57
+ - **Economic Calendar**: Integration with economic event data for enhanced analysis
58
+ - **Multiple Timeframes**: Support for intraday (5-min) and daily data analysis
59
+
60
+ ### Intelligent Guidance
61
+ - **Confidence Scoring**: Statistical confidence based on historical accuracy
62
+ - **Market Drivers**: Clear explanations of factors influencing volatility
63
+ - **Agent Guidance**: Tailored recommendations for different trading approaches
64
+ - **Volatility Classification**: Categorized volatility levels (Low/Medium/High)
65
+
66
+ ### Developer-Friendly
67
+ - **MCP Protocol**: Standards-compliant MCP server using stdio transport
68
+ - **HTTP API Wrapper**: FastAPI-based REST API for testing and integration
69
+ - **Comprehensive Testing**: Full test suite with mock data support
70
+ - **Modular Architecture**: Clean separation of concerns for easy maintenance
71
+
72
+ ## Architecture
73
+
74
+ VOLI follows a modular architecture with clear separation of responsibilities:
75
+
76
+ ```
77
+ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
78
+ │ MCP Server │────│ SessionAnalyzer │────│ Data Layer │
79
+ │ (server.py) │ │ │ │ │
80
+ └─────────────────┘ └──────────────────┘ └─────────────────┘
81
+ │ │
82
+ ▼ ▼
83
+ ┌──────────────────┐ ┌─────────────────┐
84
+ │ Analysis Layer │ │ External APIs │
85
+ │ │ │ │
86
+ └──────────────────┘ └─────────────────┘
87
+ ```
88
+
89
+ ### Core Components
90
+
91
+ - **MCP Server**: Handles MCP protocol communication and tool exposure
92
+ - **Session Analyzer**: Main orchestration logic for analysis workflow
93
+ - **Data Layer**: Clients for Twelve Data API and economic calendar
94
+ - **Analysis Layer**: Range calculation, pattern matching, confidence scoring
95
+ - **Utilities**: Session management, data formatting, validation
96
+
97
+ ## Installation
98
+
99
+ ### Prerequisites
100
+
101
+ - Python 3.10 or higher
102
+ - Valid Twelve Data API key (free tier available)
103
+ - Internet connection for API access
104
+
105
+ ### Step 1: Clone the Repository
106
+
107
+ ```bash
108
+ git clone https://github.com/Ash-Cyber-and-Computer-Organization/Voli-MCP.git
109
+ cd Voli-MCP
110
+ ```
111
+
112
+ ### Step 2: Create Virtual Environment
113
+
114
+ ```bash
115
+ # Create virtual environment
116
+ python -m venv .venv
117
+
118
+ # Activate it
119
+ source .venv/bin/activate # Linux/Mac
120
+ # OR
121
+ .venv\Scripts\activate # Windows
122
+ ```
123
+
124
+ ### Step 3: Install Dependencies
125
+
126
+ ```bash
127
+ # Install from pyproject.toml
128
+ pip install -e .
129
+
130
+ # OR install from requirements.txt
131
+ pip install -r requirements.txt
132
+ ```
133
+
134
+ ### Step 4: Verify Installation
135
+
136
+ ```bash
137
+ # Check installed packages
138
+ pip list
139
+
140
+ # Run basic import test
141
+ python -c "from src.tools.session_analyzer import analyze_forex_session; print('Installation successful')"
142
+ ```
143
+
144
+ ## Configuration
145
+
146
+ ### Environment Variables
147
+
148
+ Create a `.env` file in the project root:
149
+
150
+ ```bash
151
+ # Copy example file
152
+ cp .env.example .env
153
+
154
+ # Edit with your API key
155
+ TWELVE_DATA_API_KEY=your_actual_api_key_here
156
+ MAX_REQUESTS_PER_DAY=800
157
+ REQUEST_DELAY_SECONDS=1
158
+ LOG_LEVEL=INFO
159
+ ```
160
+
161
+ ### API Key Setup
162
+
163
+ 1. Visit [Twelve Data](https://twelvedata.com/) and sign up for a free account
164
+ 2. Get your API key from the dashboard
165
+ 3. Add it to your `.env` file
166
+
167
+ ### Rate Limiting
168
+
169
+ The server includes built-in rate limiting:
170
+ - **Free Tier**: 800 requests/day
171
+ - **Configurable Delay**: 1 second between requests (configurable)
172
+ - **Automatic Backoff**: Exponential backoff on rate limit errors
173
+
174
+ ## Usage
175
+
176
+ ### MCP Server (Production)
177
+
178
+ Run the MCP server for integration with MCP-compatible clients:
179
+
180
+ ```bash
181
+ # Start the MCP server
182
+ python -m src.server
183
+ ```
184
+
185
+ ### Integration with Claude Desktop
186
+
187
+ Add to your `claude_desktop_config.json`:
188
+
189
+ ```json
190
+ {
191
+ "mcpServers": {
192
+ "voli-forex": {
193
+ "command": "python",
194
+ "args": ["-m", "src.server"],
195
+ "cwd": "/path/to/voli-mcp",
196
+ "env": {
197
+ "TWELVE_DATA_API_KEY": "your_api_key_here"
198
+ }
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ ### HTTP API Wrapper (Testing)
205
+
206
+ For testing and development, use the FastAPI wrapper:
207
+
208
+ ```bash
209
+ # Start HTTP server
210
+ python api_wrapper.py
211
+
212
+ # Server runs on http://localhost:8000
213
+ # Interactive docs at http://localhost:8000/docs
214
+ ```
215
+
216
+ ### MCP Inspector (Development)
217
+
218
+ Use MCP Inspector for visual testing:
219
+
220
+ ```bash
221
+ # Install inspector
222
+ npm install -g @modelcontextprotocol/inspector
223
+
224
+ # Run with inspector
225
+ npx @modelcontextprotocol/inspector python -m src.server
226
+ ```
227
+
228
+ Opens web UI at `http://localhost:5173` for interactive testing.
229
+
230
+ ## API Reference
231
+
232
+ ### MCP Tool: `analyze_forex_session`
233
+
234
+ Analyzes forex session volatility and generates trading guidance.
235
+
236
+ #### Parameters
237
+
238
+ | Parameter | Type | Required | Description |
239
+ |-----------|------|----------|-------------|
240
+ | `pair` | string | Yes | Currency pair (e.g., "EUR/USD", "GBP/JPY") |
241
+ | `target_session` | string | No | Session: "asian", "london", "ny", or "auto" (default: "auto") |
242
+
243
+ #### Supported Pairs
244
+
245
+ - Majors: EUR/USD, GBP/USD, USD/JPY, USD/CHF, AUD/USD, USD/CAD, NZD/USD
246
+ - Minors: EUR/GBP, EUR/JPY, GBP/JPY, etc.
247
+ - Select Exotics: EUR/TRY, USD/TRY, etc.
248
+
249
+ #### Response Schema
250
+
251
+ ```json
252
+ {
253
+ "pair": "EUR/USD",
254
+ "session": "London Session",
255
+ "time_window_minutes": 90,
256
+ "volatility_expectation": "Medium",
257
+ "expected_deviation_pips": 45.2,
258
+ "confidence": 0.78,
259
+ "drivers": [
260
+ "Pre-session range compressed (18.7 pips vs 30-day avg of 26.4 pips)",
261
+ "No major economic events in next 2 hours",
262
+ "Historical data shows mixed outcomes for similar conditions (23 comparable days)"
263
+ ],
264
+ "historical_context": {
265
+ "similar_conditions_occurrences": 23,
266
+ "expansion_rate": 0.52
267
+ },
268
+ "agent_guidance": "Monitor for breakout above/below pre-session high/low. Consider reducing position sizes due to moderate confidence."
269
+ }
270
+ ```
271
+
272
+ #### Example Usage
273
+
274
+ ```python
275
+ from src.tools.session_analyzer import analyze_forex_session
276
+
277
+ # Analyze EUR/USD for next session
278
+ result = analyze_forex_session("EUR/USD", "auto")
279
+ print(result)
280
+ ```
281
+
282
+ ### HTTP API Endpoints
283
+
284
+ When running the API wrapper:
285
+
286
+ - `GET /` - API information and available endpoints
287
+ - `GET /docs` - Interactive Swagger documentation
288
+ - `GET /health` - Health check
289
+ - `POST /analyze` - Analyze session (same as MCP tool)
290
+
291
+ ## Project Structure
292
+
293
+ ```
294
+ voli-mcp/
295
+ ├── .env # Environment variables (API keys)
296
+ ├── .env.example # Environment template
297
+ ├── .gitignore # Git ignore rules
298
+ ├── .python-version # Python version specification
299
+ ├── README.md # This file
300
+ ├── pyproject.toml # Project configuration
301
+ ├── requirements.txt # Dependencies
302
+ ├── api_wrapper.py # FastAPI HTTP wrapper for testing
303
+ ├── PULL_REQUEST.md # Pull request template
304
+ ├── docs/ # Documentation
305
+ │ ├── huh.md # Additional docs
306
+ │ └── readme/
307
+ │ └── eng.md # Detailed developer guide
308
+ ├── src/ # Source code
309
+ │ ├── __init__.py
310
+ │ ├── server.py # MCP server implementation
311
+ │ ├── analysis/ # Analysis modules
312
+ │ │ ├── __init__.py
313
+ │ │ ├── confidence_scorer.py
314
+ │ │ ├── pattern_matcher.py
315
+ │ │ └── range_calculator.py
316
+ │ ├── data/ # Data clients
317
+ │ │ ├── __init__.py
318
+ │ │ ├── calendar_client.py
319
+ │ │ └── twelve_data_client.py
320
+ │ ├── tools/ # MCP tools
321
+ │ │ ├── __init__.py
322
+ │ │ └── session_analyzer.py
323
+ │ └── utils/ # Utilities
324
+ │ ├── __init__.py
325
+ │ ├── formatters.py
326
+ │ └── sessions.py
327
+ └── tests/ # Test suite
328
+ ├── __init__.py
329
+ ├── test_analysis.py
330
+ ├── test_data_clients.py
331
+ ├── test_full_system.py
332
+ └── test_utils.py
333
+ ```
334
+
335
+ ## Data Flow
336
+
337
+ ```mermaid
338
+ graph TD
339
+ A[User Request] --> B[MCP Server]
340
+ B --> C[Session Analyzer]
341
+ C --> D{Target Session?}
342
+ D -->|Auto| E[Detect Current/Next Session]
343
+ D -->|Manual| F[Validate Session]
344
+ E --> G[Fetch Market Data]
345
+ F --> G
346
+ G --> H[Twelve Data API]
347
+ G --> I[Economic Calendar]
348
+ H --> J[Calculate Ranges]
349
+ I --> J
350
+ J --> K[Pattern Matching]
351
+ K --> L[Confidence Scoring]
352
+ L --> M[Generate Drivers]
353
+ M --> N[Agent Guidance]
354
+ N --> O[Format Response]
355
+ O --> P[Return to User]
356
+ ```
357
+
358
+ ### Detailed Flow Steps
359
+
360
+ 1. **Input Validation**: Validate currency pair and session parameters
361
+ 2. **Session Detection**: Determine target session (auto-detect if needed)
362
+ 3. **Data Fetching**: Retrieve intraday and historical market data
363
+ 4. **Range Analysis**: Calculate pre-session and historical ranges
364
+ 5. **Compression Detection**: Identify if current range is compressed vs. average
365
+ 6. **Pattern Matching**: Find similar historical conditions
366
+ 7. **Event Checking**: Query economic calendar for upcoming events
367
+ 8. **Deviation Calculation**: Estimate expected session volatility
368
+ 9. **Confidence Scoring**: Calculate statistical confidence
369
+ 10. **Driver Generation**: Explain factors influencing analysis
370
+ 11. **Guidance Creation**: Generate trading recommendations
371
+ 12. **Response Formatting**: Structure output according to schema
372
+
373
+ ## Testing
374
+
375
+ VOLI includes a comprehensive test suite covering all components:
376
+
377
+ ### Running Tests
378
+
379
+ ```bash
380
+ # Run all tests
381
+ python -m pytest tests/
382
+
383
+ # Run specific test modules
384
+ python tests/test_utils.py
385
+ python tests/test_data_clients.py
386
+ python tests/test_analysis.py
387
+ python tests/test_full_system.py
388
+
389
+ # Run with coverage
390
+ python -m pytest tests/ --cov=src --cov-report=html
391
+ ```
392
+
393
+ ### Test Categories
394
+
395
+ - **Unit Tests**: Individual component testing
396
+ - **Integration Tests**: Full system workflow testing
397
+ - **API Tests**: Data client reliability testing
398
+ - **Mock Tests**: Tests without external API dependencies
399
+
400
+ ### Test Data
401
+
402
+ Tests use a combination of:
403
+ - Real API data (requires valid API key)
404
+ - Mock data for offline testing
405
+ - Historical test scenarios
406
+
407
+ ## Contributing
408
+
409
+ We welcome contributions! Please follow these steps:
410
+
411
+ ### Development Setup
412
+
413
+ 1. Fork the repository
414
+ 2. Create a feature branch: `git checkout -b feature/your-feature`
415
+ 3. Set up development environment (see Installation)
416
+ 4. Make your changes
417
+ 5. Run tests: `python -m pytest tests/`
418
+ 6. Commit changes: `git commit -am 'Add your feature'`
419
+ 7. Push to branch: `git push origin feature/your-feature`
420
+ 8. Create Pull Request
421
+
422
+ ### Code Standards
423
+
424
+ - Follow PEP 8 style guidelines
425
+ - Add type hints for function parameters and return values
426
+ - Write comprehensive docstrings
427
+ - Add unit tests for new functionality
428
+ - Update documentation as needed
429
+
430
+ ### Pull Request Process
431
+
432
+ 1. Update the `PULL_REQUEST.md` template with your changes
433
+ 2. Ensure all tests pass
434
+ 3. Update README.md if adding new features
435
+ 4. Request review from maintainers
436
+
437
+ ## License
438
+
439
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
440
+
441
+ ## Acknowledgments
442
+
443
+ - [Twelve Data](https://twelvedata.com/) for market data API
444
+ - [Model Context Protocol](https://modelcontextprotocol.io/) for the protocol specification
445
+ - [Anthropic](https://www.anthropic.com/) for Claude Desktop integration
446
+
447
+ ## Support
448
+
449
+ - **Issues**: [GitHub Issues](https://github.com/Ash-Cyber-and-Computer-Organization/Voli-MCP/issues)
450
+ <!--- **Discussions**: [GitHub Discussions](https://github.com/your-username/voli-mcp/discussions) -->
451
+ - **Documentation**: See `docs/` directory for detailed guides
452
+
453
+ ---
454
+
455
+ **Happy Trading!**
@@ -0,0 +1,22 @@
1
+ [project]
2
+ name = "VOLI"
3
+ version = "0.1.0"
4
+ description = "MCP server for forex session volatility analysis"
5
+ requires-python = ">=3.10"
6
+ dependencies = [
7
+ "mcp>=1.0.0",
8
+ "pandas>=2.0.0",
9
+ "numpy>=1.24.0",
10
+ "requests>=2.31.0",
11
+ "aiohttp>=3.9.0",
12
+ "pytz>=2024.1",
13
+ "python-dateutil>=2.8.2",
14
+ "python-dotenv>=1.0.0",
15
+ ]
16
+
17
+ [project.scripts]
18
+ forex-session-mcp = "src.server:main"
19
+
20
+ [build-system]
21
+ requires = ["setuptools>=68.0"]
22
+ build-backend = "setuptools.build_meta"
voli-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: VOLI
3
+ Version: 0.1.0
4
+ Summary: MCP server for forex session volatility analysis
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: mcp>=1.0.0
7
+ Requires-Dist: pandas>=2.0.0
8
+ Requires-Dist: numpy>=1.24.0
9
+ Requires-Dist: requests>=2.31.0
10
+ Requires-Dist: aiohttp>=3.9.0
11
+ Requires-Dist: pytz>=2024.1
12
+ Requires-Dist: python-dateutil>=2.8.2
13
+ Requires-Dist: python-dotenv>=1.0.0
@@ -0,0 +1,26 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/__init__.py
4
+ src/server.py
5
+ src/VOLI.egg-info/PKG-INFO
6
+ src/VOLI.egg-info/SOURCES.txt
7
+ src/VOLI.egg-info/dependency_links.txt
8
+ src/VOLI.egg-info/entry_points.txt
9
+ src/VOLI.egg-info/requires.txt
10
+ src/VOLI.egg-info/top_level.txt
11
+ src/analysis/__init__.py
12
+ src/analysis/confidence_scorer.py
13
+ src/analysis/pattern_matcher.py
14
+ src/analysis/range_calculator.py
15
+ src/data/__init__.py
16
+ src/data/calendar_client.py
17
+ src/data/twelve_data_client.py
18
+ src/tools/__init__.py
19
+ src/tools/session_analyzer.py
20
+ src/utils/__init__.py
21
+ src/utils/formatters.py
22
+ src/utils/sessions.py
23
+ tests/test_analysis.py
24
+ tests/test_data_clients.py
25
+ tests/test_full_system.py
26
+ tests/test_utils.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ forex-session-mcp = src.server:main
@@ -0,0 +1,8 @@
1
+ mcp>=1.0.0
2
+ pandas>=2.0.0
3
+ numpy>=1.24.0
4
+ requests>=2.31.0
5
+ aiohttp>=3.9.0
6
+ pytz>=2024.1
7
+ python-dateutil>=2.8.2
8
+ python-dotenv>=1.0.0
@@ -0,0 +1,7 @@
1
+ __init__
2
+ analysis
3
+ data
4
+ icons
5
+ server
6
+ tools
7
+ utils
File without changes
File without changes