Metadata-Version: 2.4
Name: dawo-mcp-server
Version: 0.1.0
Summary: MCP server exposing Dawo's investment-research tools to any MCP host (Claude Desktop, Cursor, etc.). Thin proxy to the Dawo HTTP API — authenticate with your own Dawo Pro API key.
License: Proprietary
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: mcp>=1.0.0
Description-Content-Type: text/markdown

# Dawo MCP Server

Use Dawo's investment-research tools from any MCP host (Claude Desktop, Cursor, …) — pull a Lead Analyst verdict, run a research plan, screen, compare, stress-test, and more, right inside your AI.

It's a thin proxy: every tool runs on Dawo's backend (identical to the in-app advisor). Nothing is computed locally. **It's a Pro perk** — you authenticate with your own Dawo API key, and tool execution stays Pro-gated.

## 1. Mint a Dawo API key (Pro)

In the Dawo web app: **Settings → API keys → Create key**. Copy the `dwo_…` key — it's shown **once**. (Or via API: `POST /auth/api-keys` with your logged-in session.)

Treat the key like a password. You can revoke it anytime (the key stops working immediately, and only works while your account is Pro).

## 2. Add it to your MCP host

**Claude Desktop** — edit `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "dawo": {
      "command": "uvx",
      "args": ["dawo-mcp-server"],
      "env": {
        "DAWO_API_KEY": "dwo_xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "DAWO_BASE_URL": "https://api-morning-silence-6501.fly.dev"
      }
    }
  }
}
```

`DAWO_BASE_URL` is optional (defaults to production). Restart the host and ask, e.g., *"Use Dawo to give me the verdict on NVDA"* or *"With Dawo, build a research plan for quality growth under $50B."*

## 3. Run locally (dev)

```bash
cd services/mcp-server
pip install -e .
DAWO_API_KEY=dwo_... dawo-mcp-server   # speaks MCP over stdio
```

Or without installing: `DAWO_API_KEY=dwo_... uvx --from . dawo-mcp-server`.

## How it works

- On startup it calls `GET /engines/tools/list` and registers each tool (name + JSON schema) as an MCP tool.
- On a tool call it `POST`s to `/engines/tools/execute` with `{tool, params}` and your key.
- `401/403` → your key is invalid/revoked or your plan isn't Pro; `503` → tools API temporarily off.

No data, secrets, or logic are stored locally beyond the API key you provide via env.

## Publishing (maintainers)

Publishing is automated by the `publish-mcp` GitHub Action. Bump `version` in
`pyproject.toml`, then push a matching tag — the workflow builds the wheel + sdist
and uploads to PyPI:

```bash
# after bumping version in pyproject.toml (e.g. to 0.1.0)
git tag mcp-v0.1.0 && git push origin mcp-v0.1.0
```

It authenticates with the `PYPI_API_TOKEN` repo secret (Settings → Secrets and
variables → Actions). You can also trigger it manually from the Actions tab. To
build/upload locally instead:

```bash
cd services/mcp-server
python -m build && python -m twine upload dist/*   # TWINE_PASSWORD=pypi-…
```

> The canonical install is the PyPI package — `uvx dawo-mcp-server` (see §2) — once
> published. The `uvx --from git+https://github.com/…#subdirectory=services/mcp-server`
> form only works for callers who can access the repo, so it's a dev convenience,
> not the public install path.
