feat: remote MCP @ AWS — HTTP-transport, read-only, health, kontti, paikkatietotyökalut#145
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…§5.3) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remote MCP:n pohja. `aura serve --http` ajaa FastMCP:n streamable HTTP -transportilla (polku /mcp, stateless), `aura serve` säilyy stdiona. - aura/serve.py: resolve_serve_config() eristää transport-päätöslogiikan (host/portti argumenteista tai AURA_HTTP_HOST/PORT-envistä) blokkaavasta mcp.run()-kutsusta → yksikkötestattavissa - cli.py: serve saa --http/--host/--port-liput - testit: yksikkö (config + CLI-wiring) + integraatio (server käynnistyy ja vastaa list_tools-kutsuun HTTP:n yli) Osa epicistä #133. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AURA_READONLY=1 → kirjoittavat toolit eivät näy ja kanta avataan vain luettavaksi. - aura/config.py: is_readonly() — yksi paikka moodille (env-ohjaus) - database.get_connection(readonly=True): mode=ro URI, ei WAL-pragmaa/mkdiriä → estää kirjoitukset SQLite-tasolla - server.py: WRITE_TOOL_NAMES + apply_readonly_gating() poistaa kirjoittavat toolit (harvest, probe_sizes, enrich, batch_enrich, save_session_findings, populate_reference); lifespan avaa RO-yhteyden ja ohittaa init_db:n readonlyssa - cli.py: serve-handler kutsuu apply_readonly_gating ennen mcp.run - testit: is_readonly, RO-SQLite, gating-funktio, + integraatio (subprocess AURA_READONLY=1 → write-toolit puuttuvat, search/stats toimivat) Osa epicistä #133. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GET /health → 200 + {status, datasets} (kevyt DB-tarkistus). Readonly-tietoinen
yhteys (mode=ro remotessa). FastMCP custom_route HTTP-transportin alla.
- server.py: health_payload(conn) + @mcp.custom_route("/health")
- testit: yksikkö (health_payload) + integraatio (GET /health HTTP:n yli → 200)
Osa epicistä #133.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
python:3.11-slim, editable-asennus (pitää DEFAULT_DB_PATH = /app/data/aura.db),
vain data/aura.db (ei boundaries-gpkg:itä), non-root, AURA_READONLY=1 oletuksena,
CMD aura serve --http --host 0.0.0.0 --port 8000.
Verifioitu buildaamalla ja ajamalla: /health → 200 {status:ok,datasets:11220},
MCP /mcp → 27 toolia, write-toolit gateattu pois. Content size 119 MB (< 250 MB).
Osa epicistä #133.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Read-only MCP-toolit jotka palvelevat ref_map_sheets-taulusta (bbox EPSG:3067 jo kannassa) → toimivat remotessa. Agentti voi rajata WFS/WCS/OGC-kyselyt alueelle. - map_sheet(id): karttalehden bbox + centroid + mittakaava, valmis WFS-bbox:ksi - find_map_sheets(scale, bbox|point|prefix): osuvat lehdet (leikkaavuus/sisältyvyys/ hierarkkinen prefiksi) - uusi tools/spatial.py, rekisteröity tools/__init__.py:hyn, re-export server.py:stä - 7 testiä (bbox-haku, piste, prefiksi, case-insensitive, validointi) Osa #136 (municipality_bbox seuraavaksi). Osa epicistä #133. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Viimeistelee #136: kunnan bbox aluerajaukseen, ketjutettavissa find_map_sheets:iin. - migraatio 017: bbox-sarakkeet (min_x/min_y/max_x/max_y) ref_municipalities-tauluun - populators/municipality_bbox.py: lukee kuntajako_1000k.gpkg:n Kunta-tason envelope-bbox:t (uudelleenkäyttää map_sheetsin GPKG-parseria), päivittää ref_municipalities natcode=code-avaimella (ei-destruktiivinen) - spatial.py: municipality_bbox(name|code) -tool - data/aura.db: populoitu 308/308 kunnan bbox (Helsinki todennettu, EPSG:3067) - 6 testiä (tool: nimi/koodi/puuttuva/tuntematon; populaattori: täsmäys/zfill) Osa epicistä #133. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remote MCP @ AWS — sovelluspuoli + paketointi
Toteuttaa epicin #133 ensimmäiset 5 issueta. Aura on nyt remote-valmis: streamable HTTP, read-only-gateys, health-endpoint, kontti ja paikkatietotyökalut. Kaikki TDD:llä.
Mukana
aura serve --http— FastMCP streamable HTTP (/mcp, stateless); stdio säilyy oletuksena.AURA_READONLY=1) — kirjoittavat toolit eivät rekisteröidy, SQLitemode=ro./health-endpoint — 200 + datasettien määrä (App Runner health check).python:3.11-slim, vainaura.db, non-root, content size 119 MB; build + kontti-smoke todennettu.map_sheet,find_map_sheets(kannasta),municipality_bbox(migraatio 017 + populaattori, 308/308 kuntaa populoitu).Suunnitelma
docs/superpowers/specs/2026-06-06-aws-remote-mcp-design.md(mukana tässä PR:ssä).Testaus
872 passed, 0 failed (55 deselattu = ennestään failaavat päivämäärätestit). ruff puhdas; mypy puhdas uusille tiedostoille (2 ennestään olevaa virhettä quality.py:ssä).
Closes #134
Closes #135
Closes #136
Closes #138
Closes #139
🤖 Generated with Claude Code