Handles asynchronous HTTP requests to the aiprediction.us API for authentication and data retrieval of trading predictions.
Manages environment variables for storing API credentials and configuration settings for the aiprediction.us API.
Serves as the runtime environment for the MCP server, required at version 3.8 or higher to run the prediction data retrieval service.
MCPServer_aiprediction_us
AI Prediction MCP Server
A Model Context Protocol (MCP) server that provides Claude with access to AI prediction data from the aiprediction.us API.
AI Prediction MCP Server
A Model Context Protocol (MCP) server that provides Claude with access to AI prediction data from the aiprediction.us API. This server handles authentication, date formatting, and data retrieval to give Claude seamless access to trading predictions and analysis.
🚀 Features
Automatic Authentication: Handles token-based authentication with the AI Prediction API
Date Management: Converts dates to YYMMDD format and gets current date automatically
Real-time Data: Retrieves last elements data for any date
Error Handling: Comprehensive logging and error recovery
Token Management: Automatic token refresh when expired
📋 Prerequisites
Python 3.8 or higher
Active account on aiprediction.us
Claude Desktop (or another MCP-compatible client)
🛠️ Installation
1. Clone or Download Files
Download these files to your project directory:
MCPServer.py
(the main MCP server)requirements.txt
(Python dependencies).env.example
(environment configuration template)
2. Set Up Python Environment
Option A: Using venv (Recommended)
Option B: Using conda
Option C: Global Installation
3. Configure Environment Variables
Copy the example file:
cp .env.example .envEdit
# AI Prediction API Configuration API_BASE_URL=https://aiprediction.us API_USERNAME=your_username_here API_PASSWORD=your_password_hereReplace
your_username_here
andyour_password_here
with your actual aiprediction.us credentials.
🎯 Running the MCP Server
Test the Server
You should see output like:
If you see errors:
Missing credentials: Check your
.env
fileAuthentication failed: Verify your username/password
API errors: Check your network connection
Keep Server Running
The MCP server needs to stay running while you use Claude. You can:
Run it in a terminal and keep it open
Use screen/tmux for persistent sessions
Run as a background service
🔧 Configure Claude Desktop
1. Find Claude's Configuration File
macOS:
Windows:
2. Add MCP Server Configuration
Edit the configuration file and add your MCP server:
Important: Replace /full/path/to/your/aiprediction-mcp-server.py
with the actual full path to your script.
3. Restart Claude Desktop
Close and reopen Claude Desktop to load the new configuration.
💬 Using Claude with AI Prediction Data
Once configured, you can ask Claude to access your AI prediction data:
Example Queries
Get Today's Data:
Get Specific Date:
Date Conversion:
Historical Analysis:
Available Tools
Claude will have access to these tools:
get_current_date_data
- Gets prediction data for todayget_last_elements_by_date
- Gets data for any specific dateformat_date_yymmdd
- Converts dates to YYMMDD formatget_api_debug_info
- Gets API status and debug information
Data Structure
The API returns data with this structure:
🔍 Troubleshooting
Common Issues
1. "Missing credentials" Error
Check your
.env
file exists and has correct formatEnsure no extra spaces around the
=
signsVerify file is in same directory as the script
2. "Authentication failed" Error
Verify your username and password are correct
Check if your aiprediction.us account is active
Try logging in via the website first
3. "MCP Server not found" in Claude
Check the full path in
claude_desktop_config.json
Ensure Python is in your system PATH
Try using absolute path to Python executable
4. "No data found" for specific dates
Some dates may not have prediction data
Try recent trading days (weekdays)
Check if the date format is correct (YYMMDD)
Debug Mode
To see detailed logging, you can modify the server to show more information:
Check Configuration
Verify Claude can see your MCP server:
Open Claude Desktop
Look for MCP server indicators in the interface
Try asking: "What MCP tools do you have access to?"
📚 API Reference
Environment Variables
Variable | Required | Description |
| Yes | Base URL for the API ( ) |
| Yes | Your aiprediction.us username |
| Yes | Your aiprediction.us password |
Date Format
The API uses YYMMDD format:
250613
= June 13, 2025241225
= December 25, 2024240101
= January 1, 2024
Available Endpoints
The MCP server accesses these API endpoints:
POST /api-token-auth/
- AuthenticationGET /api/v53a/{did}/last-elements/
- Get prediction dataGET /api/debug/v53a/general/
- Debug information
🤝 Contributing
To improve this MCP server:
Fork the repository
Make your changes
Test with your AI Prediction account
Submit a pull request
📄 License
This project is licensed under the MIT License.
🆘 Support
For issues:
Check the troubleshooting section above
Verify your aiprediction.us account works via their website
Test the MCP server output for detailed error messages
Check Claude Desktop's MCP configuration
Happy Trading with AI Predictions! 📈# aiprediction_us_MCP_Server
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server that provides Claude with access to AI-powered trading predictions and analysis from the aiprediction.us API, handling authentication, date formatting, and data retrieval.
Related MCP Servers
- -securityFlicense-qualityA comprehensive suite of Model Context Protocol servers designed to extend AI agent Claude's capabilities with integrations for knowledge management, reasoning, advanced search, news access, and workspace tools.Last updated -5
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to programmatically access financial data from Financial Modeling Prep API, including company profiles, financial statements, metrics, SEC filings, and market data.Last updated -5MIT License
- -securityFlicense-qualityA Model Context Protocol server that gives Claude access to multiple AI models (Gemini, OpenAI, OpenRouter) for enhanced code analysis, problem-solving, and collaborative development through AI orchestration with conversations that continue across tasks.Last updated -7,222
- -securityFlicense-qualityAn enhanced Model Context Protocol server that enables Claude to seamlessly collaborate with multiple AI models (Gemini, OpenAI, local models) for code analysis and development tasks, maintaining context across conversations.Last updated -4333