NAME

App::Dapper::MCP - Let AI assistants work on a Dapper site over MCP.

DESCRIPTION

dapper mcp runs a Model Context Protocol server on standard input and output, so that an AI assistant (Claude, or any other MCP client) can read, write, build and check a site through Dapper, with Dapper's rules as guardrails: pages are only written inside the source directory, and a page that doesn't match its _schema.yml is refused rather than written.

To add it to Claude Code:

$ claude mcp add dapper -- dapper -C /path/to/site mcp

Other clients take a command and arguments in their configuration:

{ "command": "dapper", "args": ["-C", "/path/to/site", "mcp"] }

Prompts and resources

The server also offers prompts for common jobs (new_site, write_post, audit_site) and resources an assistant can read: dapper://guide (the same guide as AGENTS.md), dapper://config and dapper://schemas.

Tools

site_info

The site's settings, directories, categories, tags and schemas.

list_pages

Every page (optionally only those in a category or with a tag), with its source file, URL, title, date, categories and tags.

read_page

A page's front matter and body, given its source file.

write_page

Create or replace a page from front matter and a body. The page is checked against its schema first and is not written if it doesn't match.

rename_page

Move or rename a page; if its URL changes, a redirect from the old URL is added to _data/redirects.yml.

read_layout, write_layout

Read a layout, or create or replace one (it is parsed first and not saved if it has an error).

build

Build the site.

check

Find problems without touching the output directory (see App::Dapper::Check).

serve

Takes a Dapper object, and answers MCP requests from standard input on standard output until standard input closes.

handle

Takes a Dapper object and a JSON-RPC request, and returns the response (or nothing, for notifications).

get_prompt

Takes a Dapper object, a prompt name and its arguments, and returns the prompt's messages, or nothing if there is no such prompt.

read_resource

Takes a Dapper object and a resource URI, and returns its contents, or nothing if there is no such resource.

call_tool

Takes a Dapper object, a tool name and its arguments, runs the tool, and returns an MCP tool result.

tool_result

Takes a result (a hash) and whether it is an error, and returns it in the form MCP expects: as JSON text, and as structured content.

site_info

The site_info tool.

list_pages

The list_pages tool.

source_path

Takes a Dapper object and a path given by a client, and returns the path of the file in the source directory. Dies if the path would lead outside it.

read_page

The read_page tool.

schema_for

Takes a Dapper object and a file in the source directory, and returns the schema that applies to it (from the nearest _schema.yml at or above its directory), or nothing.

write_page

The write_page tool.

rename_page

The rename_page tool.

redirects_file

Takes a Dapper object and returns the path of _data/redirects.yml.

add_redirect

Takes a Dapper object, an old URL and a new one, and records the redirect in _data/redirects.yml. Redirects that pointed to the old URL are pointed at the new one, so there are no chains.

layout_name

Takes a layout name from a client and returns it, or dies if it isn't a plain name.

read_layout

The read_layout tool.

write_layout

The write_layout tool.

build

The build tool.

check

The check tool.