WS API ‐ MCP - fidransky/kiv-pia-labs GitHub Wiki

TOTD:

  • explore how web apps can be integrated with AI tools
  • learn about Model Context Protocol (MCP)
  • implement simple MCP server

Terms and theory

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

MCP is a high level protocol created by Antropic (company behind Claude). It is built upon JSON-RPC protocol and it can use following transport layers:

  • stdio (standard input/output) - Used for local MCP servers
  • streamable HTTP - Used for remote MCP servers

In the context of web apps, only streamable HTTP transport is applicable. It uses HTTP POST and GET requests, optionally making use of Server-Sent Events (SSE) to stream multiple server messages. All requests must be sent to one path, usually /mcp.

Servers offer any of the following capabilities to clients:

  • tools - Functions for the AI model to execute
  • resources - Context and data, for the user or the AI model to use
  • prompts - Templated messages and workflows for users

Tools

Sources