/htmx-php-builder:mcp-serversfrom htmx-php-builder
Designs and builds two MCP servers (record-memory over PostgreSQL, activity-memory over MaluDB) in Python with FastMCP. Use during Phase 1 tool-surface design and when implementing or extending MCP servers.
Ships in htmx-php-builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every application ships two MCP servers. They are designed with the schema in Phase 1 and are the only way agents read the memories — the AMA agent, the client's own AI tools, and future automations all go through them.
| Server | Name | Memory | Backing store |
|---|---|---|---|
| Record memory | {app}_records_mcp | Entities, facts, current truth | PostgreSQL 17, read-only role |
| Activity memory | {app}_activity_mcp | What happened, who, when | MaluDB, read-only role |
(A third, localhost-only server — {app}_actions_mcp for chat-driven navigation and actions — is specified in the chat-actions skill. This skill covers the two client-facing read servers; the read servers never write, and the actions server is never exposed.)
The tool surface is derived from the Phase 0 question list — features are pre-packaged answers to questions, and MCP tools are the same thing for agents.
find_customer, revenue_by_period, open_invoices_for); each recurring activity question becomes one on the activity server (actor_timeline, record_history, who_touched). Tool names are snake_case, action-oriented, and prefixed consistently. Descriptions state when to call the tool, not just what it does.records_search / activity_search accepts a single SELECT statement, validated in code (reject anything else), run under the read-only role with statement_timeout and a row cap. The tool description embeds a schema summary so agents write correct queries.readOnlyHint: true; no tool on either server ever writes. Writes happen only through the PHP application (which is what produces the activity log).Python is the default runtime (Node.js + the MCP TypeScript SDK is the documented alternative — pick one per project, never both).
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, Field, ConfigDict
mcp = FastMCP("acme_records_mcp")
class FindCustomerInput(BaseModel):
model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
query: str = Field(..., description="Name, email, or customer number fragment", min_length=2)
limit: int = Field(default=10, ge=1, le=50)
@mcp.tool(
name="find_customer",
annotations={"title": "Find Customer", "readOnlyHint": True, "openWorldHint": False},
)
async def find_customer(params: FindCustomerInput) -> str:
"""Look up customers by name, email, or customer number. Call this before any
tool that needs a customer_id and you only have a human description of the customer."""
rows = await db.fetch(FIND_CUSTOMER_SQL, params.query, params.limit) # read-only pool
return to_json(rows)
Conventions:
model_config = ConfigDict(...), extra="forbid"), constraints on every field.https://{client}.example.com/mcp/records and /mcp/activity.The two read servers are what the kernel's agents reach (maludb-os-integration, mcp-and-api.md). Beyond a person's
own token, accept: the kernel's token (kernel.{exp}.{app_key}.{nonce}.{hmac} over ACTION_TOKEN_KEY), admitted to
one tool, app_roles (the roles and the rights each gives, os.app-roles/1, from the schema's catalogue); an agent's
run token ({member}.{exp}.{run}.{hmac} over "run:…"), admitted to exactly the tools the kernel's run-facts call
names for this endpoint — a token the kernel does not vouch for lists and calls nothing; a person's action token
({member}.{exp}.{hmac}). Ship find_<entity> resolvers answering {"rows": [{"<entity>_id", "label"}]} for every
entity an action names — the kernel's actions server resolves labels through them. On mcp 1.x copy the kernel's
db.py and server_common.py; on 2.x, Cidery's services/common/os_kernel.py (maludb-os-cidery) wraps
MCPServer.list_tools/call_tool. Ports come from config/.env (MCP_RECORDS_PORT, MCP_ACTIVITY_PORT); the installer
assigns them.
npx @modelcontextprotocol/inspector) before wiring the AMA agent to it.If a full MCP build is underway and the mcp-builder skill is available in the session, load it — it carries the current SDK documentation, best practices, and evaluation methodology. This skill defines what these two servers must be; mcp-builder is the deeper how.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/chat-actionsThe voice-first chat command bar that ships on every screen of every application — natural language in (typically dictated via a tool like Wispr Flow), application actions and navigation out, powered by an LLM router activating MCP tools. Use when building or extending the assistant command bar, the actions MCP server, the action manifest, chat-driven navigation, or voice-to-data capture./design-systemThe mandatory UI design system for applications built with this plugin — Bootstrap 5.3 admin template (nxl theme) with fixed layout, component patterns, and mobile-first rules. Use before generating or editing ANY page, screen, partial, or HTML in an application built with this plugin, and when the user mentions look and feel, styling, layout, or UI consistency./malumail-sendSend transactional email through the MaluMail API (api.malumail.com) and integrate MaluMail sending into an application. Use when an app needs to send email programmatically — welcome/verification/receipt/notification/password-reset messages, alerts, or any outbound mail — through MaluMail; when wiring up MaluMail sending; when managing a MaluMail suppression list; or when debugging MaluMail send failures (401/403/429/502, verified sending domains, API keys, Bearer auth). Triggers on "send email via MaluMail", "MaluMail API", "api.malumail.com", "transactional email", "suppression list"./memory-first-planningBackground context for planning or brainstorming a new application or SaaS product — memory-first design, the ask-me-anything view of applications, SaaS Plus+ data sovereignty, and the default technical stack (PostgreSQL 17 + MaluDB, Apache/PHP/Bootstrap 5.3/HTMX). Provides answers and direction, not a workflow to run./new-appStart building a new HTMX + PHP + Bootstrap 5.3 application. Use when the user says "new app", "start a new application", "build an app", "begin the project", or invokes /new-app. Enforces the fixed build order — full database + memory design first, then authentication + app shell, then vertical feature slices — on the standard stack (Ubuntu 24.04, PostgreSQL 17 + MaluDB, Apache, PHP, HTMX)./new-screenGenerate a new screen (list, detail, create/edit form, report, or settings page) in an HTMX + PHP + Bootstrap 5.3 application built with this plugin. Use when the user asks to "add a screen", "create the customers page", "build the edit form", or invokes /new-screen. Guarantees every screen matches the design system and mobile rules.npx claudepluginhub maludb/maludb-os-htmx-php-guidelines --plugin htmx-php-builderOther plugins' skills for the same job