---
id: mcp-server
name: MCP Server
version: 1.0.0
summary: |
  Internal stateless Streamable HTTP MCP service that exposes read-only
  Catalog lookup tools and reusable AI prompts.
owners:
  - ai-capabilities-team
sends:
  - id: ListBooksGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: GetBookDetailsGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: ListCategoriesGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: ListAuthorsGrpc
    version: 1.0.0
    group: Catalog Queries
repository:
  language: C#
  url: "https://github.com/foxminchan/BookWorm"
styles:
  icon: /icons/languages/dotnet.svg
badges:
  - content: Internal
    backgroundColor: gray
    textColor: gray
  - content: HTTP API
    backgroundColor: teal
    textColor: teal
---

## Service Responsibility & Boundary

MCP Server is a stateless Model Context Protocol (MCP) adapter within the [[domain|conversational]] domain that exposes read-only catalog lookup tools and reusable AI prompt templates over Streamable HTTP to [[service|chat-api]] and [[service|rating-api]]. It delegates all product queries to [[service|catalog-api]] over gRPC and owns no databases, caches, or messaging channels.

## Service Profile

| Property                                  | Value                                                                                                                              |
| :---------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |
| **Bounded Context / Domain**              | [[domain\|conversational]]                                                                                                         |
| **Owner Team**                            | [[team\|ai-capabilities-team]]                                                                                                     |
| **Runtime Style**                         | Stateless Streamable HTTP MCP Server                                                                                               |
| **Public / Gateway Exposure**             | Internal Only (not routed via public API Gateway)                                                                                  |
| **Authentication & Authorization Policy** | Microsoft Entra ID JWT requiring `mcptools_read` scope with server-side authorization filters and default-deny governance policies |
| **Owned Data Store(s)**                   | None (Stateless)                                                                                                                   |
| **Key Resilience / Idempotency Pattern**  | Global rate limiting, RFC 9457 error handling, and explicit error propagation on upstream gRPC failures                            |

## Contracts & Data Ownership

MCP Server owns no persistent entities or data stores. It translates four read-only catalog tools (`search_catalog`, `get_book`, `list_categories`, `list_authors`) into gRPC queries against [[service|catalog-api]] and serves reusable prompt templates for book recommendations and review summarization.

:::note
MCP Server has no upstream dependency on [[service|rating-api]] and exposes no review-fetching tool. [[service|rating-api]] retrieves raw customer feedback in-process while using MCP Server only for book details and review-analysis prompts.
:::

<MessageTable format="all" limit={10} showChannels={true} />

## Architecture Visualizations & Specifications

### MCP Integration Context

<MermaidFileLoader file="mermaids/MCPServer-diagram-1.mmd" />

### Service Interactions

<NodeGraph />

## Attached Resources & Related Docs

- [[doc|platform/006-api-and-contracts]] — Consolidated service, HTTP, gRPC, and Kafka index.
- [[service|catalog-api]] — Upstream gRPC catalog provider.
- [[service|chat-api]] — Conversational consumer of Catalog MCP tools.
- [[service|rating-api]] — Consumer of book detail lookups and rating analysis prompts.
