Skip to content

## Register manuscript MCP tools in notio and projio Wire the manuscript subpac

Prompt

Register manuscript MCP tools in notio and projio.

Wire the manuscript subpackage into notio's MCP server and projio's MCP proxy.

Prerequisites

  • The manuscript subpackage is implemented at packages/notio/src/notio/manuscript/ (prior task).
  • Read the design spec at docs/explanation/manuscript-design-spec.md.
  • Read notio's MCP server: packages/notio/src/notio/mcp/server.py — this is where manuscript tools get registered.
  • Read projio's MCP proxy pattern: src/projio/mcp/notio.py — this is where projio wraps notio tools.
  • Read projio's MCP server: src/projio/mcp/server.py — registration point.

Deliverables

1. Extend notio MCP server (packages/notio/src/notio/mcp/server.py)

Add manuscript tools following the existing pattern:

@mcp.tool()
def manuscript_init(name: str, template: str = "generic") -> str:
    """Scaffold a new manuscript with default sections."""

@mcp.tool()
def manuscript_list() -> str:
    """List all manuscripts in the project."""

@mcp.tool()
def manuscript_status(name: str) -> str:
    """Show manuscript sections, figures, and completion status."""

@mcp.tool()
def manuscript_build(name: str, format: str = "pdf") -> str:
    """Assemble sections and render to PDF/LaTeX/Markdown."""

@mcp.tool()
def manuscript_validate(name: str) -> str:
    """Validate citations, figures, sections, and pandoc availability."""

@mcp.tool()
def manuscript_assemble(name: str) -> str:
    """Generate assembled markdown without rendering."""

@mcp.tool()
def manuscript_figure_insert(name: str, section: str, figure_id: str, position: str = "end") -> str:
    """Insert a figio figure reference into a manuscript section."""

Each tool: resolve NOTIO_ROOT, call manuscript subpackage functions, return JSON-formatted results.

2. Add projio MCP wrapper (src/projio/mcp/manuscripto.py)

New file following the pattern of src/projio/mcp/notio.py: - Import from notio.manuscript with graceful fallback - Register same tools with PROJIO_ROOT resolution - Add to src/projio/mcp/server.py registration

3. Update projio CLAUDE.md

  • Add manuscript tools to the mcp/notio.py entry (or create separate mcp/manuscripto.py entry)
  • Add to agent tool routing table:
    | Init a manuscript | `manuscript_init(name)` | Create dirs manually |
    | List manuscripts | `manuscript_list()` | Scan for manuscript.yml |
    | Build manuscript PDF | `manuscript_build(name, "pdf")` | Run pandoc manually |
    | Validate manuscript | `manuscript_validate(name)` | Check files manually |
    | Insert figure | `manuscript_figure_insert(name, section, figure_id)` | Edit markdown manually |
    

4. Update permissions scaffolding

  • Check src/projio/init.py for where .claude/settings.json is generated
  • Add mcp__projio__manuscript_* to the default allow list

5. Update notio CLAUDE.md (packages/notio/CLAUDE.md)

  • If it exists, add manuscript subpackage to architecture section
  • Add MCP tool surface for manuscript tools
  • If CLAUDE.md doesn't exist for notio, skip this

6. Implement validate.py (packages/notio/src/notio/manuscript/validate.py)

This module was missed by the prior implementation task. Create it:

def validate_manuscript(spec: ManuscriptSpec, base_dir: Path) -> ValidationResult:

Checks: - All section files referenced in spec exist on disk - Section order values have no gaps or duplicates - Scan section markdown for [@citekey] patterns, verify each exists in the bibliography .bib file (parse with regex, don't need full bibtex parser — just check keys exist) - Check figure bindings have corresponding built outputs (reuse validate_figures from figures.py) - Check pandoc is available in PATH (reuse find_pandoc from render.py) - Return a dataclass ValidationResult(valid: bool, errors: list[str], warnings: list[str])

Export validate_manuscript and ValidationResult from manuscript/__init__.py.

7. Add CLI subcommand (packages/notio/src/notio/cli.py)

Add a manuscript subcommand group to notio's existing argparse CLI:

notio manuscript init <name>                        # scaffold manuscript
notio manuscript build <name> [--format pdf|latex|md]  # assemble + render
notio manuscript validate <name>                    # run all checks
notio manuscript status <name>                      # show sections, figures, completion
notio manuscript assemble <name>                    # generate assembled markdown only

Read the existing cli.py to understand the subparser pattern, then add manuscript as a new subcommand with its own sub-subparsers. Each command should: - Resolve root from --root arg or cwd - Find manuscript.yml by scanning docs/manuscript/<name>/manuscript.yml - Load ManuscriptSpec and call the corresponding library function - Print structured output (JSON for machine-readable, or human-friendly table)

Notes

  • The design spec is at docs/specs/notio/manuscript.md (not docs/explanation/).
  • The projio wrapper file should be named manuscripto.py (not manuscript.py) to avoid confusion with generic terms
  • Tools should gracefully return "manuscript subpackage not available" if notio.manuscript import fails
  • Test with: python -c "from notio.manuscript import ManuscriptSpec; print('ok')"
  • [[task-arash-20260331-175703-656609.md]] — Direct prerequisite: implements the manuscript subpackage that these MCP tools wrap
  • [[task-arash-20260331-175617-644481.md]] — Design spec for manuscript as a notio subpackage — referenced as prerequisite in this task
  • [[task-arash-20260331-175508-399347.md]] — Parallel task registering manuscripto in projio MCP — overlapping scope
  • [[task-arash-20260331-175439-058148.md]] — Implements manuscripto core assembly/render — the functionality being exposed via MCP here