# AI use cases for Masume (masumedb/masume)

Repo: [masumedb/masume](https://github.com/masumedb/masume) | Use cases: 5 | Page: https://dedupedai.com/use-cases/masumedb-masume/

A keyboard-first terminal database client written in Go, with AI chat, notebooks, headless commands, and an MCP server for external agents.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Browse and query a database from the terminal: https://dedupedai.com/use-cases/masumedb-masume/query-database-from-terminal/
- Let an external agent query allowed databases over MCP: https://dedupedai.com/use-cases/masumedb-masume/let-agent-query-database-via-mcp/
- Run SQL in a script and export results to a file: https://dedupedai.com/use-cases/masumedb-masume/export-query-results-in-scripts/
- Compare the schemas of two databases: https://dedupedai.com/use-cases/masumedb-masume/compare-two-database-schemas/
- Find and open databases running in local containers: https://dedupedai.com/use-cases/masumedb-masume/find-databases-in-local-containers/

## How to browse and query a database from the terminal with Masume

Repo: [masumedb/masume](https://github.com/masumedb/masume) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Open a database in a keyboard-driven client and run SQL with completion and query plans.

**Who it is for:** A developer or analyst who needs to look at tables and run queries on a database without opening a GUI tool.

**The problem:** Switching between a browser tool, a shell, and docs slows down quick checks on a database.

**The outcome:** You connect to a database, browse its objects, and run a query with results shown in a grid.

### Steps

1. Run `brew install masumedb/tap/masume`
2. Run `masume ./notes.db` for a SQLite file, or `masume postgres://ada@127.0.0.1:5432/shop` for a URL
3. Press `?` to see the keys and `Ctrl+K` to open the command palette
4. Write a query in the editor and run it, then sort or filter the grid

### Prompt to paste into your agent

```text
In the masume repo, open the database at <target> with `masume <target>` and run `select count(*) from <table>`. Expected output: a single row with a count. Verify the count matches the table size reported by the database.
```

### Caveat

The README lists the supported engines, but a given engine may have limits; check docs/engines.md before relying on a specific feature.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/masumedb-masume/query-database-from-terminal/

## How to let an external agent query allowed databases over MCP with Masume

Repo: [masumedb/masume](https://github.com/masumedb/masume) | Difficulty: Advanced | Time: 30 minutes | Basis: From the README

Serve chosen profiles to an agent over stdio with an access level per profile.

**Who it is for:** An engineer who wants an AI agent to answer questions about a database, and who must limit what the agent can touch.

**The problem:** Giving an agent direct database credentials with no limits is risky, and copying data by hand is slow.

**The outcome:** The agent reads from allowed profiles through Masume, and writes are limited by the access level you set.

### Steps

1. Enable the profile for MCP in the settings screen or config, as described in docs/mcp.md
2. Run `masume --mcp --check` to check the enabled MCP profiles
3. Run `masume --mcp --profile <profile>` to serve one allowed profile (inferred, check the README)
4. Point your agent at the stdio server and confirm it lists the database tools

### Prompt to paste into your agent

```text
Using the masume MCP server for profile <profile>, list the tables and report the row count of <table>. Expected output: a table list and one integer. Verify the count by running a matching count query in masume yourself.
```

### Caveat

Read-only checks run in the client and on engines that support server-side enforcement, so confirm the level in docs/mcp.md for your engine.

Risk, credentials: The MCP server opens its own database connections, so each profile needs its access level and password source checked before an agent is connected.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/masumedb-masume/let-agent-query-database-via-mcp/

## How to run SQL in a script and export results to a file with Masume

Repo: [masumedb/masume](https://github.com/masumedb/masume) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Run statements headless and write CSV, JSON, or Parquet output for a pipeline.

**Who it is for:** A data engineer or CI maintainer who needs a query result as a file in a shell job.

**The problem:** Exporting data by hand from a GUI breaks repeatable reports and nightly jobs.

**The outcome:** A command writes the query result to a file that a later step can read.

### Steps

1. Install Masume with `brew install masumedb/tap/masume` or another method from the README
2. Run `masume run -p shop-prod -f json 'select count(*) from orders'` to check the connection
3. Run `masume run ./notes.db -f csv 'select * from notes limit 100000' > notes.csv` to export to CSV
4. Run `masume run -p shop -f parquet 'select * from orders' > orders.parquet` for a Parquet file

### Prompt to paste into your agent

```text
In the masume repo, run `masume run -p <profile> -f json 'select count(*) from <table>'` and report the JSON output. Expected output: one JSON result with a count. Verify that the exit code is 0 before the next step uses the output.
```

### Caveat

Check docs/headless.md for exit codes and format details before depending on them in CI.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/masumedb-masume/export-query-results-in-scripts/

## How to compare the schemas of two databases with Masume

Repo: [masumedb/masume](https://github.com/masumedb/masume) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Find differences in tables, columns, indexes, and constraints between two connections.

**Who it is for:** A developer checking that a staging database matches production before a release.

**The problem:** Schema drift between environments causes failed deploys that are hard to trace.

**The outcome:** You see the schema differences between the two connections and decide what to change.

### Steps

1. Install Masume and confirm it runs with `masume --version`
2. Add a profile for each database in the config file or use a URL target
3. Run `masume diff SOURCE TARGET` with the two connections
4. Review the reported differences in tables, columns, indexes, and constraints

### Prompt to paste into your agent

```text
Run `masume diff <source> <target>` in the masume repo and summarize the differences found. Expected output: a list of schema differences. Verify one reported difference by inspecting that table in both databases.
```

### Caveat

Schema compare covers tables, columns, indexes, and constraints as described in the README, not every object type.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/masumedb-masume/compare-two-database-schemas/

## How to find and open databases running in local containers with Masume

Repo: [masumedb/masume](https://github.com/masumedb/masume) | Difficulty: Beginner | Time: 30 minutes | Basis: From the README

Detect databases in running Docker or Podman containers and open one in the client.

**Who it is for:** A developer whose test database runs in a container and who does not remember its port or name.

**The problem:** Looking up container ports and credentials by hand each time wastes time during local work.

**The outcome:** Masume lists the databases it finds, and you open one with a click or key press.

### Steps

1. Start the Docker or Podman container that runs your database
2. Run `masume --detect` to list databases in running containers and in the current kubectl context
3. Choose the database from the list and connect
4. Run a query to confirm you are on the expected database

### Prompt to paste into your agent

```text
In the masume repo, run `masume --detect` and report the databases it lists. Expected output: a list of detected databases. Verify that the database you expect appears, and that the container is running.
```

### Caveat

Kubernetes detection uses kubectl port-forward as described in the README, so it depends on your kubectl context and access.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/masumedb-masume/find-databases-in-local-containers/
