Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beyond Prompts: Building Intelligent Applicatio...

Beyond Prompts: Building Intelligent Applications with Genkit and the Model Context Protocol

LLMs have democratized AI, making it more accessible for everyone. But today’s chat bots still feel very disconnected. Wouldn’t it be great if you could use AI to tap into your personal knowledge and data, and use it to drive the tools you already know and love? Imagine using a chat bot to create your next pitch deck, or generating bespoke 3D scenes for your next home decoration project using inexpensive tools like Blender. In this talk, I'll show you how this is possible with the Model Context Protocol (MCP)

You will learn:
* How you can leverage MCP to allow LLMs to interact with existing apps and systems
* How to architect intelligent applications that orchestrate complex tasks by connecting to and reusing your existing APIs, data sources, and specialised tools.

I will even demo an agentic app built using MCP, Swift, and Keynote that you can use to craft presentation decks using just natural language - including doing the research!

Avatar for Peter Friese

Peter Friese

November 05, 2025
Tweet

More Decks by Peter Friese

Other Decks in Technology

Transcript

  1. @peterfriese.dev Created by Mamank from Noun Project https: / /

    peterfriese.dev peterfriese peterfriese Peter Friese, Staff Developer Relations Engineer, Google Beyond Prompts Building Intelligent Applications with Genkit and the Model Context Protocol
  2. L L M Give me the top three sights in

    Amsterdam. Be concise. 1. Elbphilharmonie Speicherstadt 3. Miniatur Wunderland 􀉩
  3. Will my flight be on time? I can't access real-time

    flight information or personal travel details. To check your flight status, please provide me with the airline and flight number, and I will search for the latest updates. L L M 􀉩
  4. I’m travelling to a place in the UK next week.

    Who’s the author of the thriller that plays there that I read recently? That's an interesting question, but I need a little more information to help you! The UK is home to countless thrillers set in various locations. L L M 􀉩
  5. L L M Enterprise data (e.g. product catalog) User data

    (e.g. personal kno w l edge) Created by iconfield from Noun Project APIs Apps
  6. L L M Enterprise data (e.g. product catalog) User data

    (e.g. personal kno w l edge) Created by iconfield from Noun Project APIs Apps Retrieval Augmented Generation (RAG) Tool calling
  7. L L M Enterprise data (product catalog) User data (personal

    kno w l edge) Retrieval Index Augmented Generation Prompt Query Response
  8. L L M Query Will my flight be on time?

    Flight Data 􀷰 Calendar 􀉉 T i m e 􀐫 ?
  9. L L M Query Will my flight be on time?

    Flight Data 􀷰 Calendar 􀉉 T i m e 􀐫 ?
  10. L L M Query Will my flight be on time?

    Flight Data 􀷰 Calendar 􀉉 T i m e 􀐫 ? Tool calling
  11. im port { genkit } from 'genkit'; im port {

    googleAI } from '@ genkit-ai/google-genai'; const ai = genkit({ plugins: [googleAI()], model: googleAI . m odel('ge m i ni-2.5-flash'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); A quick overview of Genkit Import Genkit
  12. im port { genkit } from 'genkit'; im port {

    googleAI } from '@ genkit-ai/google-genai'; const ai = genkit({ plugins: [googleAI()], model: googleAI . m odel('ge m i ni-2.5-flash'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); A quick overview of Genkit Set up Genkit
  13. im port { genkit } from 'genkit'; im port {

    googleAI } from '@ genkit-ai/google-genai'; const ai = genkit({ plugins: [googleAI()], model: googleAI . m odel('ge m i ni-2.5-flash'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); A quick overview of Genkit Configure model
  14. im port { genkit } from 'genkit'; im port {

    googleAI } from '@ genkit-ai/google-genai'; const ai = genkit({ plugins: [googleAI()], model: googleAI . m odel('ge m i ni-2.5-flash'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); A quick overview of Genkit Call the model
  15. im port { genkit } from 'genkit'; im port {

    googleAI } from '@ genkit-ai/google-genai'; const ai = genkit({ plugins: [googleAI()], model: googleAI . m odel('ge m i ni-2.5-flash'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); A quick overview of Genkit Our prompt
  16. im port { genkit } from 'genkit'; im port {

    googleAI } from '@ genkit-ai/google-genai'; const ai = genkit({ plugins: [googleAI()], model: googleAI . m odel('ge m i ni-2.5-flash'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); A quick overview of Genkit Result
  17. im port { genkit } from 'genkit'; const ai =

    genkit({ plugins: [ ], model: , }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); Unified Model API im port { googleAI } from '@ genkit-ai/google-genai'; googleAI() googleAI .m odel('ge m i ni-2.5-flash')
  18. im port { genkit } from 'genkit'; const ai =

    genkit({ plugins: [ ], model: , }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); Unified Model API im port { openAI } from '@ genkit-ai/compat-oai/openai'; openAI() openAI . m odel('gpt-4o')
  19. im port { genkit } from 'genkit'; im port {

    openAI } from '@ genkit-ai/compat-oai/openai'; const ai = genkit({ plugins: [openAI()], model: openAI . m odel('gpt-4o'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); Unified Model API im port { openAI } from '@ genkit-ai/compat-oai/openai'; openAI() openAI . m odel('gpt-4o')
  20. im port { genkit } from 'genkit'; im port {

    openAI } from '@ genkit-ai/compat-oai/openai'; const ai = genkit({ plugins: [openAI()], model: openAI . m odel('gpt-4o'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); Unified Model API im port { openAI } from '@ genkit-ai/compat-oai/openai'; openAI() openAI . m odel('gpt-4o')
  21. im port { genkit } from 'genkit'; im port {

    openAI } from '@ genkit-ai/compat-oai/openai'; const ai = genkit({ plugins: [openAI()], model: openAI . m odel('gpt-4o'), }); const { text } = await ai.generate({ prompt: "Hello, Hamburg" }); console.log(text); Unified Model API im port { openAI } from '@ genkit-ai/compat-oai/openai'; openAI() openAI . m odel('gpt-4o')
  22. /fl ə ʊ/ A flow is a special Genkit function

    that wraps your AI logic to provide: • Type-safe inputs and outputs • Streaming support • Developer UI integration • Easy deployment
  23. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Define a flow
  24. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Schema for the data the flow expects
  25. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Input parameter
  26. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow String
  27. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Minimum and maximum length
  28. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Schema of the output
  29. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Input parameter
  30. export const greetingFlow = ai.defineFlo w ( { name: 'greetingFlo

    w ' , inputSchema: z.object({ name: z.string() . m i n(1) . m ax(100), }), outputSchema: z.string(), }, async ({ name }) = > { const { text } = await ai.generate({ prompt: `Generate a greeting message for ${ name}.`, }); return text; }); A simple Genkit Flow Using the input parameter
  31. export const greetingBy Im ageFlow = ai.defineFlo w( { name:

    'greetingBy I m ageFlo w ' , inputSchema: z.object({ im ageUrl: z.string().url(), }), outputSchema: z.string(), }, async ({ im ageUrl }) = > { const { result } = await analyze Im ageFlo w . run({ im ageUrl }); const greeting = await greetingFlo w. run({ name: result }); return `${ greeting.result}`; }); Composing Flows Call the first flow
  32. export const greetingBy Im ageFlow = ai.defineFlo w( { name:

    'greetingBy I m ageFlo w ' , inputSchema: z.object({ im ageUrl: z.string().url(), }), outputSchema: z.string(), }, async ({ im ageUrl }) = > { const { result } = await analyze Im ageFlo w . run({ im ageUrl }); const greeting = await greetingFlo w. run({ name: result }); return `${ greeting.result}`; }); Composing Flows Call the second flow
  33. Personal travel assistant Documents 􀈿 Personal Knowledge Assistant Will my

    flight be on time? 􀉪 Which documents did I work on last week?
  34. Personal travel assistant Documents 􀈿 Personal Knowledge Assistant Will my

    flight be on time? 􀉪 Which documents did I work on last week?
  35. MCP Standardised Protocol Chat interface IDEs Other AI applications Data

    and file systems Development tools Productivity tools Other applications AI applications Data sources / services / tools bidirectional data flow bidirectional data flow
  36. MCP Standardised Protocol Chat interface Data and file systems AI

    applications Data sources / services / tools bidirectional data flow bidirectional data flow MCP Host MCP Server MCP Client Transport (stdio / SSE)
  37. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { return message; } ); Create a tool Define a tool const message = `Hello, $ { name.toUpperCase()}!`;
  38. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool This tells the model what our tool can do and which input / output it can handle
  39. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool
  40. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool Helps the model understand what the tool can do
  41. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool
  42. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool
  43. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool
  44. ai.defineTool( { name: 'say-hello', description: 'say hello to the user',

    inputSchema: z.object({ name: z.string().describe("Name of the person"), }), outputSchema: z.string(), }, async ({ name }) = > { const message = `Hello, $ { name.toUpperCase()}!`; return message; } ); Create a tool Tool function
  45. const server = createMcpServer(ai, { name: 'helloworld', version: ‘1.0.0', });

    Set up the server This will automatically expose all registered tools and prompts
  46. server.setup().then(async () => { await server.start(); const transport = new

    StdioServerTransport(); await server!.server ?. connect(transport); }); Connect the transport STDIO
  47. Unified access to APIs / data sources 1/ Access to

    local apps and APIs 2/ Created by iconfield from Noun Project APIs Apps
  48. Q&A @peterfriese.dev Created by Mamank from Noun Project https: /

    / peterfriese.dev peterfriese peterfriese