Defeatbeta Api
@defeat-beta
An open-source alternative to Yahoo Finance's market data APIs with higher reliability.
Defeat Beta API MCP is an MCP server that exposes data from defeatbeta-api to large language models via standardized contextual interfaces, enabling structured and controlled financial data analysis.
Click here to discover more ways to use MCP and explore additional use cases and best practices.
Overall Architecture
┌──────────────────────┐
│ MCP Client │
│ (Claude Desktop / │
│ Manus AI / │
│ Cherry Studio / │
│ Other MCP Clients) │
└──────────┬───────────┘
│ MCP (stdio)
│ JSON-RPC
▼
┌──────────────────────────────┐
│ Defeat Beta API MCP Server │
│ │
│ - MCP Tool Definitions │
│ - Context Construction │
│ - Windowing / Summarization │
│ - Output Shaping for LLM │
│ │
│ (runs in isolated .venv) │
└──────────┬───────────────────┘
│
│ Python API Calls
▼
┌──────────────────────────────┐
│ defeatbeta-api │
│ (Published PyPI Package) │
│ │
│ - Market Data Access │
│ - Price / History / Metrics │
│ │
└──────────┬───────────────────┘
│
▼
┌──────────────────────────────┐
│ Financial Data Sources │
│ (via defeatbeta-api) │
└──────────────────────────────┘
Installation
- Method 1: Run with uvx (Recommended)
- Method 2: One-line Install Script (Optional)
Method 1: Run with uvx (Recommended)
The recommended way to run Defeat Beta API MCP is using uvx. You need to install it first by running pip install uv.
This method requires no manual installation, no virtual environment management, and works seamlessly with MCP-native clients such as Manus, Cherry Studio, and Claude Desktop.
Step 1: Pre-warm the cache (first time only)
Before adding the MCP server to your client, run the following command once to download and cache the package locally:
uvx --refresh "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp"
This step is required because MCP clients have a 60-second initialization timeout. The first download from GitHub may exceed this limit and cause a connection failure. After the cache is warm, subsequent startups take under 2 seconds.
Step 2: MCP Configuration:
{
"mcpServers": {
"defeatbeta-api": {
"command": "uvx",
"args": [
"git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp"
]
}
}
}
Once added, your MCP client will automatically:
- Load the cached package
- Launch the MCP server in stdio mode No further setup is required.
Set HTTP Proxy (if you’re in a region where cannot access the Hugging Face Dataset):
{
"mcpServers": {
"defeatbeta-api": {
...
"env": {
"DEFEATBETA_GATEWAY": "http://127.0.0.1:8118"
}
}
}
}
Method 2: One-line Install Script
macOS or Linux
Run script to install:
curl -sSL https://raw.githubusercontent.com/defeat-beta/defeatbeta-api/main/mcp/install | bash
What this script does
The installation script will automatically perform the following steps:
- Installation Location
- The MCP server will be installed to the local directory:
~/.defeatbeta/ - This directory contains all code and runtime resources required by the MCP server and can be safely removed to uninstall.
- The MCP server will be installed to the local directory:
- Create an Isolated Python Virtual Environment
- An isolated Python virtual environment will be created at:
~/.defeatbeta/.venv - All dependencies are installed exclusively within this environment and will not affect the system Python installation or other projects.
- An isolated Python virtual environment will be created at:
- Download and Install MCP Server Entry Scripts
- MCP-related files are downloaded from the
defeatbeta-apirepository. - The script installs and configures
mcp/run.shas the unified entry point for starting the MCP server.
- MCP-related files are downloaded from the
- Install Runtime Dependencies
- Installs the MCP protocol implementation and required runtime dependencies (including
defeatbeta-api). - Dependencies are resolved and installed once during installation, avoiding repeated downloads or installations at runtime.
- Installs the MCP protocol implementation and required runtime dependencies (including
- Installed Directory Structure
After installation, the directory structure is as follows:
~/.defeatbeta/
├── .venv/ # Isolated Python virtual environment (used by MCP Server)
│ ├── bin/
│ └── lib/
│
├── mcp/ # MCP Server implementation
│ ├── run.sh # MCP Server entry script (stdio mode)
│ ├── install # Installation script (for curl | bash)
│ └── src/
│ └── defeatbeta_mcp/
│ └── server.py # MCP Server main entry
│
└── README.md # Local documentation
Notes:
run.shServes as the single entry point to start the MCP Server, compatible with stdio-based MCP clients..venv/Contains all dependencies required to run the MCP Server in an isolated environment.src/defeatbeta_mcp/server.pyCore implementation of the MCP Server, responsible for exposingdefeatbeta-apidata as MCP tools.
Usage
- Use in Claude Desktop
- Use in Manus
Use in Claude Desktop
1. Add MCP Server in Claude Desktop
Navigate to Settings → Developer → Local MCP servers → Edit Config
Open the claude_desktop_config.json file and add the following MCP server configuration:
{
"mcpServers": {
"defeatbeta-api": {
"command": "uvx",
"args": [
"git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp"
]
}
}
}
After saving the file, restart Claude for Desktop to apply the changes.
Once the configuration is complete, hover over the "Connectors" menu to verify that defeatbeta-api appears in the list.

Troubleshooting: If
defeatbeta-apidoes not appear in the Connectors menu, or shows a failed status like below, run the following command to pre-warm the local cache, then restart Claude for Desktop:
uvx --refresh "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp"
2. Talk to LLM with MCP
Once the MCP Server is configured and successfully connected, you can directly ask questions to the AI in Claude, for example:
📷 Click to view example screenshot

Use in Manus
1. Add MCP Server in Manus
Navigate to Personalization center → Connectors → Add connectors → Custom MCP → Import by JSON and add the following MCP server configuration:
{
"mcpServers": {
"defeatbeta-api": {
"command": "uvx",
"args": [
"--refresh",
"git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp"
],
"note": "An open-source alternative to Yahoo Finance's market data APIs with higher reliability.",
"icon": "https://github.com/defeat-beta/defeatbeta-api/blob/main/doc/favicon.ico?raw=true"
}
}
}
Once configured, the result looks like this:

2. Talk to LLM with MCP
Once the MCP Server is configured and successfully connected, you can directly ask questions to the AI in Manus, for example:
📷 Click to view example screenshot

