Skip to content

Feat/mcp - #75

Merged
ccruzkauppila merged 8 commits into
ilmo-hackathon-consolidationfrom
feat/mcp
Nov 20, 2026
Merged

ccruzkauppila merged 8 commits into
ilmo-hackathon-consolidationfrom
feat/mcp

Conversation

@Henrisal

Copy link
Copy Markdown
Contributor

Summary

  • Adds /mcp, an OAuth-protected MCP server (Streamable HTTP) with three tools: list_events, get_event, register_to_event. Users sign in with their Prodeko account through Keycloak (new public client ilmo-mcp); each verified access token maps to an app_private.sessions row of kind mcp, so RLS, ownership triggers and the existing GraphQL plugins behave exactly as on the web.
  • register_to_event validates answers before claiming a spot and rolls the claim back if registration fails.
  • Rate limiting of claimRegistrationToken is now per user for signed-in requests (per IP for anonymous ones), so MCP users behind Anthropic's IPs don't share one limit and a fresh SSO session can't reset it.
  • Adds a local dev Keycloak (docker compose --profile keycloak up -d, realm ilmo-dev, users dev-member / dev-admin).

Henrisal and others added 3 commits October 17, 2026 12:05
Users behind a shared IP (an MCP client, the same wifi) no longer share one
limit, and a fresh SSO session cannot reset it. Anonymous requests are still
limited by IP. The worker now receives the exact key to delete so the key
format lives in one place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/mcp is an OAuth-protected Streamable HTTP endpoint. MCP clients sign in with
Prodeko accounts against Keycloak (client ilmo-mcp); each verified access token
maps to an app_private.sessions row of kind mcp, so RLS, ownership and the
existing GraphQL plugins apply exactly as on the web. Tools: list_events,
get_event and register_to_event, which validates answers before claiming a
spot and rolls the claim back if registration fails.

A dev realm with both clients is available via
`docker compose --profile keycloak up -d`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e tokens

Users imported with an explicit realmRoles list do not receive
default-roles-ilmo-dev, which carries offline_access; Claude Code requests that
scope and the code exchange was refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for @app/client

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 266.29 KB (🟡 +284 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Twenty-six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (450 KB)
/ 344.42 KB 610.71 KB 135.71% (🟡 +0.04%)
/404 221.86 KB 488.15 KB 108.48% (🟡 +0.04%)
/_error 226.77 KB 493.06 KB 109.57% (🟡 +0.04%)
/admin/emails 250.85 KB 517.14 KB 114.92% (🟡 +0.04%)
/admin/event-category/create 282.83 KB 549.12 KB 122.03% (🟡 +0.03%)
/admin/event-category/list 334.46 KB 600.75 KB 133.50% (🟡 +0.04%)
/admin/event-category/update/[id] 283.01 KB 549.3 KB 122.07% (🟡 +0.03%)
/admin/event/create 521.36 KB 787.64 KB 175.03% (🟡 +0.04%)
/admin/event/list 342.37 KB 608.66 KB 135.26% (🟡 +0.03%)
/admin/event/update/[id] 521.81 KB 788.1 KB 175.13% (🟡 +0.04%)
/admin/organization/[slug] 310.89 KB 577.18 KB 128.26% (🟡 +0.04%)
/admin/organization/create 259.7 KB 525.99 KB 116.89% (🟡 +0.03%)
/admin/users/list 334.75 KB 601.04 KB 133.56% (🟡 +0.04%)
/event/[slug] 367.18 KB 633.46 KB 140.77% (🟡 +0.04%)
/event/[slug]/register/[quotaId] 287.55 KB 553.84 KB 123.08% (🟡 +0.03%)
/forgot 239.61 KB 505.9 KB 112.42% (🟡 +0.04%)
/invitations/accept 223.41 KB 489.7 KB 108.82% (🟡 +0.04%)
/login 253.28 KB 519.57 KB 115.46% (🟡 +0.03%)
/reset 245.77 KB 512.06 KB 113.79% (🟡 +0.04%)
/settings/accounts 308.91 KB 575.2 KB 127.82% (🟡 +0.04%)
/settings/delete 243.37 KB 509.66 KB 113.26% (🟡 +0.03%)
/settings/emails 286.99 KB 553.28 KB 122.95% (🟡 +0.04%)
/settings/profile 248.91 KB 515.2 KB 114.49% (🟡 +0.03%)
/settings/security 255.67 KB 521.96 KB 115.99% (🟡 +0.04%)
/update-registration/[updateToken] 248.73 KB 515.02 KB 114.45% (🟡 +0.03%)
/verify 222.34 KB 488.63 KB 108.58% (🟡 +0.04%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Henrisal and others added 3 commits October 17, 2026 13:41
The server is stateless, so there is no standalone SSE stream or session to
delete. Passing GET to the transport left the request hanging without a status
line, which claude.ai surfaced as an unexpected error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A broken audience or issuer check would silently accept tokens issued to any
other client in the realm, which manual testing with valid tokens cannot see.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for @app/client

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 266.29 KB (🟡 +284 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Twenty-six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (450 KB)
/ 344.42 KB 610.71 KB 135.71% (🟡 +0.04%)
/404 221.86 KB 488.15 KB 108.48% (🟡 +0.04%)
/_error 226.77 KB 493.06 KB 109.57% (🟡 +0.04%)
/admin/emails 250.85 KB 517.14 KB 114.92% (🟡 +0.04%)
/admin/event-category/create 282.83 KB 549.12 KB 122.03% (🟡 +0.03%)
/admin/event-category/list 334.46 KB 600.75 KB 133.50% (🟡 +0.04%)
/admin/event-category/update/[id] 283.01 KB 549.3 KB 122.07% (🟡 +0.03%)
/admin/event/create 521.36 KB 787.64 KB 175.03% (🟡 +0.04%)
/admin/event/list 342.37 KB 608.66 KB 135.26% (🟡 +0.03%)
/admin/event/update/[id] 521.81 KB 788.1 KB 175.13% (🟡 +0.04%)
/admin/organization/[slug] 310.89 KB 577.18 KB 128.26% (🟡 +0.04%)
/admin/organization/create 259.7 KB 525.99 KB 116.89% (🟡 +0.03%)
/admin/users/list 334.75 KB 601.04 KB 133.56% (🟡 +0.04%)
/event/[slug] 367.18 KB 633.46 KB 140.77% (🟡 +0.04%)
/event/[slug]/register/[quotaId] 287.55 KB 553.84 KB 123.08% (🟡 +0.03%)
/forgot 239.61 KB 505.9 KB 112.42% (🟡 +0.04%)
/invitations/accept 223.41 KB 489.7 KB 108.82% (🟡 +0.04%)
/login 253.28 KB 519.57 KB 115.46% (🟡 +0.03%)
/reset 245.77 KB 512.06 KB 113.79% (🟡 +0.04%)
/settings/accounts 308.91 KB 575.2 KB 127.82% (🟡 +0.04%)
/settings/delete 243.37 KB 509.66 KB 113.26% (🟡 +0.03%)
/settings/emails 286.99 KB 553.28 KB 122.95% (🟡 +0.04%)
/settings/profile 248.91 KB 515.2 KB 114.49% (🟡 +0.03%)
/settings/security 255.67 KB 521.96 KB 115.99% (🟡 +0.04%)
/update-registration/[updateToken] 248.73 KB 515.02 KB 114.45% (🟡 +0.03%)
/verify 222.34 KB 488.63 KB 108.58% (🟡 +0.04%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Henrisal and others added 2 commits October 17, 2026 16:35
Adds list_event_options and create_event, listed and run only when the access
token carries the ilmo-admin realm role, so revoking the role in Keycloak
applies on the next request; the database's is_admin check still applies.
Events are always created as drafts for an admin to review and publish in the
admin UI. MCP does not write is_admin, because ilmo-mcp lacks full scope and a
missing role scope mapping would otherwise demote every admin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production applies committed migrations only, so the MCP session columns and
the pending admin organization policy and quota deletion fixes from #67 and
#69 would otherwise never reach it. Every part is idempotent, so a database
that already ran them from current is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for @app/client

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 266.37 KB (🟡 +366 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Twenty-six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (450 KB)
/ 344.45 KB 610.82 KB 135.74% (🟡 +0.04%)
/404 221.89 KB 488.26 KB 108.50% (🟡 +0.05%)
/_error 226.8 KB 493.17 KB 109.59% (🟡 +0.05%)
/admin/emails 250.88 KB 517.25 KB 114.94% (🟡 +0.05%)
/admin/event-category/create 282.86 KB 549.23 KB 122.05% (🟡 +0.04%)
/admin/event-category/list 334.49 KB 600.86 KB 133.52% (🟡 +0.05%)
/admin/event-category/update/[id] 283.04 KB 549.41 KB 122.09% (🟡 +0.04%)
/admin/event/create 521.38 KB 787.75 KB 175.06% (🟡 +0.04%)
/admin/event/list 342.4 KB 608.77 KB 135.28% (🟡 +0.04%)
/admin/event/update/[id] 521.84 KB 788.21 KB 175.16% (🟡 +0.04%)
/admin/organization/[slug] 310.92 KB 577.29 KB 128.29% (🟡 +0.04%)
/admin/organization/create 259.73 KB 526.1 KB 116.91% (🟡 +0.04%)
/admin/users/list 334.78 KB 601.15 KB 133.59% (🟡 +0.04%)
/event/[slug] 367.21 KB 633.58 KB 140.80% (🟡 +0.04%)
/event/[slug]/register/[quotaId] 287.59 KB 553.96 KB 123.10% (🟡 +0.04%)
/forgot 239.64 KB 506.01 KB 112.45% (🟡 +0.04%)
/invitations/accept 223.43 KB 489.8 KB 108.85% (🟡 +0.04%)
/login 253.31 KB 519.68 KB 115.48% (🟡 +0.05%)
/reset 245.8 KB 512.17 KB 113.81% (🟡 +0.05%)
/settings/accounts 308.94 KB 575.31 KB 127.85% (🟡 +0.04%)
/settings/delete 243.41 KB 509.78 KB 113.28% (🟡 +0.05%)
/settings/emails 287.03 KB 553.4 KB 122.98% (🟡 +0.04%)
/settings/profile 248.94 KB 515.31 KB 114.51% (🟡 +0.05%)
/settings/security 255.71 KB 522.08 KB 116.02% (🟡 +0.05%)
/update-registration/[updateToken] 248.76 KB 515.13 KB 114.47% (🟡 +0.04%)
/verify 222.37 KB 488.73 KB 108.61% (🟡 +0.04%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@ccruzkauppila
ccruzkauppila changed the base branch from main to ilmo-hackathon-consolidation November 20, 2026 14:48
@ccruzkauppila
ccruzkauppila merged commit ce1afd7 into ilmo-hackathon-consolidation Nov 20, 2026
14 checks passed
ccruzkauppila added a commit that referenced this pull request Nov 20, 2026
Signed-in requests are limited per user, anonymous ones per IP. Not
behind a feature flag.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156kYgzTdmw7ZBY2vrLwQmA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants