Skip to main content
Glama
MobileBlueprint MCP

MobileBlueprint MCP

README.md
<p align="center"><img src="assets/logo.svg" width="100" height="100" alt="MobileBlueprint MCP symbol"/></p>
<h1 align="center">MobileBlueprint MCP</h1>
<p align="center"><em>A mobile design specification library, available through MCP.</em></p>

**Release 0.1.0** • MIT • Node.js 20+ • 9 screen patterns  
Flutter and React Native static starters • English / Arabic • LTR / RTL

MobileBlueprint MCP is a lightweight local MCP server for developers and UI
designers who need structured mobile screen requirements before implementing a
real application. It returns original, deterministic layouts with clear
component roles, dimensions, design tokens and localization. It does not
generate entire apps, edit projects or execute generated code.

## The pattern catalog

![Illustrative mobile UI concept sheets for dashboard, form, and Arabic conversation](assets/pattern-catalog.svg)

*Concept diagrams with sample values for design discussion; these are not native app screenshots or compiled output.*

## Design patterns

| Pattern | Included elements |
| --- | --- |
| Dashboard | Summary, metric cards, recent activity |
| Settings | Profile section, preferences, toggle |
| List | Search field, labeled list rows |
| Empty | Explanatory empty state and suggested next action |
| Loading | Textual busy status |
| Error | Accessible error message and retry affordance |
| Form | Labeled fields, helper text, save and cancel affordances |
| Chat | Sample messages and composer layout |
| Navigation | Main sections and tab affordances |

Every content pattern accepts default, empty, loading and error states. The
three dedicated state patterns always use their corresponding state. All
patterns accept light/dark themes, English/Arabic and a logical viewport
width from 320 to 768.

## Quick start

Requires Node.js 20+.

```bash
git clone https://github.com/ahmedsaeed1-eng/mobileblueprint-mcp.git
cd mobileblueprint-mcp
npm ci
npm test
```

The server communicates over standard input/output. Register the absolute
path in an MCP client (without starting a separate network server).

### Codex

```bash
codex mcp add mobileblueprint -- node /absolute/path/to/mobileblueprint-mcp/src/server.js
```

Or add this entry to your client's MCP configuration:

```json
{
  "mcpServers": {
    "mobileblueprint": {
      "command": "node",
      "args": ["/absolute/path/to/mobileblueprint-mcp/src/server.js"]
    }
  }
}
```

On Windows, substitute the actual absolute path (escaped backslashes or
forward slashes as supported by your MCP client). Restart or reload the
client after registering.

## Tools

| Tool | Arguments | Output |
| --- | --- | --- |
| `list_mobile_patterns` | None | Pattern IDs, descriptions and supported states |
| `create_screen_spec` | `pattern` plus optional `locale`, `theme`, `width`, `state` | Structured screen specification |
| `generate_ui_snippet` | Same screen options and required `framework` | Static Dart or JSX text and integration notes |

### Input constraints

- `pattern`: dashboard, settings, list, empty, loading, error, form, chat, navigation.
- `locale`: en (default), ar.
- `theme`: light (default), dark.
- `width`: integer 320–768; default 390 logical pixels.
- `state`: default, empty, loading, error.
- `framework`: flutter or react-native (snippet tool only).

## Example

Call `create_screen_spec` with:

```json
{
  "pattern": "dashboard",
  "locale": "ar",
  "theme": "dark",
  "width": 768
}
```

The response includes Arabic title/copy, RTL direction, two dashboard columns
at that width, a 32-unit outer margin, a capped content width, colors,
typography, spacing, touch-target guidance and semantic component IDs. Both
machine-readable `structuredContent` and JSON text are returned.

Request a static snippet with `generate_ui_snippet`:

```json
{
  "pattern": "form",
  "framework": "flutter",
  "locale": "en",
  "width": 390
}
```

This returns a `BlueprintScreen` example with layout, visible field labels,
safe-area and scroll structure. React Native generates JSX with similar
semantics and a note to use your app's safe-area implementation. Controls
are visual examples only; connect your own business behavior and navigation.

## Localization and accessibility

- Arabic and English example labels with matching RTL/LTR directions.
- Interactive affordances specify at least a 48-unit touch target.
- Focus order follows blueprint component order.
- Text and muted-text color pairs were tested for normal-text WCAG AA
  contrast in both built-in palettes. Modified colors and actual rendering
  must be re-evaluated.
- Layout instructions include scrolling, safe areas, directional spacing,
  text wrapping and a 200% font-scale test recommendation.
- Real accessibility depends on implementation, platform and content.
  Test independently with native assistive technology and devices.

## Scope and data handling

All output is deterministic from built-in templates. No AI provider, account,
network request, file discovery, shell command, or external data is needed.
The stdio server does not modify the user's project or execute a snippet.
Examples are illustrative; the dashboard's numbers are fixed sample values.

The snippet width is the requested design viewport; regenerate or adapt the
starter for other widths. Snippets are not full Flutter or React Native
applications and have no real interactions, authentication or network data.
They must be integrated, compiled, rendered and tested in your own project.

## Testing

```bash
npm test
```

The release passed six Node tests, including 432 deterministic combinations,
touch targets/focus order, contrast checks and static snippet generation.
The integration test uses the official MCP SDK client to invoke all tools
via stdio, including invalid-input checks and equality of text/structured
outputs. React Native JSX variants received an additional syntax-only
transpilation check during Linux verification; no React Native or Flutter
native build or device rendering was performed. Windows/macOS runtimes
have not been separately verified.

## License

MIT. See [LICENSE](LICENSE) and [third-party notices](THIRD_PARTY.md).

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool occupies a distinct stage of a linear workflow: discovering patterns, producing a declarative spec, and emitting illustrative code. The descriptions explicitly bound each output type (blueprint vs. static snippet vs. pattern catalog), so misselection risk is low despite the similar 'mobile UI' domain.

Naming Consistency5/5

All three tools follow a strict verb_noun snake_case pattern (list_/create_/generate_ + resource). The convention is uniform and readable across the entire surface.

Tool Count4/5

Three tools is on the lean side but matches a deliberately narrow, stateless blueprint-generation purpose, with no filler tools. It sits just below the ideal 3-15 band's comfort zone because there is no way to inspect or re-serve an already-created spec.

Completeness4/5

The core lifecycle is covered end to end: enumerate patterns, compose a spec, then materialize a starter snippet. Minor gaps remain, such as fetching a single pattern's detail or validating/rendering an existing spec, which agents would have to work around.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues