Agent WebMCP
Inspiration
Most server operations tools were designed for one human clicking through dashboards, opening terminals, copying logs, and translating what they see into the next command. AI agents can help reason about those systems, but they usually sit outside the actual operational interface. That means the human still has to bridge the gap between what the dashboard knows and what the agent can safely do.
Agent WebMCP explores a different model: the operations console itself becomes an agent-capable surface.
Instead of building a second automation API just for AI, the application exposes the same typed operations used by the human UI through WebMCP. Humans can inspect and control their server visually, while an agent can discover those same capabilities directly from the page and execute them with structured inputs.
What it does
Agent WebMCP is a Java-based operational control plane for managing services, inspecting system health, and running durable jobs on a remote machine.
The browser console provides a human-friendly view of the machine. WebMCP turns that same page into a structured tool surface for agents.
Key workflows include:
Inspecting system status and runtime metrics. Discovering managed services and viewing their current state. Inspecting individual services, recent output, and operational details. Starting, stopping, restarting, and reloading services through bounded operations. Adding and removing services from the managed inventory. Scheduling durable service jobs for actions that should run later or recur. Running optional agent-assisted jobs through an installed Codex CLI when a job needs reasoning instead of a fixed service action. Inspecting job state, execution results, and logs.
The important part is that these are not separate demo-only AI tools. They are projections of one canonical operation catalog shared by the UI, HTTP API, CLI, WebMCP, and a bounded MCP endpoint.
Why WebMCP is a strong fit
Operations software already contains the exact context an agent needs: available actions, service state, health data, logs, job history, and the constraints around what may be changed.
Without WebMCP, an agent interacting with an operations dashboard usually has to infer intent from rendered UI, scrape text, or rely on a separately maintained automation API. Those approaches are brittle and can drift away from the product that humans actually use.
With WebMCP, Agent WebMCP publishes explicit tools directly from the page using document.modelContext.registerTool(...). The browser becomes both the human interface and the agent capability surface.
That creates a much cleaner collaboration loop:
A human opens the operations console and sees the current machine state. The agent discovers the operations that this exact page supports. The human can ask for an outcome instead of manually translating it into a sequence of service actions. The agent executes bounded, typed operations through the same backend used by the UI. The resulting state remains visible and understandable to the human in the console.
This is the part that was difficult before: the human interface and the agent interface can finally describe the same system instead of pretending they are unrelated products.
How I built it
Agent WebMCP is implemented as a Java application with a lightweight browser frontend and a canonical operation runtime.
Canonical operation catalog
The backend owns a typed catalog of operational capabilities. Each operation defines its identifier, description, access characteristics, input schema, and execution behavior.
Those operations are projected onto multiple surfaces rather than being reimplemented for each one:
Human web console HTTP/JSON API CLI Browser-native WebMCP Bounded MCP endpoint
This keeps behavior consistent. A service restart means the same thing whether it was initiated by a button, an HTTP call, or an agent using WebMCP.
Browser-native WebMCP
The production browser integration loads the canonical operation catalog and registers operations through document.modelContext.registerTool(...).
Each registered tool receives:
A stable operation name A human-readable description A generated JSON input schema Read-only annotations where appropriate An execute callback that forwards to the canonical operation endpoint The WebMCP execution AbortSignal, propagated into network requests for cancellation
The browser therefore exposes real application capabilities, not a hard-coded list maintained separately from the backend.
Services and durable jobs
Service control is intentionally bounded. Agent WebMCP does not expose a generic shell, arbitrary command execution, or unrestricted filesystem mutation.
Service operations work through a managed inventory and provider layer. Durable jobs allow operational work to survive beyond one interactive request and make scheduled or recurring actions first-class parts of the product.
A service job can be completely deterministic, such as scheduling a restart or cleanup. It can also optionally include a prompt for an installed Codex CLI when the job genuinely benefits from agent reasoning.
That separation matters: not every automation problem needs AI, and the product should not pretend otherwise.
Human and agent UX
The UI is designed as an operational cockpit rather than a chat wrapper. Humans can browse machine health, services, jobs, activity, and execution details normally. WebMCP adds agent capability without replacing that interface.
The result is a shared operational surface where people remain able to understand and control the system while agents handle multi-step execution when useful.
Safety model
Agent WebMCP deliberately avoids exposing a generic remote shell as an AI tool.
The operation catalog is bounded and typed. Service lifecycle actions operate on managed services, job execution is structured, recursive job execution is rejected, and the separate MCP projection exposes only an intentionally limited subset of capabilities.
The project can also run in a NO_AUTH mode for localhost or user-controlled private-tunnel setups, but that mode is intentionally treated as private-machine functionality rather than something that should be exposed casually to the public internet.
Challenges I ran into
Avoiding two sources of truth. It would have been easy to create one set of backend operations and another set of WebMCP tools. Instead, WebMCP is generated from the canonical operation catalog so the two cannot quietly drift apart. Keeping powerful operations bounded. Remote operations software naturally wants to become a shell with nicer buttons. I deliberately constrained the surface around typed service and job operations instead. Supporting both deterministic automation and agents. A restart at 3:00 AM does not need an LLM. A diagnostic or remediation task might. The job model keeps those use cases separate while allowing them to share one scheduler and execution history. Making the agent surface feel native to the product. The goal was not to bolt a chat panel onto an admin dashboard. The page itself publishes its capabilities through WebMCP while remaining a useful standalone operations console. Validating the same behavior across surfaces. The project uses runtime, browser, and operation-level tests to make sure WebMCP executes the same canonical operations as the rest of the application.
Accomplishments I'm proud of
Built a real browser-native WebMCP implementation using document.modelContext.registerTool(...). Projected WebMCP tools from a canonical typed Java operation catalog instead of maintaining an AI-specific duplicate API. Built a coherent human operations console around the same capabilities. Implemented bounded service lifecycle control without exposing generic shell execution. Added durable jobs for scheduled and recurring operational work. Added optional Codex-assisted jobs without forcing AI into deterministic service tasks. Kept a separate MCP endpoint intentionally narrower than the browser WebMCP surface. Added end-to-end browser coverage proving that discovered WebMCP tools execute through the canonical backend.
What I learned
WebMCP is most compelling when a web application already owns meaningful actions and context, not when tools are invented solely for an agent demo. The browser can become a clean capability boundary between a person, an application, and an agent. A single canonical operation model dramatically reduces drift between human and agent interfaces. Explicit schemas and bounded operations are much safer and easier to reason about than arbitrary remote execution. AI is more useful in operations when it is optional and composable, not when every scheduled task is forced through a model. Durable jobs are a useful bridge between short-lived agent interactions and real operational work that may need to continue later.
What's next for Agent WebMCP
Expand automatic service discovery while preserving explicit control over what becomes agent-accessible. Add richer execution traces and activity views for long-running jobs. Add more provider integrations beyond the initial service-control backend. Improve policy and authorization controls for multi-user deployments. Continue refining the WebMCP metadata and schemas so agents can make better decisions with less context. Package the project into an increasingly simple install-and-run experience for remote machines.
Built With
- codex
- css
- gradle
- html
- java
- javascript
- mcp
- openai
- playwright
- webmcp
Log in or sign up for Devpost to join the conversation.