Commit Graph

14 Commits

Author SHA1 Message Date
justin 47cac9b521 Add price_trend / price_series MCP tools (USDA NASS grain)
CI / test (push) Failing after 0s
CI / build-push (push) Has been skipped
Real $/bu price + MoM/YoY change + seasonal percentile context for corn/soy/
wheat, US + states, deep history. Wraps the new /api/data/price-trend and
/api/data/price-series endpoints. Changelog updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 12:02:13 -04:00
justin 7b6661e3d9 Changelog: source geo + many more elevator locations
CI / test (push) Failing after 1s
CI / build-push (push) Has been skipped
Document the per-source geo on /api/data/sources + list_sources, and the new
Heritage Cooperative (23 locations), expanded Mercer Landmark (16, with two
source renames), and Bambauer Pemberton sources.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 11:15:59 -04:00
justin ffc705f485 Show source location (city/state/zip) in list_sources output
CI / test (push) Successful in 17s
CI / build-push (push) Successful in 5s
/api/data/sources now returns per-source geo; surface it as a Location column
in the sources table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 11:07:34 -04:00
justin a3b77414d8 CI: use REGISTRY_TOKEN secret for registry login
CI / test (push) Successful in 16s
CI / build-push (push) Successful in 24s
The auto Actions token can't push packages in this Gitea; use a PAT secret.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 18:00:29 -04:00
justin 0d7e61f65f CI: install into a venv (runner Python is PEP 668 managed)
CI / test (push) Successful in 17s
CI / build-push (push) Failing after 3s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 17:57:34 -04:00
justin dfbc77160e Add Gitea Actions CI: test + build/push image on main
CI / test (push) Failing after 4s
CI / build-push (push) Has been skipped
Tests on every push/PR; on main, builds and pushes
git.jpaul.io/justin/ag-bids-mcp:{latest,sha} to the Gitea registry. The .0.2
act_runner has the host docker.sock mounted, so plain docker build/push work.
Watchtower on .0.2 then auto-deploys :latest within ~5 min.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 17:55:38 -04:00
justin 2e67a0fce2 Document new tools in README
Add futures_quote, basis_movement, basis_detail to the tools table, mark
price_history/latest_prices filters optional, list the /futures endpoint, and
point to CHANGELOG.md for per-release detail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 15:49:19 -04:00
justin d0fada5985 Label image with org.opencontainers.image.source for Gitea repo linking
Gitea attaches a container package to its repo via this OCI label; without it
the pushed image shows up unlinked under the user's packages instead of the
ag-bids-mcp repo's Packages tab.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 15:46:32 -04:00
justin 0c9bc3b328 Add futures_quote tool: CBOT price + change since open + on day
New futures_quote(commodity, delivery?) tool wraps the new /api/data/futures
endpoint: reports latest price, today's session open, prior settle, and both
moves (since open and on the day). With a delivery month it resolves the listed
contract; without it, the continuous nearby. Adds client.futures(), fmt_futures(),
tests, and a CHANGELOG entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 15:36:56 -04:00
justin 61c1736539 Add CHANGELOG for upstream tool consumers
Document the new basis_movement/basis_detail tools, the flexible price_history
and latest_prices signatures, and the /api/data/history commodity-optional
change, with example question→call mappings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 15:26:18 -04:00
justin 3340747600 Add basis_movement/basis_detail tools; make history + latest fully filterable
New MCP tools:
- basis_movement: aggregated basis trend, one headline line per crop. The cheap
  "how is basis moving overall" view; optional commodity/source/delivery/days.
- basis_detail: per-(elevator, crop, delivery) basis first→last drill-down.

Both do the aggregation MCP-side and return compact markdown to keep token
burn low, so a client can call the cheap aggregate first and drill in only when
needed.

Flexibility/parity changes:
- price_history: commodity is now optional (spans all crops); groups by
  (source, commodity, delivery); surfaces basis first→last in the summary and
  adds a futures column to the raw table.
- latest_prices: expose the `kind` filter (grain/fertilizer) that the API and
  client already supported.
- client.history(): commodity optional.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 15:25:39 -04:00
justin e78733d55e Drop in-container auth — MetaMCP guards the user-facing edge
The MCP's port 8000 isn't exposed outside the private mcp-servers_mcp
Docker network, so only the MetaMCP gateway can ever reach it. MetaMCP
itself enforces auth at the gateway → MCP-client edge (bearer token in
its UI), which is the right layer for it. In-container Basic/Bearer was
defense-in-depth that turned out to be friction-in-depth.

Removed:
  - ag_bids_mcp/auth.py (HTTP Basic middleware)
  - tests/test_auth.py (3 tests covering the middleware)
  - AG_BIDS_MCP_USER / AG_BIDS_MCP_PASS env vars from .env.example, README,
    docker-compose.snippet.yml, and deploy/README.md

Server.py simplified — direct `mcp.run(transport=...)` like zerto-docs-mcp,
no Starlette wrapping. 21 tests passing.

Live on 192.168.0.2: container recreated, real MCP initialize handshake
returns 200 + capability metadata over the mcp-servers_mcp network with
no auth header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 16:05:41 -04:00
justin 8aa4cc0ef3 Make ag-bids-mcp a standalone compose project on .0.2
Reflect the deploy decision: ag-bids-mcp lives in its own
~/ag-bids-mcp/ folder on 192.168.0.2 (NOT inside zerto-docs-rag's
compose). It joins the existing mcp-servers_mcp Docker network as
external so MetaMCP can still reach it at http://ag-bids-mcp:8000/mcp.

Updated:
- deploy/docker-compose.snippet.yml — now a self-contained compose
  project file with `networks.mcp.external: true; name: mcp-servers_mcp`
- deploy/README.md — full runbook for the standalone-folder deploy,
  smoke-test commands that match the actual network name, and a
  base64-encoded Authorization-header recipe for testing without
  fighting curl's -u quoting

Verified live: container on .0.2 returns 401 anonymous and 200 with
real MCP initialize handshake from inside mcp-servers_mcp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 15:59:33 -04:00
justin 875a190983 Initial commit: ag-bids MCP server
Exposes live + historical ag-bids commodity data (from the ag-monitor
service at agbids.paul.farm) as MCP tools, sitting behind MetaMCP at
https://mcp.jpaul.io/metamcp/ag-bids/mcp.

Pattern mirrors zerto-docs-rag with one addition: HTTP Basic auth in
front of the streamable-HTTP transport so namespace guessers can't reach
the tools. Stdio transport is unaffected (used by local Claude Desktop
dev).

Tools (markdown returns, ~15 LOC each):
  best_local_bid(commodity)       — where to sell corn/soy/wheat today,
                                    for the current calendar month only
  current_lime_price()            — latest lime quotes ($/ton)
  current_input_price(product?)   — MAP / Potash / Lime
  latest_prices(...)              — filtered snapshot
  price_history(...)              — per-(source,delivery) trend
  list_sources / list_commodities / list_deliveries
  source_health()                 — healthy / stale / down buckets
  todays_summary()                — same shape as morning brief snapshot

Data path: ag-bids-mcp -> X-API-Key -> /api/data/* on ag-monitor
(reuses BRIEF_API_KEY).

Tests: 24 covering the httpx client, markdown formatters, HTTP Basic
middleware (401/200), and JSONL usage logging.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 11:37:46 -04:00