Files
familiar/README.md
T
Latte df9e06a3e7
CI / lint (pull_request) Successful in 55s
docker / lint (pull_request) Successful in 56s
CI / test (pull_request) Successful in 1m6s
docker / test (pull_request) Successful in 1m4s
CI / publish (pull_request) Has been skipped
docker / docker (pull_request) Failing after 1m11s
docs: deployment guide + per-client setup + connect matrix
- doc/deployment.md: run familiar as a remote MCP server — secure defaults,
  bearer vs OAuth modes, the full env-var reference, one-time login / token-store
  provisioning, the published images, docker compose, and TLS reverse-proxy
  blocks for nginx (proxy_buffering off + long read timeout), Caddy, and Traefik.
- doc/clients/: one page per client with exact working steps — Claude Code,
  VS Code (.vscode/mcp.json with a masked token input, and the workspace
  .mcp.json header gotcha), Mistral Le Chat, Claude Desktop + Cowork (mcp-remote
  bridge, per-OS config paths), and Claude web (oauth mode + external IdP, with
  "use Desktop + bearer" as the simpler alternative). Plus a clients/ index.
- README: a "Connect a client" matrix (client -> auth -> guide) and a compact
  "Deploy with Docker" section linking to doc/deployment.md; oauth mode noted.
- doc/README.md index: rows for Deployment and Client setup.
- doc/getting-started.md: pointer from the HTTPS quickstart to the full docs.
- CLAUDE.md: FAMILIAR_AUTH_MODE / FAMILIAR_OAUTH_* / FAMILIAR_ALLOW_INSECURE_BIND
  and /healthz in the transport note; the split ci.yml / docker.yml workflows.

Deployment docs live under the existing doc/ tree (the repo uses doc/, not a
separate docs/) to keep a single documentation directory.
2026-07-04 19:26:33 +02:00

159 lines
9.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# familiar
> Your familiar across New Eden — an EVE Online MCP server that lets a local AI see your whole account and the universe, and act on your behalf when you ask.
In EVE, your familiar isn't a cat on the windowsill. It's the companion that rides along through New Eden, sees what you see, remembers what you can't, and fetches — or does — whatever you ask. `familiar` is exactly that: an [MCP](https://modelcontextprotocol.io) server that gives a local AI (Claude Code, Claude Desktop, Cowork) a complete window into your EVE Online account and the entire game universe, plus hands to act on it.
Ask your familiar where your assets are, what your skill queue looks like, what Tritanium sells for in Jita, the safest route to a lowsec system, or whether a fit is worth building — and have it set a waypoint or draft a mail when you say so. It looks, it finds, it reports back, and it acts when asked.
## Principles
- **Safe by default.** Reading is free; every *write* — sending mail, setting waypoints, editing contacts/fittings/PI, fleet commands — is previewed before it runs (nothing happens without `confirm=true`) and recorded in an audit log. Writes are on by default but can be turned off entirely with `familiar writes disable`. The AI can see everything and changes nothing without your explicit confirm.
- **Local-first.** Runs on your own machine. Your refresh token and account data never leave your control.
- **Everything, eventually.** The goal is full coverage: the ESI scopes you grant (character *and* corp, read and write), plus the complete static universe. Built in phases so it actually ships.
## How it works
Two data sources sit behind the server:
- **ESI** (the [EVE Swagger Interface](https://esi.evetech.net/)) — the official REST API. Public endpoints (market, universe, industry indices) need no login. Character and corp data (wallet, assets, skills, industry, contracts, mail, location, and more) come through EVE SSO with **read and write OAuth2 scopes** across both character and corp; write scopes power the opt-in actions.
- **SDE** (the [Static Data Export](https://developers.eveonline.com/resource/resources)) — the full static dataset of items, blueprints, systems and stations, cached locally for fast lookups and anything name- or recipe-based.
Built in **Python with FastMCP**, OAuth via PKCE with a localhost callback, refresh token stored encrypted on disk. ESI `Expires` headers are respected for caching, the rolling ESI error limit is honored with back-off, and (eventually) the SDE is loaded into a local store.
## Setup
Requires [uv](https://docs.astral.sh/uv/).
```bash
uv sync # install
uv run familiar login # browser EVE SSO login; run once per character
uv run familiar status # list logged-in characters
```
Re-run `login` for each character (switch EVE accounts in the browser as needed); they all live in one encrypted store. Changing the requested scopes requires logging in again.
### Offline SDE (optional)
For network-free item / system / station lookups, install a local copy of EVE's Static Data Export (the Fuzzwork SQLite conversion):
```bash
uv run familiar sde download # download + decompress the SDE (a few hundred MB)
uv run familiar sde status # show whether it's installed and where
```
Once present, `get_item` / `get_system` / `get_station` serve from it without hitting ESI; familiar falls back to ESI whenever the SDE is absent or doesn't know the id.
### Connect to Claude
Claude Code:
```bash
claude mcp add familiar -- uv --directory /path/to/familiar run familiar
```
Claude Desktop — add this to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"familiar": {
"command": "uv",
"args": ["--directory", "/path/to/familiar", "run", "familiar"]
}
}
}
```
Then ask in natural language — "what's Tritanium worth in Jita?", "how much ISK across all my characters?", "where are my characters?".
### Write actions
Write actions (send mail, set waypoints, edit contacts/fittings, fleet commands) are **on by default**. Even so, every write tool returns a dry-run preview unless called with `confirm=true` per call, and each executed write is recorded in an audit log — so nothing changes by accident.
To opt out and block all writes globally:
```bash
uv run familiar writes disable # turn writes off (uv run familiar writes enable to re-allow)
```
## Serve over HTTPS (remote MCP)
By default familiar talks over **stdio** — the local transport Claude launches. To reach it from a remote MCP client (for example a [chat.mistral.ai](https://chat.mistral.ai) custom connector), run the opt-in **streamable-HTTP** transport instead:
```bash
FAMILIAR_HTTP_TOKEN=$(openssl rand -hex 32) uv run familiar serve
```
`familiar serve` binds `127.0.0.1:8080/mcp` and expects a TLS-terminating reverse proxy in front of it. It **refuses to start without `FAMILIAR_HTTP_TOKEN`** — an internet-reachable account window must never run unauthenticated. Requests without a valid `Authorization: Bearer <token>` get `401` with a `WWW-Authenticate: Bearer` header; a valid token lets the MCP handshake through. stdio (`familiar` with no args) is unchanged and never token-gated.
Environment variables:
| Variable | Default | Meaning |
| --- | --- | --- |
| `FAMILIAR_HTTP_TOKEN` | *(required)* | Bearer token the client must send. No default — serve refuses to start without it. |
| `FAMILIAR_HTTP_HOST` | `127.0.0.1` | Bind address. Leave loopback and let the proxy face the internet. |
| `FAMILIAR_HTTP_PORT` | `8080` | Bind port. |
| `FAMILIAR_HTTP_PATH` | `/mcp` | MCP endpoint path. |
| `FAMILIAR_ENABLE_WRITES` | *(unset)* | In HTTP mode **writes default off**; set to `1`/`true` to opt in. |
**Writes are disabled by default over HTTP** — a network-reachable, LLM-driven endpoint should not send mail or set waypoints unless you explicitly opt in with `FAMILIAR_ENABLE_WRITES=1`. (Over stdio they stay on by default, as before.)
By default familiar authenticates with a static bearer token (`FAMILIAR_AUTH_MODE=bearer`). For clients that only speak OAuth (the claude.ai web connector), there's an opt-in `oauth` mode where familiar acts as an OAuth 2.1 resource server in front of your own IdP — see [claude-web](doc/clients/claude-web.md).
### Deploy with Docker
CI builds and publishes a hardened image on every merge to `dev`/`main` (`git.hiddenden.cafe/hiddenden/familiar`, tags `:dev`, `:main`/`:latest`). It runs `familiar serve` non-root on port `8080`, has a `/healthz` healthcheck, and keeps the encrypted token store under a `/data` volume. A [`docker-compose.yml`](docker-compose.yml) + [`.env.example`](.env.example) are included.
**Full guide — Docker, reverse proxy (nginx / Caddy / Traefik), TLS, token provisioning, and the env-var reference — is in [doc/deployment.md](doc/deployment.md).**
### Connect a client
Pick your client for exact steps:
| Client | Auth | Guide |
| --- | --- | --- |
| Claude Code | Bearer | [doc/clients/claude-code.md](doc/clients/claude-code.md) |
| VS Code (Copilot) | Bearer | [doc/clients/vscode.md](doc/clients/vscode.md) |
| Mistral Le Chat | Bearer | [doc/clients/mistral.md](doc/clients/mistral.md) |
| Claude Desktop | Bearer (via `mcp-remote`) | [doc/clients/claude-desktop.md](doc/clients/claude-desktop.md) |
| Claude Cowork | Bearer (via `mcp-remote`) | [doc/clients/claude-cowork.md](doc/clients/claude-cowork.md) |
| Claude web (claude.ai) | OAuth 2.1 (external IdP) | [doc/clients/claude-web.md](doc/clients/claude-web.md) |
Bearer works everywhere except the claude.ai web connector, which requires OAuth with Dynamic Client Registration. The quickest path for a Claude user who doesn't want to run an IdP is the **Desktop** app with a bearer token.
## Roadmap
Built in phases. Each phase is independently useful, so the project stays shippable.
**Phase 0 — Skeleton**
- Repo, project scaffold, FastMCP server that starts and exposes a health/ping tool.
- App registered on [developers.eveonline.com](https://developers.eveonline.com/).
**Phase 1 — Public lookups (no auth)**
- Market: prices and order book for any item in any hub, spreads between hubs.
- Universe via SDE: items, systems, stations, security, basic route/jumps.
- Quick win: useful before any OAuth complexity exists.
**Phase 2 — Account read (OAuth)**
- EVE SSO login flow, encrypted refresh token storage.
- Wallet, assets (search across characters), skills + skill queue, current location and clones.
**Phase 3 — Industry & contracts**
- Industry jobs, blueprints (SDE-backed), manufacturing cost/profit lookups.
- Personal and corp contracts, market orders.
**Phase 4 — Everything else**
- Mail, planetary interaction, loyalty points, fittings, corp roles.
- zKillboard integration for kill/PvP data.
**Phase 5 — Polish**
- Caching, error-limit safety, packaging, setup docs. Optional: prep a public, generic single-user release as a portfolio case.
## Status
Phases 0–4 done on `dev`, plus Phase 5 caching/back-off and docs: public market & universe lookups; EVE SSO (PKCE) login with an encrypted, multi-character token store; full character **and** corp coverage across skills, wallet, assets, industry, trade, structures, killmails, profile, fleet, mail, contacts, fittings, PI and more; and opt-in, audited write actions. ~80 tools. Remaining: the full SDE bulk-load. `main` stays untouched until the first complete version is ready.
## License
MIT