Skip to main content

Create and serve web applications that can use goose, quickly

Project description

Goose App Maker

This MCP (Model Context Protocol) sever allows users to create, manage, and serve web applications through Goose.

Features

  • Create new web applications from basic instructions
  • Store apps in ~/.config/goose/app-maker-apps directory (each app in its own subdirectory)
  • Serve web applications locally on demand
  • Open web applications in the default browser (and chromeless if possible)
  • Lists all available web applications
  • make apps that can themselves use goose as a generic backend

Examples

Run productivity apps and dynamic dashboards

goose keeps track of your apps:

Screenshot 2025-04-28 at 7 35 46 pm

Load data via goose (re-using its extensions)

Screenshot 2025-04-28 at 7 38 24 pm

Screenshot 2025-04-28 at 7 38 53 pm

Make apps on demand

Screenshot 2025-04-28 at 6 24 09 pm Screenshot 2025-04-28 at 6 31 06 pm

Show rich tabular or list data as well

Screenshot 2025-04-28 at 6 32 22 pm

Usage from source

eg in goose:

# Run directly from source
uv --directory $PWD run python main.py

IMPORTANT: this MCP is required to be run in the goose desktop app at the moment (as it accesses goose-server/goosed)

Building and publishing

Optional: Build in a clean environment using uv

uv venv .venv
source .venv/bin/activate
uv pip install build
python -m build

Publishing

  1. Update version in pyproject.toml:
[project]
version = "x.y.z"  # Update this
  1. Build the package:
# Clean previous builds
rm -rf dist/*
python -m build
  1. Publish to PyPI:
# Install twine if needed
uv pip install twine

# Upload to PyPI
python -m twine upload dist/*

How it works

This MCP serves up apps, but also allows them to talk to goose via goosed and their own session:

Overview

The system implements a non-blocking, asynchronous request-response pattern that allows web applications to send requests to Goose and receive responses without blocking the main thread. This is achieved through a combination of:

  1. A blocking endpoint on the server side
  2. Asynchronous JavaScript on the client side
  3. A response storage mechanism with thread synchronization

Web App Structure

Web apps are made (or downloaded) on request, based on resources/templates. Each web app is stored in its own directory under ~/.config/goose/app-maker-apps with the following structure:

app-name/
├── goose-app-manifest.json     # App metadata
├── index.html        # Main HTML file
├── style.css         # CSS styles
├── script.js         # JavaScript code
└── goose_api.js      # allows the apps to access goose(d) for deeper backend functionality
└── ...               # Other app files

The goose-app-manifest.json file contains metadata about the app, including:

  • name: Display name of the app
  • type: Type of app (e.g., "static", "react", etc.)
  • description: Brief description of the app
  • created: Timestamp when the app was created
  • files: List of files in the app

1. Client-Side Request Flow

When a client wants to get a response from Goose:

┌─────────┐     ┌─────────────────┐     ┌───────────────┐     ┌──────────────┐
│ User    │────▶│ gooseRequestX() │────▶│ Goose API     │────▶│ waitForResp- │
│ Request │     │ (text/list/     │     │ (/reply)      │     │ onse endpoint │
└─────────┘     │  table)         │     └───────────────┘     └──────────────┘
                └─────────────────┘                                   │
                         ▲                                            │
                         │                                            │
                         └────────────────────────────────────────────┘
                                          Response
  1. The user initiates a request (e.g., clicking "Get List Response")
  2. The client calls one of the request functions (gooseRequestText, gooseRequestList, or gooseRequestTable)
  3. The function generates a unique responseId and sends a request to Goose with instructions to call app_response with this ID
  4. The function then calls waitForResponse(responseId) which polls the /wait_for_response/{responseId} endpoint
  5. This endpoint blocks until the response is available or a timeout occurs
  6. When the response is available, it's returned to the client and displayed

2. Server-Side Processing

On the server side:

┌─────────────┐     ┌─────────────┐     ┌───────────────┐
│ HTTP Server │────▶│ app_response│────▶│ response_locks│
│ (blocking   │     │ (stores     │     │ (notifies     │
│  endpoint)  │◀────│  response)  │◀────│  waiters)     │
└─────────────┘     └─────────────┘     └───────────────┘
  1. The /wait_for_response/{responseId} endpoint uses condition variables to block until a response is available
  2. When Goose processes the request, it calls the app_response function with the response data and the responseId
  3. The app_response function stores the response in the app_responses dictionary and notifies any waiting threads using the condition variable
  4. The blocked HTTP request is then unblocked and returns the response to the client

3. Thread Synchronization

The system uses Python's threading.Condition for thread synchronization:

  1. When a client requests a response that isn't available yet, a condition variable is created for that responseId
  2. The HTTP handler thread waits on this condition with a timeout (30 seconds)
  3. When the response becomes available, the condition is notified
  4. If the timeout expires before the response is available, an error is returned

Key Components

Client-Side Functions

  • gooseRequestText(query): Requests a text response
  • gooseRequestList(query): Requests a list response
  • gooseRequestTable(query, columns): Requests a table response with specified columns
  • waitForResponse(responseId): Waits for a response with the given ID

Server-Side Functions

  • app_response(response_id, string_data, list_data, table_data): Stores a response and notifies waiters
  • HTTP handler with /wait_for_response/{responseId} endpoint: Blocks until response is available

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goose_app_maker_mcp-0.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goose_app_maker_mcp-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file goose_app_maker_mcp-0.0.1.tar.gz.

File metadata

  • Download URL: goose_app_maker_mcp-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for goose_app_maker_mcp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7b3e8b3352a5a6f7e82e9e6644c9eca0d4be33839ec12ea76c9c8210a148d807
MD5 c2a4ddb61b261a24442794555055f23e
BLAKE2b-256 9fd7c992333112e84943cf6cfaa02a95a6085028da3cfe365aee86581ef3c7d3

See more details on using hashes here.

File details

Details for the file goose_app_maker_mcp-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for goose_app_maker_mcp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f393d9f17be018d7939be88dd4f9e9f6e2262cf6a7ab913f72ba8983cc897823
MD5 eb0d33b42f297f7f4cc61c34c14ea79e
BLAKE2b-256 b78444ce272bfbe2be3c584cc077bb2e3ce7a64537be8f2994aef6b14c947fcc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page