Illustration of a digital projection table evaluating deconstructed software modules and capability filmstrips into agent skills and micro-servers on a clean white background.

1. The Monolithic Wrapping Trap

In the wake of the Model Context Protocol (MCP) and Agent Plugins specifications, software engineering is witnessing a gold rush: developers are racing to expose existing applications to autonomous AI agents.

The prevailing pattern is what we call Monolithic 1:1 Wrapping. An engineer takes an existing database, web framework, or command-line interface, generates a single wrapper, and dumps twenty or thirty raw endpoints into an MCP server.

In production agent workflows, this naive approach quickly collapses under three practical failures:

  1. Context Window Saturation: Injecting dozens of tool definitions into an agent's system prompt consumes thousands of tokens on every conversation turn before any task reasoning begins.
  2. Arithmetic and Aggregation Hallucinations: When agents are forced to ingest raw logs, database rows, or diagnostic streams into their prompt to calculate summaries, they frequently hallucinate deltas, miss edge cases, and blow past token limits.
  3. Loss of Procedural Nuance: Deep domain procedures (such as editorial guidelines, safety rules, clinical triage protocols, or code reviews) get erased when flattened into blind executable API functions.

Architecture diagram of Montage reviewing codebases and deconstructing capabilities into Pure Skills, Skills with Code, Clustered MCP Servers, and Agent Plugins.

To move beyond monolithic wrapping, we built Montage. Montage is a framework and diagnostic toolchain that inspects codebases, evaluates their architectural readiness for the autonomous agent ecosystem, and scaffolds tailored agent tooling.

In building Montage, our goal was to investigate two related questions: Can any application become a set of agent skills and plugins? And more importantly, should it?


2. Can Any Application Become Agent Tooling?

The technical answer to the first question is yes, but almost never as a single monolithic tool.

Applications are multifaceted systems composed of distinct operational primitives. Montage treats an application not as a monolith, but as a composite bundle of five structural layers:

Pipeline diagram showing the five phases of Montage: Ingestion, Multi-Layer Discovery, 5-Dimension Evaluation, Persona Clustering, and Tooling Generation.

┌────────────────────────────────────────────────────────────────────────────────────────┐
│                                MONTAGE PIPELINE PHASES                                 │
├────────────────────┬───────────────────────────────────────────────────────────────────┤
│ Phase 1: Ingestion │ Local directory walk or shallow clone from GitHub CLI (gh).       │
│                    │ Strict exclusion of virtual environments and build artifacts.     │
├────────────────────┼───────────────────────────────────────────────────────────────────┤
│ Phase 2: Discovery │ Multi-layer AST scanning: REST routes, CLI trees, scripts,        │
│                    │ authored prompt personas, and engine packages.                    │
├────────────────────┼───────────────────────────────────────────────────────────────────┤
│ Phase 3: Evaluation│ 5-Dimension readiness scoring and 4-tier decision matrix mapping   │
│                    │ capabilities to Pure Skills, Skills with Code, or MCP Tools.     │
├────────────────────┼───────────────────────────────────────────────────────────────────┤
│ Phase 4: Clustering│ Grouping capabilities into cohesive operational personas;         │
│                    │ synthesizing semantic slugs and multi-skill blueprints.           │
├────────────────────┼───────────────────────────────────────────────────────────────────┤
│ Phase 5: Generation│ Emitting MONTAGE_ASSESSMENT.md, montage.json, specialized         │
│                    │ SKILL.md files, helper scripts, and clustered MCP servers.        │
└────────────────────┴───────────────────────────────────────────────────────────────────┘

The 5-Layer Discovery Engine

Montage scans repositories across five layers to uncover latent agent capabilities:

  • Layer 1: REST and HTTP APIs: Identifies FastAPI, Flask, Express, NestJS, and Gin routes. It parses route paths, HTTP verbs, docstrings, and typed Pydantic or TypeScript request/response schemas.
  • Layer 2: Hierarchical CLI Command Trees: Inspects Cobra (Go), Click (Python), Clap (Rust), and Commander (Node) trees. It preserves multi-token command paths (project source add rather than a naked add) and checks for headless execution flags like --json and --dry-run.
  • Layer 3: Standalone Utility Scripts: Walks scripts/, tools/, and bin/ directories to find focused scripts that execute maintenance, migration, or export tasks.
  • Layer 4: Authored Sub-Agent Prompts: Discovers pre-existing markdown personas in prompts/ (for example: "You are an expert academic editor..."), extracting procedural rules, style rubrics, and structural constraints.
  • Layer 5: Core Domain Engines: Identifies business logic packages under pkg/ or internal/, while automatically filtering out low-level plumbing like loggers, database connection pools, and configuration parsers.

By deconstructing the codebase across these five layers, Montage demonstrates that virtually any application contains capabilities suitable for agents. The key is mapping each capability to the right point on the Agent Ecosystem Spectrum.


3. The Critical Question: Should It?

While nearly any codebase can be exposed to an agent, Montage was built around the conviction that not everything should be an executable tool.

Exposing raw capabilities to autonomous agents without scrutiny introduces serious failure modes:

1. The Blast Radius of Unbounded Mutation

An internal administrative script that drops database partitions or flushes caches should not be exposed as a direct executable MCP tool in a broad conversational session. If an agent hallucinates a parameter during a complex reasoning loop, the cost of immediate execution is catastrophic. Such capabilities require pre-flight dry-run simulation or must remain gated behind human confirmation.

2. The Arithmetic and Token Hazard

Asking an LLM to download a 5-megabyte CSV file or inspect 1,000 raw API log entries to compute an error percentage is architectural malpractice. It wastes compute budgets, introduces arithmetic hallucinations, and crowds out reasoning context.

These tasks should never be wrapped as raw MCP endpoints. Instead, they belong in a Skill with Code: an agent instruction manual paired with a deterministic local script that runs on the host, filters the data locally, and passes only a clean, concise summary back to the model.

3. Preserving Human Agency and Editorial Nuance

Certain capabilities represent subjective policy, editorial taste, or ethical oversight. In academic editing, legal review, or healthcare diagnostics, automating the final judgment dehumanizes the outcome and violates safety standards.

These procedures belong in a Pure Skill: a rich markdown document that equips the agent with guidelines, checklists, and evaluation rubrics to advise human operators, without granting the agent autonomous write access.

Montage codifies these boundaries using a 4-Tier Decision Matrix:

Capability Profile Ideal Target Architectural Rationale
Advisory rules, style guides, domain rubrics Pure Skill Zero runtime overhead; guides LLM reasoning without executable risk.
Large data analysis, log filtering, math deltas Skill with Code Deterministic script does the math locally; cuts prompt token usage by 60–90%.
High-value operational verbs with safety flags Clustered MCP Tool Structured JSON-RPC execution grouped by specific operational persona.
Complex enterprise workflows with mixed needs Agent Plugin Bundles plugin.json, mcp.json, and specialized skills/ for turnkey distribution.

4. The 5-Dimension Readiness Scorecard

To give engineering teams an objective assessment of whether their software is safe and ergonomic for agents, Montage evaluates every repository across five weighted dimensions, producing a composite score from 0 to 100:

+-------------------------------------------------------------------------+
|                  MONTAGE 5-DIMENSION READINESS SCORECARD                |
+-----------------------------------+-------------------------------------+
| DIMENSION                         | WEIGHT & EVALUATION CRITERIA        |
+-----------------------------------+-------------------------------------+
| 1. Interface Automation           | 25%: Headless CLI commands, REST    |
|                                   | endpoints, non-interactive flags.   |
|                                   |                                     |
| 2. Data Interchange               | 20%: Structured output (--json),    |
|                                   | clean stdout/stderr separation.     |
|                                   |                                     |
| 3. Execution Safety               | 20%: Mutation gating, pre-flight    |
|                                   | dry-run simulation (--dry-run).     |
|                                   |                                     |
| 4. Auth & Configuration           | 15%: Headless environment variables |
|                                   | without interactive TTY prompts.    |
|                                   |                                     |
| 5. Runtime & Packaging            | 20%: Single-binary portability,     |
|                                   | containerization, build manifests.  |
+-----------------------------------+-------------------------------------+

Based on this composite score, Montage classifies applications into five maturity tiers:

  • Tier 5: Agent-Native (90–100): Fully structured, headless, and gated. Ready for immediate MCP wrapping and Agent Plugin distribution.
  • Tier 4: Agent-Capable (75–89): Clean interfaces with minor gaps, such as missing dry-run simulations or occasional mixed stdout streams.
  • Tier 3: Scriptable (55–74): Functional command-line interfaces; best paired with a Skill with Code to insulate the agent from raw outputs.
  • Tier 2: Workflow-Only (35–54): Rich procedural logic trapped in library code; best extracted as a Pure Skill for advisory guidance.
  • Tier 1: Manual or GUI-Bound (<35): Heavy interactive prompts, lack of machine-readable outputs, or tight desktop UI coupling. Requires foundational refactoring before agent deployment.

5. From Assessment to Scaffolded Tooling

Montage does not stop at diagnostic reporting. When invoked with the --scaffold flag, it synthesizes the exact tooling needed to bridge the application into the agent ecosystem:

# Analyze a repository and scaffold complete agent tooling
montage review https://github.com/ghchinoy/repotographer --scaffold --out ./out/repotographer

The generated bundle contains:

  1. MONTAGE_ASSESSMENT.md: A comprehensive executive summary, dimension-by-dimension breakdown, and remediation roadmap.
  2. montage.json: Machine-readable scorecard data for continuous integration pipelines.
  3. Specialized SKILL.md Files: Rather than a single generic skill, Montage clusters capabilities by operational persona (such as Repository Cartography, Taxonomy Curation, and CLI Automation).
  4. Deterministic Preprocessing Scripts: Token-saving utilities placed in scripts/ that filter raw datasets before invoking models.
  5. Clustered MCP Servers: Stdio servers organized around specific roles, preventing context window exhaustion.
  6. Agent Plugin Bundle: A valid plugin.json and mcp.json ready for installation into tools like OpenCode, Cursor, and Claude Code.

6. The Web Dashboard and Cloud Run Deployment

To make codebase assessment accessible across teams, Montage embeds a native Lit WebComponent dashboard directly within the single Go binary:

# Launch the web dashboard locally on port 8080
montage serve --port 8080

Operators can paste any public GitHub repository URL or local directory path into the dashboard, click "Make this part of the Agent Economy", inspect live interactive scorecards, explore the capability matrix, and download a complete .zip archive of scaffolded agent tooling.

Because the Go backend requires zero CGO and uses anonymous GitHub REST APIs for public repositories, Montage deploys to Google Cloud Run with a single command:

gcloud run deploy montage \
  --source . \
  --region us-central1 \
  --allow-unauthenticated \
  --port 8080 \
  --memory 512Mi \
  --cpu 1

7. Summary: Building Thoughtful Agent Ecosystems

The future of software is agentic, but agent-native software will not be built by blindly wrapping every legacy endpoint into a massive MCP server.

By systematically evaluating codebases with Montage, developers can move past the illusion of monolithic wrapping. They can determine where an application can safely participate in the agent economy, where deterministic code must insulate the model from token waste, and where human agency must be safeguarded through advisory skills.

Explore the source code, architecture specifications, and documentation on GitHub: github.com/ghchinoy/montage.