Engineering case study · November 2026

Designing a secure AI front door for Klubfunder.

What happens when an established SaaS platform becomes accessible through a conversation? I built an MCP spike to find out, with OpenIddict handling OAuth and the existing application retaining control of its business rules.

Engineering spike, not a public product launchASP.NET Core · MCP · OpenIddict · ChatGPT

Could a club administrator describe a task instead of navigating to it?

Klubfunder already supports many different club workflows: fundraising, membership, payments, ticketing and more. It has a web interface and an established backend. The experiment was not about replacing that product with a chatbot. It was about adding another way to reach the same capabilities.

For example, an administrator might want to find current fundraisers or start setting up a new one. Could a ChatGPT app turn that intention into a well-defined request without creating a parallel application, weakening permissions or giving a language model direct access to data?

That last question became the architectural constraint: the model may suggest an action, but the platform must decide whether the action is permitted.

An extra interface, not an extra backend.

The MCP endpoint is a thin, intentional boundary over existing services. It offers a small set of task-oriented tools and delegates the actual work to Klubfunder's application layer.

From user intent to an authorised operationConceptual architecture of the spike
  1. 01 · ClientChatGPT appUnderstands the request and chooses an available tool
  2. 02 · ProtocolMCP endpoint/mcpValidates the caller and exposes a deliberate tool surface
  3. 03 · DomainKlubfunder servicesResolves the club context and applies application rules
  4. 04 · DataExisting platformUses the same club, campaign and payment records
Identity & accessOpenIddict + OAuth authorization code with PKCEScoped tokens at the MCP boundary; user and tenant permissions still matter inside the platform.

Keeping the tool layer small was deliberate. MCP provides a standard way for a client to discover and invoke capabilities. It should not become a second domain model, a direct database gateway or a shortcut around existing service validation.

Being connected is not the same as being allowed.

Klubfunder already has authenticated users and club-specific permissions. For an external assistant, I needed a proper delegated connection rather than a shared API key or a blanket grant to everything.

I used OpenIddict to support the OAuth authorization-code flow with PKCE S256. The remote MCP endpoint lives at /mcp. During integration testing, an unauthenticated request produced an HTTP 401 challenge, the protected-resource metadata was discoverable, and the client could locate the authorization server. Matching the issuer and discovery metadata mattered as much as implementing the tools themselves.

The spike defined three deliberately narrow scopes:

club.read
Club contextPermit read-oriented access to relevant club information.
campaigns.read
Campaign visibilityPermit retrieval of fundraising and campaign information.
raffle.write
Controlled creationA write-capable scope used to explore draft fundraising operations, not unrestricted publishing.

A scope describes what category of action a client may request. It does not prove that a particular user is an administrator of a particular club. Those checks belong to the application and must be applied on every relevant operation.

Expose intentions, not internal endpoints.

A useful tool should represent a job someone wants to finish, rather than mirror an entire controller or database table. In this experiment I focused on reading club and campaign context and exploring draft creation. The principle was to expose enough capability to test the interaction model, without exposing the whole product.

The most useful workflow was creating a draft fundraiser. I tested examples such as a golf day and a dinner dance from ChatGPT. Draft-first design lets the system prepare useful structured work while leaving consequential steps, such as publishing or accepting payments, outside the experimental tool surface.

01

Read before write

Start with bounded data retrieval and learn how the assistant chooses between tools.

02

Draft before publish

Let an operator review and correct generated details before a public-facing change.

03

Keep rules in one place

Return through the same application services and permission model used by the existing product.

Making the protocol useful to a real client.

I connected the remote MCP service to ChatGPT as a private app for testing. This was a practical test of the full concept, not just an endpoint that worked in isolation.

It exposed a second layer of engineering work: OAuth discovery, compatible client registration, consent and getting a hosted assistant to recognise the tools. There was some friction around ChatGPT developer-mode registration and the distinction between having an MCP service and having it available as an app. The platform and account capabilities also limited how widely I could test it.

The useful outcome was being able to exercise the workflow through ChatGPT and see how an intent-oriented interface could sit in front of an established SaaS platform. It did not establish that a customer-facing integration was ready for general release.

A working spike is not a production security assessment.

Before opening this approach to clubs at scale, I would want explicit evidence for the protections that matter when an assistant can act on someone's behalf:

  • Tenant isolation: verify that a user and token can access only the club resources they are authorised to use, irrespective of tool parameters.
  • Token validation: check intended resource or audience, issuer, expiry, granted scopes and the lifecycle of delegated access.
  • Write safety: apply validation, audit trails, idempotency where appropriate and explicit confirmation for irreversible actions.
  • Operational behaviour: handle errors, retries, revocation, privacy and observability without leaking sensitive data into tool responses.

These are production design and verification requirements, not a claim that every one was fully implemented in the prototype.

The interface changes. The responsibilities don't.

I don't see MCP as a replacement for well-designed software or for the workflows people already understand. It is a new interface to useful capabilities. Its value comes from letting people express a goal more naturally while the system behind it remains predictable, permissioned and accountable.

For me, the most interesting part of the spike wasn't the model or the protocol. It was the engineering boundary between what an assistant can ask and what the application will allow.

That is where agent-accessible SaaS starts to become a credible product design, rather than just another demo.