Leveraging Gemini CLI and the underlying Gemini LLM to build Model Context Protocol (MCP) AI applications using Flutter/Dart deployed to Google Cloud Run.
Why not just use Python?
Python has traditionally been the main coding language for ML and AI tools. One of the strengths of the MCP protocol is that the actual implementation details are independent of the development language. The reality is that not every project is coded in Python- and MCP allows you to use the latest AI approaches with other coding languages.
Flutter/Dart? For AI? Does that even work?
The goal of this article is to provide a minimal viable basic working MCP stdio server in Dart that can be run locally without any unneeded extra code or extensions.
The key MCP Dart package is here:
What Is Flutter / Dart?
Flutter is Googleโs open-source UI toolkit and framework used for building natively compiled, multi-platform applications (mobile, web, desktop, and embedded systems) from a single codebase. Dart is the programming language , also developed by Google, in which Flutter apps are written.
The full details of the language can be found here:
Installing Dart
Step by Step instructions vary by platformโโโa good starting point is here:
For a Debian style Linux Distro these steps are similar to:
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
The download and extract the latest Flutter Bundle and extract to a common directory like ~/develop :
tar -xf <sdk_zip_path> -C <destination_directory_path>
As of writing the current version is:
tar -xf /mnt/chromeos/MyFiles/Downloads/flutter_linux_3.38.5-stable.tar.xz -C ~/develop/
You can validate the working tools with theโโโversion command:
xbill@penguin:~$ dart --version
Dart SDK version: 3.10.4 (stable) (Tue Dec 9 00:01:55 2025 -0800) on "linux_x64"
xbill@penguin:~$ flutter --version
Flutter 3.38.5 โข channel stable โข https://github.com/flutter/flutter.git
Framework โข revision f6ff1529fd (3 weeks ago) โข 2025-12-11 11:50:07 -0500
Engine โข hash c108a94d7a8273e112339e6c6833daa06e723a54 (revision 1527ae0ec5) (23 days ago) โข 2025-12-11 15:04:31.000Z
Tools โข Dart 3.10.4 โข DevTools 2.51.1
What is FireStore?
Google FireStore, also known as Cloud FireStore is a part of the Google Firebase application development platform. It is fundamentally a cloud-hosted NoSQL database for storing and syncing data. Firestore can be directly accessed by mobile and web applications through native SDKs.
Gemini CLI
If not pre-installed you can download the Gemini CLI to interact with the source files and provide real-time assistance:
npm install -g @google/gemini-cli
Testing the Gemini CLI Environment
Once you have all the tools and the correct Node.js version in place- you can test the startup of Gemini CLI. You will need to authenticate with a Key or your Google Account:
gemini
Dart Gemini CLI Extension
To simplify working with Dart/Flutter with Gemini CLI- a Gemini CLI extension is available:
Flutter extension for Gemini CLI
The installation will look similar to this:
xbill@penguin:~/gemini-cli-codeassist/mcp-stdio-flutter$ gemini extensions install https://github.com/gemini-cli-extensions/flutter.git --auto-update
Installing extension "flutter".
**The extension you are about to install may have been created by a third-party developer and sourced from a public repository. Google does not vet, endorse, or guarantee the functionality or security of extensions. Please carefully inspect any extension and its source code before installing to understand the permissions it requires and the actions it may perform.**
This extension will run the following MCP servers:
* dart (local): dart mcp-server
This extension will append info to your gemini.md context using flutter.md
Do you want to continue? [Y/n]:
Extension "flutter" installed successfully and enabled.
xbill@penguin:~/gemini-cli-codeassist/mcp-stdio-flutter$
Node Version Management
Gemini CLI needs a consistent, up to date version of Node. The nvm command can be used to get a standard Node environment:
Where do I start?
The strategy for starting MCP development is a incremental step by step approach.
First, the basic development environment is setup with the required system variables, and a working Gemini CLI configuration.
Then, a minimal Hello World Style Dart MCP Server is built with HTTP transport. This server is validated with Gemini CLI in the local environment.
The MCP server is backed by a FireStore database that provides basic product inventory.
This setup validates the connection from Gemini CLI to the local process via MCP. The MCP client (Gemini CLI) and the Dart MCP server both run in the same local environment.
Next- the basic MCP server is wrapped in a container and deployed to Google Cloud Run.
Finallyโโโthe connection is re-validated over the Internet with Gemini CLI running as a local MCP client connection to the MCP server running in Google Cloud Run.
Setup the Basic Environment
At this point you should have a working Dart/Flutter environment and a working Gemini CLI installation. The next step is to clone the GitHub samples repository with support scripts:
cd ~
git clone https://github.com/xbill9/gemini-cli-codeassist
Then run init.sh from the cloned directory.
The script will attempt to determine your shell environment and set the correct variables:
cd gemini-cli-codeassist
source init.sh
If your session times out or you need to re-authenticate- you can run the set_env.sh script to reset your environment variables:
cd gemini-cli-codeassist
source set_env.sh
Variables like PROJECT_ID need to be setup for use in the various build scripts- so the set_env script can be used to reset the environment if you time-out.
Hello World with HTTP Transport
One of the key features that the standard MCP libraries provide is abstracting various transport methods.
The high level MCP tool implementation is the same no matter what low level transport channel/method that the MCP Client uses to connect to a MCP Server.
The simplest transport that the SDK supports is the stdio (stdio/stdout) transportโโโwhich connects a locally running process. Both the MCP client and MCP Server must be running in the same environment.
The HTTP(s) transport allows the MCP client and server to be running locally or distributed over the Internet.
The connection over HTTP will look similar to this:
final server = StreamableMcpServer(
serverFactory: (sessionId) => createServer(),
host: host,
port: port,
path: path,
);
Running the Dart Code
First- switch the directory with the Dart MCP sample code:
cd ~/gemini-cli-codeassist/firestore-https-flutter
Current Version of Dart dependencies:
The current version of pubspec.yaml describes the project:
name: firestore_https_flutter
description: Firestore MCP server over streaming HTTP transport deployed to Cloud Run
version: 1.0.1
repository: https://github.com/xbill9/gemini-cli-codeassist
environment:
sdk: ^3.10.4
# Add regular dependencies here.
dependencies:
path: ^1.9.0
mcp_dart: ^1.2.0
args: ^2.5.0
firedart: ^0.9.8
dotenv: ^4.2.0
dev_dependencies:
lints: ^6.0.0
test: ^1.25.6
Installing and Running the Dart Code
Run the build make target on the local system:
make build
dart compile exe bin/firestore_https_flutter.dart -o bin/firestore_https_flutter
Generated: /home/xbill/gemini-cli-codeassist/firestore-https-flutter/bin/firestore_https_flutter
xbill@penguin:~/gemini-cli-codeassist/firestore-https-flutter$
To test the Dart Code:
xbill@penguin:~/gemini-cli-codeassist/firestore-https-flutter$ make test
dart test
00:00 +2: All tests passed!
To lint the Dart Code:
xbill@penguin:~/gemini-cli-codeassist/firestore-https-flutter$ make lint
dart analyze
Analyzing firestore-stdio-flutter... 0.2s
No issues found!
Gemini CLI settings.json
The default Gemini CLI settings.json has an entry for the source:
{
"mcpServers": {
"firestore-https-flutter": {
"httpUrl": "http://127.0.0.1:8080/mcp"
}
}
}
Validation with Gemini CLI
Start the MCP Server in a terminal window:
make run
dart run bin/firestore_https_flutter.dart --transport http --port 8080 --host 0.0.0.0 --path /mcp
[dotenv] Load failed: file not found: File: '.env'
{"timestamp":"2026-01-06T15:58:37.118845","level":"INFO","message":"Firestore initialized","context":{"projectId":"comglitn"}}
[INFO][StreamableMcpServer] MCP Streamable HTTP Server listening on http://0.0.0.0:8080/mcp
{"timestamp":"2026-01-06T15:58:37.136708","level":"INFO","message":"Server started","context":{"transport":"http","host":"0.0.0.0","port":8080,"path":"/mcp"}}
Open a new window and start Gemini CLI:
gemini
> /mcp list
Configured MCP servers:
๐ข firestore-https-flutter - Ready (7 tools)
Tools:
- get_product_by_id
- get_products
- get_root
- greet
- reset
- search
- seed
> get_products
โฆ I will retrieve the list of products from the inventory database.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ? get_products (firestore-https-flutter MCP Server) {} โ โ
โ โ
โ MCP Server: firestore-https-flutter โ
โ Tool: get_products โ
โ โ
โ Allow execution of MCP tool "get_products" from server "firestore-https-flutter"? โ
โ โ
โ 1. Allow once โ
โ 2. Allow tool for this session โ
โ โ 3. Allow all server tools for this session โ
โ 4. No, suggest changes (esc) โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆ I have retrieved the product list from the inventory. There are 34 products currently in the database, including items like
Green Tea, Jasmine Rice, Coffee Beans, and more.
How would you like to proceed?
> search Coffee
โฆ I will search for "Coffee" in the product database.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ search (firestore-https-flutter MCP Server) {"query":"Coffee"} โ
โ โ
โ [{"id":"37kWbZHTwg5nbrSD13PB","name":"Coffee โ
โ Beans","price":5.0,"quantity":488,"imgfile":"product-images/coffeebeans.png","timestamp":"2025-02-22T15:21:37.070483","actual โ
โ dateadded":"2026-01-06T15:21:37.070643"}] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆ The search for "Coffee" returned one result: Coffee Beans (ID: 37kWbZHTwg5nbrSD13PB) priced at $5.00 with 488 units in stock.
Using the Dart Gemini CLI Extension
The Gemini CLI Extension provides tools for working with Dart Code:
> run_tests
โฆ I will now run the tests for the project.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ run_tests (dart MCP Server) {"roots":[{"root":"file:///home/xbill/gemini-cli-codeassist/firestore-https-flutter"}]} โ
โ โ
โ dart|flutter test in /home/xbill/gemini-cli-codeassist/firestore-https-flutter: โ
โ \u001b[32m+3\u001b[0m: All tests passed!\u001b[0m โโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏโฆ The tests for the project have passed successfully. Is there anything else I can help you with?> dart_fixโฆ I will now run dart fix --apply to automatically address any lint or analysis issues in the project.โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎโ โ dart_fix (dart MCP Server) {"roots":[{"root":"file:///home/xbill/gemini-cli-codeassist/firestore-https-flutter"}]} โ
โ โ
โ dart fix in /home/xbill/gemini-cli-codeassist/firestore-https-flutter: โ
โ Computing fixes in firestore-https-flutter... โ
โ Nothing to fix! โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆ No fixes were needed; the codebase already adheres to the current analysis rules.
Is there anything else you'd like me to do?
> dart_format
โฆ I will now run dart format . to ensure all files follow the standard Dart style.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ dart_format (dart MCP Server) {"roots":[{"root":"file:///home/xbill/gemini-cli-codeassist/firestore-https-flutter","pathsโฆ โ
โ โ
โ dart format in /home/xbill/gemini-cli-codeassist/firestore-https-flutter: โ
โ Formatted bin/firestore_https_flutter.dart โ
โ Formatted example/example.dart โ
โ Formatted lib/src/product.dart โ
โ Formatted lib/src/server.dart โ
โ Formatted lib/src/tools.dart โ
โ Formatted test/greet_test.dart โ
โ Formatted 9 files (6 changed) in 0.03 seconds. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆ I've formatted the Dart files in the project. Six files were updated to follow the standard Dart style
Publishing Dart Packages with Gemini CLI
Gemini CLI offers support and automation for publishing your Dart code. Start the processs from within Gemini CLI:
> dart pub publish
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ Shell dart pub publish [current working directory /home/xbill/gemini-cli-codeassist/firestore-https-flutter] (Publishing โฆ โ
โ โ
โ Resolving dependencies... โ
โ Downloading packages... โ
โ archive 3.6.1 (4.0.7 available) โ
โ googleapis_auth 1.6.0 (2.0.0 available) โ
โ grpc 3.2.4 (5.1.0 available) โ
โ protobuf 3.1.0 (6.0.0 available) โ
โ Got dependencies! โ
โ 4 packages have newer versions incompatible with dependency constraints. โ
โ Try `dart pub outdated` for more information. โ
โ Publishing firestore_https_flutter 1.0.22 to https://pub.dev: โ
โ โโโ CHANGELOG.md (<1 KB) โ
โ โโโ Dockerfile (<1 KB) โ
โ โโโ GEMINI.md (2 KB) โ
โ โโโ LICENSE (1 KB) โ
โ โโโ Makefile (<1 KB) โ
โ โโโ README.md (1 KB) โ
โ โโโ analysis_options.yaml (1 KB) โ
โ โโโ bin โ
โ โ โโโ firestore_https_flutter.dart (1 KB) โ
โ โโโ cloudbuild.yaml (<1 KB) โ
โ โโโ example โ
โ โ โโโ example.dart (<1 KB) โ
โ โ โโโ full_usage_example.dart (2 KB) โ
โ โโโ lib โ
โ โ โโโ firestore_https_flutter.dart (<1 KB) โ
โ โ โโโ src โ
โ โ โโโ logger.dart (<1 KB) โ
โ โ โโโ product.dart (1 KB) โ
โ โ โโโ server.dart (2 KB) โ
โ โ โโโ tools.dart (7 KB) โ
โ โโโ pubspec.yaml (<1 KB) โ
โ โโโ test โ
โ โโโ greet_test.dart (<1 KB) โ
โ โ
โ Total compressed archive size: 8 KB. โ
โ Validating package... โ
โ Package validation found the following hint: โ
โ * The previous version is 1.0.1. โ
โ โ
โ It seems you are not publishing an incremental update. โ
โ โ
โ Consider one of: โ
โ * 2.0.0 for a breaking release. โ
โ * 1.1.0 for a minor release. โ
โ * 1.0.2 for a patch release. โ
โ โ
โ Publishing is forever; packages cannot be unpublished. โ
โ Policy details are available at https://pub.dev/policy โ
โ โ
โ โ
โ Package has 0 warnings and 1 hint.. Do you want to publish firestore_https_flutter 1.0.22 to https://pub.dev (y/N)? y โ
โ Uploading... (1.8s) โ
โ Message from server: Successfully uploaded https://pub.dev/packages/firestore_https_flutter version 1.0.22, it may take up-to โ
โ 10 minutes before the new version is available. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆ The package firestore_https_flutter version 1.0.22 has been successfully published to pub.dev. It may take up to 10 minutes to
become visible on the site.
Deploying to Cloud Run
After the local HTTP version of the MCP server has been tested locallyโโโit can be deployed remotely to Google Cloud Run.
First- switch to the directory with the HTTP MCP sample code:
cd ~/gemini-cli-codeassist/firebase-https-flutter
Deploy the project to Google Cloud Run with the pre-built cloudbuild.yaml and Dockerfile:
cd ~/gemini-cli-codeassist/firebase-https-flutter
xbill@penguin:~/gemini-cli-codeassist/firebase-https-flutter$ make deploy
The Cloud Build will start:
Submitting build to Google Cloud Build...
Creating temporary archive of 22 file(s) totalling 40.8 KiB before compression.
Some files were not included in the source upload.
Check the gcloud log [/home/xbill/.config/gcloud/logs/2026.01.06/16.07.50.196165.log] to see which files and the contents of the
default gcloudignore file used (see `$ gcloud topic gcloudignore` to learn
more).
Uploading tarball of [.] to [gs://comglitn_cloudbuild/source/1767733670.377721-6bce141280ca4bb9b9d622acddf82f19.tgz]
Created [https://cloudbuild.googleapis.com/v1/projects/comglitn/locations/global/builds/59bf1e16-0704-4751-87ae-3c78abbb4128].
Logs are available at [https://console.cloud.google.com/cloud-build/builds/59bf1e16-0704-4751-87ae-3c78abbb4128?project=1056842563084].
Waiting for build to complete. Polling interval: 1 second(s).
It can take 5โ10 minutes to complete the build.
When the build is complete- an endpoint will be returned:
Step #2: Already have image (with digest): gcr.io/cloud-builders/gcloud
Step #2: Deploying container to Cloud Run service [firestore-https-flutter] in project [comglitn] region [us-central1]
Step #2: Deploying...
Step #2: Setting IAM Policy..........done
Step #2: Creating Revision.......................................................done
Step #2: Routing traffic.....done
Step #2: Done.
Step #2: Service [firestore-https-flutter] revision [firestore-https-flutter-00003-5k2] has been deployed and is serving 100 percent of traffic.
Step #2: Service URL: https://firestore-https-flutter-1056842563084.us-central1.run.app
Finished Step #2
The service endpoint in this example is :
https://firebase-https-flutter-1056842563084.us-central1.run.app
The actual endpoint will vary based on your project settings.
Review Service in Cloud Run
Navigate to the Google Cloud console and search for Cloud Run -
and then you can detailed information on the Cloud Run Service:
Cloud Logging
The remote server writes logs to stderr in standard JSON format. These logs are available from the deployed Cloud Run Service:
Validate HTTP connection
Once you have the Endpointโโโyou can attempt a connection- navigate to in your browser:
https://firebase-https-flutter-1056842563084.us-central1.run.app
You will need to adjust the exact URL to match the URL returned from Cloud Build.
You will get an error- this connection is expecting a message in the MCP format:
Not Found
Gemini CLI settings.json.cloudrun
Replace the default Gemini CLI configuration fileโโโ settings.json with a pre-configured sample- settings.json.cloudrun to use the Cloud Run version of the connection:
{
"mcpServers": {
"firestore-cloudrun-flutter": {
"httpUrl": "https://firestore-https-flutter-$PROJECT_NUMBER.us-central1.run.app/mcp"
}
}
}
Copy the Cloud Run version of the Gemini CLI configuration file:
xbill@penguin:~/gemini-cli-codeassist/mcp-https-php$ cd .gemini
cp settings.json.cloudrun settings.json
xbill@penguin:~/gemini-cli-codeassist/mcp-https-php/.gemini$
To cross check that you are using the Cloud Run end point- make sure that the local HTTP server is not active in your environment.
Validation with Gemini CLI
The final connection test uses Gemini CLI as a MCP client with the deployed Cloud Run Service providing the MCP server. Startup Gemini CLI with the updated settings :
gemini
> /mcp list
Configured MCP servers:
๐ข firestore-cloudrun-flutter - Ready (7 tools)
Tools:
- get_product_by_id
- get_products
- get_root
- greet
- reset
- search
- seed
> search Coffee
โฆ I will search for products matching "Coffee" in the inventory database.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ? search (firestore-cloudrun-flutter MCP Server) {"query":"Coffee"} โ โ
โ โ
โ MCP Server: firestore-cloudrun-flutter โ
โ Tool: search โ
โ โ
โ Allow execution of MCP tool "search" from server "firestore-cloudrun-flutter"? โ
โ โ
โ 1. Allow once โ
โ 2. Allow tool for this session โ
โ โ 3. Allow all server tools for this session โ
โ 4. No, suggest changes (esc) โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ search (firestore-cloudrun-flutter MCP Server) {"query":"Coffee"} โ
โ โ
โ [{"id":"37kWbZHTwg5nbrSD13PB","name":"Coffee โ
โ Beans","price":5.0,"quantity":488,"imgfile":"product-images/coffeebeans.png","timestamp":"2025-02-22T20:21:37.070483","actual โ
โ dateadded":"2026-01-06T20:21:37.070643"}] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆ The search for "Coffee" returned the following product:
* Name: Coffee Beans
* ID: 37kWbZHTwg5nbrSD13PB
* Price: $5.00
* Quantity: 488
* Image: product-images/coffeebeans.png
* Date Added: 2026-01-06
Use The Cloud Run MCP Tools in the Local Context
Once the Cloud Run endpoint is active- it can be used directly in the local Gemini CLI context:
> produce a detailled inventory report with action items
โฆ Here is the detailed inventory report based on the current database:
Inventory Summary
* Total Unique Products: 34
* Total Inventory Value: $28,165.00
Action Items
๐ด Out of Stock (Immediate Action Required)
These items have 0 quantity and need to be restocked immediately:
1. Wasabi Party Mix (ID: IyTMNayFG4lxXjJv0MMY)
2. Jalapeno Seasoning (ID: iLTFdThVRH7zvE7uSu2y)
๐ก Low Stock (Restock Recommended)
These items have a quantity of 50 or fewer:
1. Smores Cereal: 2 units
2. Bottled Water: 9 units
3. Cola: 16 units
4. White Chocolate Caramel Corn: 25 units
5. Peanut Butter and Jelly Cups: 25 units
6. Maple Almond Butter: 37 units
7. Pineapple Kombucha: 42 units
8. Mint Chocolate Cookies: 48 units
9. Parmesan Crisps: 50 units
โฆ Based on the current inventory levels and pricing, I have designed a menu strategy to maximize potential revenue ("profit"
proxy, assuming standard margins). This menu highlights High-Value Items (to boost average transaction size) and High-Volume
Movers (to monetize abundant stock).
๐ The "Cymbal's Yield" Optimized Menu
๐ Chef's Specials (High Margin)
Targeting items with the highest unit price ($8+).
1. The "Premium Pantry" Pack - $28.00
* Includes: Walnuts ($10), Sunflower Seeds ($10), Jasmine Rice ($8).
* Why: High ticket price, utilizes distinct non-perishables.
2. Midnight Indulgence - $18.00
* Includes: Mint Chocolate Cookies ($10), Maple Almond Butter ($8).
* Why: High impulse-buy value with decent stock levels.
3. Fresh Herb & Yogurt Dip - $19.00
* Includes: Fresh Basil ($10), Yogurt ($9).
* Why: Highest price-point perishable combination.
๐ฐ Best Sellers (Revenue Drivers)
Targeting items with the highest total inventory value (Price ร Quantity).
4. Summer Refresh Bundle - $13.00
* Includes: Watermelon ($7), Apple Juice ($6).
* Inventory Value: These two items alone represent over $5,400 in potential revenue.
5. The Daily Grind - $8.00
* Includes: Coffee Beans ($5), Milk ($3).
* Inventory Value: We have nearly 500 units of each. Moving these consistently is key to cash flow.
6. Protein Power Bowl - $12.00
* Includes: Shrimp ($4), Black Beans ($6), Broccoli ($2).
* Why: Moves high-stock frozen/canned goods with a moderate price point.
โ ๏ธ "Last Chance" Specials
Urgent sales to clear low stock before they run out.
7. The Rare Find - $12.00
* Includes: Smores Cereal (Only 2 left!), Peanut Butter & Jelly Cups.
* Goal: Clear the final units to free up inventory slots.
Finallyโโโthe server code can be extended and redeployed:
Would you like me to implement a `get_menu` tool in the MCP server that dynamically generates this menu based on real-time
inventory data?
> yes
โฆ I will implement the get_menu tool to dynamically generate the optimized menu.
> make deploy
โฆ I have successfully deployed the updated application to Google Cloud Run. The get_menu tool is now live and available.
Deployment Summary:
* Service URL: https://firestore-https-flutter-1056842563084.us-central1.run.app
* Revision: firestore-https-flutter-00004-227
* Status: Deployed and serving 100% of traffic.
You can now use the get_menu tool in production.
Restart Gemini CLI and run the new MCP tool:
> get_menu
โฆ Here is the optimized menu based on current inventory:
Chef Specials (High Margin)
* Walnuts: $10.00
* Mint Chocolate Cookies: $10.00
* Fresh Basil: $10.00
* Sunflower Seeds: $10.00
* Yogurt: $9.00
* Jasmine Rice: $8.00
* Smores Cereal: $8.00
* Maple Almond Butter: $8.00
Best Sellers
* Watermelon: $7.00
* Coffee Beans: $5.00
* Apple Juice: $6.00
* Walnuts: $10.00
* Cheddar Cheese: $4.00
Last Chance (Low Stock)
* Smores Cereal: $8.00 (2 left!)
* Bottled Water: $2.00 (9 left)
* Cola: $4.00 (16 left)
* White Chocolate Caramel Corn: $4.00 (25 left)
* Peanut Butter and Jelly Cups: $4.00 (25 left)
* Maple Almond Butter: $8.00 (37 left)
* Pineapple Kombucha: $3.00 (42 left)
* Mint Chocolate Cookies: $10.00 (48 left)
* Parmesan Crisps: $1.00 (50 left)
Summary
MCP development with Flutter/Dart using Gemini CLI was validated with an incremental step by step approach.
A minimal streaming HTTP transport MCP Server was built from source code and validated with Gemini CLI running as a MCP client in the same local environment.
Thenโโโthe MCP server was wrapped in a container and submitted to Google Cloud Build for deployment to Google Cloud Run. The remote MCP server was validated with a standard browser, and Gemini CLI.
Finally- remote MCP operations were performed from the local Gemini CLI installation to the Flutter/Dart MCP server hosted in Google Cloud Run.
This approach can be extended to more complex deployments and Cloud based options.





Top comments (0)