Metadata-Version: 2.4
Name: botrun-default-mcp
Version: 0.4.1
Summary: Botrun default MCP server (stdio)
Author-email: sebastian-hsu <sebastian.hsu@gmail.com>
License: MIT
Requires-Python: >=3.11
Requires-Dist: beautifulsoup4==4.14.3
Requires-Dist: google-auth==2.49.1
Requires-Dist: google-genai==1.69.0
Requires-Dist: httpx==0.28.1
Requires-Dist: mcp==1.26.0
Requires-Dist: plotly==6.6.0
Requires-Dist: pypdf==6.9.2
Requires-Dist: python-dotenv==1.2.2
Requires-Dist: pytz==2026.1.post1
Description-Content-Type: text/markdown

# botrun-default-mcp

A stdio-based MCP (Model Context Protocol) server providing PDF analysis, image analysis, web search, web scraping, and visualization tools. Designed to run via `uvx` with no server deployment needed.

## Tools

| Tool | Description |
|------|-------------|
| `chat_with_pdf` | Analyze local PDF files with Gemini (supports large files via chunked parallel processing) |
| `chat_with_imgs` | Analyze local image files with Gemini Vision |
| `web_search` | Search the web via Perplexity API (supports OpenRouter) |
| `scrape` | Scrape web pages to Markdown via ScraperAPI |
| `create_html_page` | Generate HTML pages and save to local files |
| `create_plotly_chart` | Generate interactive Plotly charts as local HTML files |
| `create_mermaid_diagram` | Generate Mermaid diagrams as local HTML files |
| `current_date_time` | Get current date/time in Asia/Taipei timezone |

## Installation

```bash
uvx botrun-default-mcp
```

Or install from source:

```bash
git clone https://github.com/sebastian-hsu/botrun_default_mcp_uv.git
cd botrun_default_mcp_uv
uv sync
```

## Configuration

The server automatically loads environment variables from a `.env` file in the working directory. Just point `cwd` to the directory containing your `.env` file — no need to pass `env` in the MCP config.

### Claude Desktop / Claude Code

Add to your MCP settings (`claude_desktop_config.json` or `.claude.json`):

```json
{
  "mcpServers": {
    "botrun-default-mcp": {
      "command": "uvx",
      "args": ["botrun-default-mcp"],
      "cwd": "/path/to/directory/with/dotenv"
    }
  }
}
```

### LangGraph

```json
{
  "botrun-default-mcp": {
    "transport": "stdio",
    "command": "/path/to/uvx",
    "args": ["botrun-default-mcp"],
    "cwd": "/path/to/directory/with/dotenv"
  }
}
```

### .env file example

```env
GOOGLE_APPLICATION_CREDENTIALS_FOR_FASTAPI=/path/to/gcp-service-account.json
OPENROUTER_API_KEY=sk-or-v1-xxx
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
SCRAPERAPI_API_KEY=your-scraperapi-key
```

### Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `GOOGLE_APPLICATION_CREDENTIALS_FOR_FASTAPI` | Yes (for PDF/image tools) | GCP service account JSON key for Gemini API |
| `PPLX_API_KEY` | Yes* (for web_search) | Perplexity API key |
| `OPENROUTER_API_KEY` | Yes* (for web_search) | OpenRouter API key (alternative to PPLX_API_KEY) |
| `OPENROUTER_BASE_URL` | With OpenRouter | OpenRouter base URL |
| `SCRAPERAPI_API_KEY` | Yes (for scrape) | ScraperAPI key |
| `PDF_ANALYZER_MODEL` | No | Gemini model for PDF analysis (default: `gemini-flash-latest`) |
| `IMG_ANALYZER_MODEL` | No | Gemini model for image analysis (default: `gemini-flash-latest`) |

\* Either `PPLX_API_KEY` or `OPENROUTER_API_KEY` + `OPENROUTER_BASE_URL` is required for `web_search`.

## Development

```bash
# Setup
uv sync

# Run tests
uv run pytest tests/ -v

# Build
uv build

# Publish to PyPI
cd sh && bash seba_pypi.sh
```

## License

MIT
