Project Overview

Project Purpose and Objectives

This project implements a Zoo Animal MCP (Model-Controller-Processor) server to provide an extensible API for querying zoo animal data via asynchronous services. The core goal is to create a lightweight, scalable backend service deployed on Google Cloud Run, exposing tools to retrieve animal information by species or name.

Key objectives include:

Functionally, the system maintains a structured in-memory dataset of zoo animals with attributes such as species, name, age, enclosure, and trail. The MCP server exposes this data through decorated tools accessible via HTTP endpoints. The server listens on a configurable port and handles concurrent requests asynchronously.

Example Workflows and Use Cases

Example: Query Animals by Species

  1. A client sends a request with a species identifier (e.g., "giraffe").

  2. The MCP server's get_animals_by_species tool filters the internal animal list to return all matching entries.

  3. The response is a JSON list of animal objects containing species, name, age, enclosure, and trail details.

Example: Retrieve Animal Details by Name

  1. A client requests detailed information about a specific animal by name (e.g., "Melman").

  2. The get_animal_details tool searches the animal list for a matching name.

  3. If found, it returns a detailed dictionary about that animal; if not found, it returns an empty dictionary.

Deployment Workflow

Stack and Technologies

These technologies collectively enable a cloud-native, containerized, and asynchronous service designed for efficient deployment and operational simplicity.

High-Level Architecture

The architecture consists of the following main components:

Communication flow:

graph TB
Client -->|HTTP Requests| MCP_Server[Zoo Animal MCP Server]
MCP_Server --> InMemoryData[Zoo Animal Dataset]
MCP_Server -->|Runs on| CloudRun[Google Cloud Run]
CloudRun -->|Logs| Logging[Cloud Logging]
InitScripts[init.sh, set_env.sh] --> CloudRun
DeployScripts[cloudrun.sh, cloudrun-secure.sh] --> CloudRun

Developer Navigation

Frontend Developers Start Here

Backend Developers Focus Here

DevOps / Deployment Focus

Visual Diagrams

Component Diagram: High-Level Architecture

graph TB
Client --> MCP[Zoo Animal MCP Server]
MCP --> Data[In-Memory Zoo Dataset]
MCP --> CloudRun[Google Cloud Run]
CloudRun --> Logs[Cloud Logging]
Init[Init & Env Scripts] --> CloudRun
Deploy[Deploy Scripts] --> CloudRun

Flowchart: Query Animal Details Workflow

flowchart TD
A[Client Request: Animal Name] --> B{Is Name in Dataset?}
B -- Yes --> C[Return Animal Details]
B -- No --> D[Return Empty Response]
C --> E[Send Response to Client]
D --> E

This overview provides a clear technical roadmap for developers to understand the project components, workflows, and how to contribute effectively.