Local MCP server experiments and tooling for macOS.
mq-mcp is a small local-first lab for building, testing, and documenting MCP-related workflows on macOS. The goal is to make local MCP setup easier to understand, repeat, validate, and publish safely.
In the MQ stack, mq-mcp is the execution runtime: it exposes bounded tools,
safety metadata, review, memory, and bridge calls. Planning, routing, dry-runs,
and approval UX belong in mq-agent; repo health scoring belongs in
repo-signal; operator reports belong in mq-hal.
v2.0.0 — Release Gate v2 + deterministic readiness: lint/type, contract-drift, unsafe-command, and read-only perception-review checks complete the deterministic release gate, on top of the brain/Obsidian tools, local Ollama learn provider, and mq-agent learn compatibility aliases.
This repository is useful as:
- a local MCP server with 125 documented, safety-classified tools
- a packaged local CLI with
mq-mcp doctor,mq-mcp health,mq-mcp report,mq-mcp serve,mq-mcp validate, andmq-mcp tools - validated MCP profile templates for Claude Desktop, Codex, mq-agent, OpenAI bridge, and local macOS workflows
- a v1 stability baseline with
mq-mcp stability validateanddocs/stability.json - a validation baseline with
scripts/validate.shandscripts/release-check.sh - a repo-aware and macOS-aware MCP surface for mq-agent and local workflows
- a documented integration point for mq-hal and repo-signal
- an optional local-first Ollama learn extraction policy where mq-mcp remains the source of truth for validation, safety, and memory
It is not yet a production-ready MCP distribution or hidden daemon.
- Python files compile in CI (
python -m compileall mq-mcp/) scripts/validate.shruns on every push — checks required files, Python syntax, MCP tool listing, and integration wiring- Path access is scoped through
resolve_repo_file()andresolve_allowed_local_file()— no arbitrary filesystem access - Write-capable tools (
update_repo_file,edit_image) never commit automatically - Safety policy classifies all 125 tools by class, resolver, write capability, and subprocess use — see
docs/TOOL_SAFETY.md - Tests for path safety and tool output shape run in CI via
pytest - CI runs on
macos-latest— not a Linux approximation
| Path | Purpose |
|---|---|
mq-mcp/server.py |
Local FastMCP server experiment |
mq-mcp/bridge.py |
Bridge between OpenAI and the local MCP server |
mq-mcp/main.py |
Minimal Python entry point |
mq-mcp/pyproject.toml |
Python project metadata and dependencies |
mq-mcp/.env.example |
Example environment file |
scripts/install.sh |
Local install helper for dependencies, .env, and the mq-mcp command |
scripts/upgrade.sh |
Safe update helper for pull, sync, reinstall, and validation |
scripts/uninstall.sh |
Local CLI uninstall helper |
completions/_mq-mcp |
Optional zsh completions |
profiles/ |
Versioned MCP profile templates for clients and workflows |
docs/stability.json |
Machine-readable v1 stability baseline |
docs/index.html |
GitHub Pages landing page |
docs/screenshots/ |
Place for screenshots and visual docs |
CHANGELOG.md |
Release history |
ROADMAP.md |
Planned work |
VERSION |
Current project version |
release.sh |
Local release helper |
docs/install.md |
macOS installation guide |
Clone the repository and run the local installer:
git clone https://github.com/MCamner/mq-mcp.git
cd mq-mcp
./scripts/install.shCheck the local install:
mq-mcp doctor
mq-mcp health
mq-mcp tools
mq-mcp profiles list
mq-mcp stability validateRun the local MCP server experiment:
mq-mcp serveRun validation:
mq-mcp validateWrite a redacted troubleshooting bundle:
mq-mcp report --json
mq-mcp bundle --validateRun the bridge with a prompt:
cd mq-mcp
uv run python bridge.py "List the available MCP tools."The Python project currently declares:
- Python
>=3.11 mcp[cli]openaipsutilpandaspillowpyguitarprorequests
If your local Python version does not match the project requirement, use uv to manage the environment.
Copy the example environment file before running anything that needs API credentials (run from inside mq-mcp/mq-mcp/):
cp .env.example .envDo not commit real API keys, tokens, private paths, or secrets.
Live docs:
https://mcamner.github.io/mq-mcp/
Current docs include:
- a GitHub Pages landing page
- screenshot folder structure
- public readiness baseline
- macOS installation guide in
docs/install.md - packaged local install, upgrade, uninstall, and clean reinstall commands
- redacted observability commands and HTTP endpoints for local diagnostics
- MCP client setup guide in
docs/clients.md - MCP server profiles in
docs/profiles.md - v1 stability baseline in
docs/stability.md - Ghostty terminal setup in
docs/ghostty.md - upgrade instructions in
docs/upgrade.md
See docs/demo.md for example commands and expected output.
Quick example — list available tools through the bridge:
uv --directory mq-mcp run python bridge.py "List the available MCP tools."Expected response lists all 125 MCP tools with descriptions.
See docs/integration.md for how mq-mcp, mq-hal, and repo-signal work together as a local assistant and repo-quality stack.
See docs/orchestration-boundary.md for the
practical boundary between mq-mcp, mq-agent, mq-hal, repo-signal, and
mq-image-analyze.
See docs/LEARN_OLLAMA.md for the optional
Ollama-backed learn extraction policy. Ollama may be used only for local pattern
extraction; mq-mcp owns the learn contract, validation, safety classes, review
logic, and memory writes.
GitHub Pages version: integration.html
mq-mcp is the execution runtime in the MQ ecosystem — it exposes tools and enforces safety boundaries. It does not plan or orchestrate.
| Repo | Use when you need to… |
|---|---|
mq-mcp |
Execute a tool, run a review, read a file, check safety metadata |
mq-agent |
Plan a multi-step workflow or route a request across repos |
mq-hal |
Get a system status report, release brief, or operator summary |
repo-signal |
Score a repo's publish readiness or run a documentation quality check |
mq-image-analyze |
Analyze a screenshot, diagram, or visual render |
Which tools run automatically (no approval needed): Class A and B — all read-only tools. Examples: read_repo_file, git_status, repo_signal_analyze, get_system_resources.
Which tools require explicit human approval: Class C (writes files) and Class D (opens apps or runs subprocesses). Examples: update_repo_file, run_tests, open_terminal, set_reminder.
See docs/orchestration-boundary.md for the full boundary definition and profile-to-class mapping.
See docs/security.md for the MCP safety policy.
See docs/TOOL_SAFETY.md for the full tool class map.
This project is local-first and experimental.
Before using or extending it:
- review what each MCP tool can access
- avoid committing
.envfiles - keep filesystem access scoped and explicit
- avoid hardcoded machine-specific paths where possible
- prefer read-only tools until validation is solid
- document every command that touches local files or credentials
Automation rule of thumb:
- Class A/B tools may be used automatically when the caller accepts the documented read-only or external-access behavior.
- Class C/D tools require an explicit human approval gate because they write files, open apps, or run subprocesses.
- Review tools should be treated as explicit review actions when they call OpenAI, even if their local filesystem behavior is read-only.
The local MCP server exposes 125 tools across five safety classes. See docs/TOOL_SAFETY.md for the full classification.
Repo tools (Class A — read-only, repo-scoped):
read_repo_file— reads a file inside the repository rootlist_repo_files— lists repository files up to a chosen depthrelease_gate_run— runs Release Gate v2 deterministic release validationsearch_repo— searches repository textgit_status— shows branch, working tree status, and recent commitsgit_diff— shows current git diff, optionally for one pathanalyze_csv— analyzes CSV files inside the repotool_safety_report— returns the MCP tool safety classification from docs/TOOL_SAFETY.mdshell_exec— runs an arbitrary shell command (Class D); disabled unlessMQ_MCP_ALLOW_SHELL_EXEC=1, which the bridge sets only in--domode behind a y/n approval gatelist_local_repos— lists registered local repositories from MQ_MCP_LOCAL_REPOSlist_openable_apps— returns static list of apps Bridget can open or control
System read (Class B — read-only, external access):
get_system_resources— shows CPU, memory, and disk informationanalyze_guitar_pro— analyzes Guitar Pro files in repo or allowed rootsrepo_signal_analyze— runs repo-signal analyze on a local repository (read-only)repo_signal_checklist— runs repo-signal publish checklist on a local repository (read-only)repo_signal_inspect— runs repo-signal inspect --json and returns structured inspect.v1 datarepo_signal_doctor_json— runs repo-signal doctor --json and returns structured doctor.v1 datarepo_signal_report— runs repo-signal report --format json and returns structured report.v1 datarepo_signal_suggest— runs repo-signal suggest --format json and returns structured suggest.v1 datarepo_signal_positioning— runs repo-signal positioning --json and returns structured positioning.v1 datarepo_signal_status— reports whether repo-signal export packs are present and merged (Class A, read-only)zephyr_validate— validates a zephyr architecture YAML filezephyr_review— reviews a zephyr architecture YAML filezephyr_analyze— analyzes a zephyr architecture YAML filezephyr_diff— compares two zephyr architecture YAML filesimage_observe_architecture— observes an architecture diagram through mq-imageimage_analyze_ui— analyzes a UI screenshot through mq-imageimage_analyze— analyzes an image through mq-imageums_command_catalog— reads the mq-ums command catalog from MQ_UMS_DIR/configums_audit_log— reads mq-ums local audit logs from MQ_UMS_DIR/logsget_clipboard— reads the current macOS clipboardget_wifi_info— returns current Wi-Fi network name and signal infoget_battery_status— returns battery level, charging state, and estimated time remaininglist_running_apps— lists all visible macOS applications currently runningget_todays_events— returns today's events from Calendar.appfind_large_files— finds files larger than a given size in a directoryfind_recent_files— finds files modified within the last N dayscheck_port— checks whether a TCP port is in use on localhostget_public_ip— returns the current public IP address
Write-capable (Class C — controlled scope):
update_repo_file— safely replaces exact text in allowed repo files without committingedit_image— edits an image with supported actions (rotate, grayscale)set_clipboard— copies text to the macOS clipboardtake_screenshot— captures the screen and saves to a file
Subprocess / open-app (Class D):
open_in_app— opens a repo file or explicitly allowed local file in the default appvalidate_project— runsscripts/validate.shwhen availablerun_mqlaunch— runsmqlaunch.shopen_repo_terminal— opens a registered local repository in a new Terminal windowhal_repo_report— runs a read-only mq-hal repo report (audit, brief, release-brief, repo-status, ci)open_messages— opens Messages.app, optionally to a contactopen_finder— opens Finder at a given pathopen_url— opens a URL in the default browsershow_notification— sends a macOS system notificationopen_app— launches any macOS application by namespeak_text— speaks text aloud via macOS text-to-speechopen_chrome— opens Google Chrome, optionally to a URLopen_spotify— opens Spotify, optionally to a track, album, or searchopen_terminal— opens a new Terminal window, optionally at a pathopen_vscode— opens VS Code, optionally at a file or folderset_volume— sets the macOS system output volumetoggle_dark_mode— toggles macOS between dark mode and light modelock_screen— locks the macOS screen immediatelycreate_note— creates a new note in Notes.appset_reminder— creates a reminder in Reminders.appset_wallpaper— sets the macOS desktop wallpaperrun_tests— runs pytest in a registered local repositoryrun_mqlaunch_doctor— runsmqlaunch doctor(structured PASS/FAIL health report)run_mqlaunch_selftest— runsmqlaunch selftest(internal smoke checks)run_mqlaunch_release_check— runsmqlaunch release-check(pre-release gate)run_mqlaunch_version— runsmqlaunch version(TUI output; version extracted heuristically)run_mqlaunch_system_check— runsmqlaunch system check(TUI; structured data not available headless)run_mqlaunch_perf— runsmqlaunch perf(TUI menu; no parseable output headless)run_mqlaunch_demo— runsmqlaunch demo(interactive TUI; no output headless)run_mqlaunch_bundle— runsmqlaunch bundle(TUI; bundle NOT created headless)run_mqlaunch_ask— asks mqlaunch a natural-language question (requires OPENAI_API_KEY)
Learn layer tools (Class A/C):
record_learning— stores a verified engineering lesson locally with secret redaction (Class C, writes lessons.jsonl)learn_from_review— creates a learning record from the last review findings for a file (Class C)learn_from_diff— creates a learning record with current git diff as context (Class C)bootstrap_learning_memory— seeds the learn layer from architecture memory ADRs (Class C)list_learnings— lists stored lessons with optional repo/source/risk filters (Class A)get_learning— returns a single lesson by id prefix (Class A)explain_learned_pattern— mq-agent-compatible alias forget_learning(Class A)search_learnings— full-text search across lessons (Class A)search_learned_patterns— mq-agent-compatible alias forsearch_learnings(Class A)summarize_learnings— summarizes lessons by source and risk (Class A)learn_hygiene— reports learn memory hygiene: duplicates, invalid records, low-confidence storage, and missing validation (Class A)learning_status— returns learn layer stats: counts by source, risk, and repo (Class A)learn_status— mq-agent-compatible alias forlearning_status(Class A)learn_inbox— lists pending learn candidates auto-extracted from commits by the post-commit hook, awaiting review (Class A)learn_inbox_drop— removes exactly one pending candidate from the inbox after promotion/skip; previews by default,apply=Trueto remove; never touches the curated store (Class C)learn_inbox_draft— maps one inbox candidate to a review-readyrecord_learningdraft (task/lesson/validation/risk/repo/source/tags); preview-only, writes nothing, validation is always a MANUAL VALIDATION REQUIRED instruction so promotion stays a human decision (Class A)ollama_learn_status— reports whether the local Ollama server is running and the mq-learn model is installed; read-only (Class B)ollama_learn_extract— dry-run extraction of a learn pattern from review findings via local Ollama; no storage, preview only (Class B)learn_extract_from_last_review— loads stored review findings for a file, runs dry-run Ollama extraction, returns a preview candidate; no storage (Class B)promote_learning— previews how a lesson would appear in a target doc, no file writes (Class A)
Brain tools (Class A/C):
brain_status— reports mqobsidian vault availability and top-level folders (Class A)brain_record_decision— writes an ADR to mqobsidian/decisions/ (Class C)brain_record_review— writes a review summary to mqobsidian/reviews/ (Class C)brain_record_session— writes a session note to mqobsidian/sessions/ (Class C)brain_record_learning— writes a learned pattern to mqobsidian/learn/ (Class C)brain_promote_learning— promotes a learning note into mqobsidian/learn/verified/ (Class C)
Review engine tools:
review_file— runs an AI review on a repo file using a review contract (requires OPENAI_API_KEY)risk_review_file— targeted risk pass (security/risk/architecture) with grep pre-scan + AI review (requires OPENAI_API_KEY)risk_review_diff— risk pass over changed files in the working tree or staging area (requires OPENAI_API_KEY)build_repo_context— rebuilds architecture_map.json and file_summary_index.json for the review enginelist_review_contracts— lists available review contracts and their modeslist_review_skills— lists available review skills with path-prefix routes, extension routes, and availability status (Class A)list_review_history— lists all files with review history and last review summaryget_last_review— returns the most recent review findings for a repo file from local memorydetect_architecture_drift— detects drift between declared documentation and actual runtime statereview_runtime_contract— verifies RUNTIME_CONTRACT.md claims against actual server state; structural checks + optional AI architecture passvalidate_orchestration_contract— verifies tool set satisfies the orchestration contract: profiles, safety classes, error prefixes (Class A, no API key)list_architecture_docs— lists docs/architecture/ with freshness status relative to server.pyreview_architecture_doc— applies architecture review contract to a named architecture document with injected runtime statelist_architecture_decisions— lists all architecture memory entries (ADRs, boundaries, philosophy, rejected patterns)get_architecture_decision— returns the full text of a specific architecture memory entry by IDrecord_architecture_decision— records a new ADR in architecture_memory/ (Class C, writes file, does not commit)extract_coding_conventions— extracts generalizable conventions from the last review of a file and persists them to architecture_memory/ (Class C, requires OPENAI_API_KEY)store_semantic_memory— stores or updates a knowledge item in semantic memory (Class C, writes semantic_memory/store.json)search_semantic_memory— keyword search across semantic memory keys, tags, and content (Class A)get_semantic_memory— returns the full content of a semantic memory item by key (Class A)list_semantic_memory— lists all semantic memory items with previews (Class A)bootstrap_semantic_memory— ingests README, ROADMAP, RUNTIME_CONTRACT.md, ORCHESTRATION_CONTRACT.md, TOOL_SAFETY.md into semantic memory (Class C)export_symbol_index— writes a callgraph symbol map to generated/symbols/symbol_index.json (Class C)review_diff— reviews all git-changed files using the configured review mode (requires OPENAI_API_KEY)review_repo— reviews the least-recently-reviewed repo files (requires OPENAI_API_KEY)
Bridget can optionally speak responses locally on macOS using the built-in say command. Disabled by default, no external TTS.
bridget --voice-list
bridget --voice-name Alva
bridget --voice-on
bridget --voice-test
bridget --voice-offRun the local validation script from the repository root:
./scripts/validate.shThe validation checks:
- required project files
- absence of debug and backup files
- Python syntax compilation
- MCP tool listing
- core MCP tools including
read_repo_file,list_repo_files,search_repo,git_status,git_diff,validate_project, andupdate_repo_file - integration documentation wiring
- integration smoke checks for mq-hal and repo-signal MCP tools
- bridge tool discovery checks for the tools Bridget can see through
bridge.py --tools
You can also run validation through the bridge:
cd mq-mcp
uv run python bridge.py "Run project validation."Useful local checks:
git status
python -m compileall mq-mcp/
./scripts/check-bridge-tool-discovery.shRun the safety tests:
uv --directory mq-mcp run pytest ../tests -vSee ROADMAP.md for planned MCP setup, validation, troubleshooting, documentation, and release work.
See docs/troubleshooting.md for solutions to common issues with uv, Python versions, and API credentials.
See LICENSE.