- Home
- MCP servers
- AI Prediction
AI Prediction
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"phsphd-mcpserver_aiprediction_us": {
"command": "python",
"args": [
"/full/path/to/your/MCPerver.py"
],
"env": {
"API_BASE_URL": "https://aiprediction.us",
"API_PASSWORD": "your_password",
"API_USERNAME": "your_username"
}
}
}
}You run an MCP server that exposes AI prediction data from aiprediction.us to your MCP client, enabling Claude to query today’s and historical AI trading predictions with automatic authentication, date formatting, and token management. This guide walks you through practical installation, configuration, and usage so you can start querying prediction data quickly and securely.
How to use
Once your MCP server is running, you connect it from your MCP client to access AI prediction data. You can ask Claude for today’s data, data for a specific date, or comparative history. The server handles authentication with aiprediction.us, formats dates to YYMMDD, and retrieves the latest prediction elements for the requested date.
How to install
Prerequisites you need before installing: Python 3.8 or higher, an active aiprediction.us account, and a Claude Desktop (or another MCP-compatible client). Follow these steps to set up the server on your machine.
# Create a working directory for the MCP server
mkdir aiprediction-mcp
cd aiprediction-mcp
# Option A: Using venv (recommended)
python -m venv aiprediction-mcp-venv
# On Windows:
Scripts\activate
# On macOS/Linux:
source bin/activate
# Install dependencies
pip install -r requirements.txt
Option B uses conda (alternative):
conda create -n aiprediction-mcp python=3.9
conda activate aiprediction-mcp
pip install -r requirements.txt
Option C shows a simple global install (not recommended for production):
pip install mcp aiohttp python-dotenv
Configure environment variables with your API details. Copy the example and edit it with your credentials.
cp .env.example .env
Edit .env to include your API base URL and credentials:
# AI Prediction API Configuration
API_BASE_URL=https://aiprediction.us
API_USERNAME=your_username_here
API_PASSWORD=your_password_here
Run the MCP server to verify it starts and authenticates to aiprediction.us.
python aiprediction-mcp-server.py
Additional sections
Configuration for Claude Desktop and environment variables are described below. Ensure the MCP server runs in a persistent session if you plan to keep Claude connected for long periods.
Notes on configuration and security
The server uses token-based authentication with aiprediction.us, automatically refreshing tokens when needed. You must keep your credentials secure and avoid exposing them in shared environments. The server converts dates to YYMMDD format and provides a simple API surface for Claude to retrieve last elements data for any date.
Troubleshooting
If you encounter issues, check these common points:
- Missing credentials: confirm the
.envfile exists and is in the same directory as the server script. - Authentication failed: verify your aiprediction.us username and password are correct and the account is active.
- MCP server not reachable from Claude: ensure the Python executable is in your system PATH and the path to the server script is correct.
- No data for a given date: not all dates have prediction data; try recent trading days and ensure the date is correctly formatted as YYMMDD.
Usage examples with Claude</h2>
Ask Claude for today’s data, a specific date, or a date range to compare predictions. The server exposes tools to get current date data, last elements by date, and date formatting, along with API debug information.
Data structure you’ll receive
The API returns a structured payload containing the date, identifiers, and a set of last-element prediction fields for the requested date, including items like sp, es, p1, c1, and other related metrics.
Available tools
get_current_date_data
Retrieves prediction data for today using the configured API and returns the latest elements for today.
get_last_elements_by_date
Fetches prediction data for a specific date provided in YYMMDD format and returns the last elements for that date.
format_date_yymmdd
Converts a given date into YYMMDD format for API requests.
get_api_debug_info
Provides API status and debugging information to help troubleshoot connectivity and token/auth issues.