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

MCP in action ParisJUG

Avatar for Zineb Bendhiba Zineb Bendhiba
May 13, 2025
25

MCP in action ParisJUG

Avatar for Zineb Bendhiba

Zineb Bendhiba

May 13, 2025
Tweet

Transcript

  1. MCP en action: Connecter les IA aux systèmes d’entreprise Zineb

    Bendhiba, Principal Software Engineer, Red Hat
  2. Model Context Protocol (MCP) A new protocol - A standard

    for connecting AI agents to systems - Pushed by Anthropic (Claude) USB for AI integrations
  3. Capabilities Tools - The client can invoke “tool” and get

    the response - Close to function calling, but the invocation is requested by the client - Can be anything: database, remote service… Resources - Expose data - URL -> Content Prompts - Pre-written prompt template - Allows executing specific prompt
  4. Transport JSON-RPC 2.0 - Everything is JSON - Request /

    Response and Notifications - Possible multiplexing Transports - stdio -> The client instantiates the server, sends the requests on stdio and gets the response from the same channel - Server-Sent Event (SSE) -> The client sends a POST request to the server, the response is an SSE (chunked response) - Streamable HTTP ->
  5. Quarkus MCP server extensions 2 extensions - SSE (SSE) ->

    quarkus-mcp-server-sse - stdio -> quarkus-mcp-server-stdio
  6. Quarkus MCP server extensions @Inject CodeService codeService; @Tool(description = "Converts

    the string value to lower case" ) String toLowerCase(String value) { return value.toLowerCase(); } @Prompt(name = "code_assist") PromptMessage codeAssist(@PromptArg(name = "lang") String language) { return PromptMessage.withUserRole(new TextContent(codeService.assist(language))); } @Resource(uri = "file:///project/alpha" ) BlobResourceContents alpha(RequestUri uri) throws IOException{ return BlobResourceContents.create(uri.value(), Files.readAllBytes(Path.of("alpha.txt"))); } MCP Tool MCP Prompt MCP Resource
  7. Model and Model Serving Model Model Serving Model Serving -

    Run the model - CPU / GPU - Expose an API Input - Prompt (text) - Instructions to give to the model - Taming a model is hard GPUs Input (Prompt) Output
  8. Application Model AI-infused application |ˌeɪˌaɪ ˈɪnˌfjuːzd ˌæplɪˈkeɪʃən| noun (Plural AI-Infused

    applications) A software program enhanced with artificial intelligence capabilities, utilizing AI models to implement intelligent features and functionalities. Model Serving
  9. Model <= HTTP Client <= Application HTTP Client Leaking HTTP

    stuff or abstractions - Often leak HTTP details - Error code, connection pooling - Requires implementing memory and token counting logic Application
  10. LangChain / LangChain4j / Quarkus LangChain4j LangChain LangChain4j Quarkus LangChain4j

    Inspired By Uses and extends Framework Clean separation, Managed interactions Integration Application
  11. Quarkus LangChain4j https://docs.quarkiverse.io/quarkus-langchain4j LangChain4j Quarkus LangChain4j Application LLMs Vector stores

    Embedding Models - Declarative clients - CDI integration - Observability (Otel, Prometheus) - Auditing - Resilience - Guardrails - RAG building blocks - Agentic architecture - Testability (unit, IT, evaluation) - Developer Joy
  12. Agent and MCP servers MCP servers offer new tools and

    resources that the model can call: Prompt (Context) Extend the context with MCP tools descriptions Invoke the model The model invoke a tool invocation (name + parameters) The tool is invoked via JSON-RPC and the result sent to the model The model computes the response using the tool result Response
  13. Quarkus Langchain4j MCP client extension quarkus.langchain4j.mcp.filesystem. transport-type =stdio quarkus.langchain4j.mcp.filesystem. command=npx,-y,@modelcontextprotocol/s

    erver-filesystem,/my-system-path/location quarkus.langchain4j.mcp.wanaku. transport-type =http quarkus.langchain4j.mcp.wanaku. url=http://my-url/mcp/sse/ stdio SSE
  14. My obsertavtions - Most of servers are stdio - Entreprise

    vs Local - Lack of documentation for SSE - Security - Authentication - Wanaku experience : limitation in the number of tools - MCP and Agentic -> emerging A2A - Not the only protocol (ACP …)