Skip to content

docs: v0.5.0 documentation improvements#147

Open
galatanovidiu wants to merge 12 commits intorelease/v0.5.0from
docs/v0.5.0-documentation-improvements
Open

docs: v0.5.0 documentation improvements#147
galatanovidiu wants to merge 12 commits intorelease/v0.5.0from
docs/v0.5.0-documentation-improvements

Conversation

@galatanovidiu
Copy link
Contributor

@galatanovidiu galatanovidiu commented Mar 16, 2026

Summary

Complete documentation update for v0.5.0 reflecting the architectural changes (schema/adapter separation via php-mcp-schema DTOs) and addressing documentation gaps from #105.

Changes

  • Architecture overview rewrite — Two-layer architecture (Schema Layer + Adapter Layer), McpComponentInterface, DTO-based handler returns, utility classes section, updated extension points
  • v0.5.0 migration guide — Seamless upgrade framing for most users, internal API changes for advanced customizers (custom handlers, McpErrorFactory, observability), before/after code examples
  • Tool naming documentation — McpNameSanitizer /- transformation, sanitization pipeline, mcp_adapter_tool_name filter, registration name vs MCP name distinction
  • Server selection guidance — Default server (layered discovery with 3 meta-tools) vs custom server (direct registration), comparison table, disable/extend filters
  • HTTP session documentation — Initialize → Mcp-Session-Id flow, curl examples, error cases, session configuration hooks, STDIO exemption, troubleshooting entry
  • README updates — Component tree with new files, php-mcp-schema dependency, migration guide link
  • Navigation updates — Migration guides section and upgrading quick nav in docs index
  • WordPress docs standards — Sentence case headings per WordPress Documentation Style Guide

Other fixes

  • Fixed stale McpErrorFactory array access pattern in troubleshooting guide
  • Fixed SessionManager PHPDoc: timeout default corrected from "3600 (1 hour)" to "DAY_IN_SECONDS (86400)"
  • All code examples verified against actual source files
  • All internal links verified to resolve

Closes #105

Two-layer architecture (Schema Layer + Adapter Layer), McpComponentInterface,
DTO-based handler returns, new utility classes section, updated extension points.
Breaking changes with before/after code, migration steps for custom transports,
handlers, components, error handling, and observability. Backward compat notes.
Adds Tool Naming section to creating-abilities guide covering /→- transformation,
full sanitization pipeline, mcp_adapter_tool_name filter, and naming examples.
…for v0.5.0

Add McpComponentInterface, utility classes, FailureReason to architecture tree.
Add php-mcp-schema as required dependency. Add migration guide link.
Comparison table, layered discovery explanation, direct registration pattern,
filters for disabling/extending the default server.
Session lifecycle (initialize, use header, terminate), curl examples,
error cases, configuration hooks, STDIO exemption, troubleshooting entry.
…ndex

Link v0.3.0 and v0.5.0 migration guides from docs/README.md navigation.
Aligns with v0.5.0 DTO-based error responses documented in migration guide.
Most users see no breaking changes — public APIs, hooks, and factory methods
are all unchanged. Internal API changes moved to an Advanced section for
custom handler/transport implementers only.
Architecture: fix ping return type, transport interface signature, json_text
signature, rest_ensure_response → WP_REST_Response, condense redundant sections.
Guides: fix protocol version in curl example, clarify tool naming scope,
add HTTP 200 error note, explain initialized notification.
README: add 4 missing files to component tree, fix dash formatting.
Troubleshooting: fix HTTP 400 reference to JSON-RPC error code.
Source: fix SessionManager PHPDoc timeout default (was 3600, actual DAY_IN_SECONDS).
Convert all headings to sentence case per WordPress Documentation Style Guide.
Fix broken bold markup on creating-abilities.md line 12.
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: galatanovidiu <ovidiu-galatan@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.62%. Comparing base (cf254b5) to head (18849ee).
⚠️ Report is 6 commits behind head on release/v0.5.0.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             release/v0.5.0     #147      +/-   ##
====================================================
+ Coverage             87.48%   87.62%   +0.14%     
- Complexity             1197     1218      +21     
====================================================
  Files                    53       54       +1     
  Lines                  3898     3944      +46     
====================================================
+ Hits                   3410     3456      +46     
  Misses                  488      488              
Flag Coverage Δ
unit 87.62% <ø> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documentation refresh for v0.5.0 to reflect the schema/adapter split (php-mcp-schema DTOs), clarify default vs custom server usage, document HTTP session requirements, and add a v0.5.0 migration guide.

Changes:

  • Adds a new v0.5.0 migration guide covering DTO return types and McpErrorFactory changes.
  • Expands default server guide (layered discovery vs custom server) and documents HTTP session flow & error cases.
  • Updates architecture overview, troubleshooting docs, and README/doc index navigation for v0.5.0.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
includes/Transport/Infrastructure/SessionManager.php Corrects PHPDoc to match the actual default inactivity timeout (DAY_IN_SECONDS).
docs/troubleshooting/common-issues.md Adds HTTP session troubleshooting and updates McpErrorFactory example usage.
docs/migration/v0.5.0.md New migration guide explaining DTO-based internals and advanced upgrade steps.
docs/guides/default-server.md Adds guidance on choosing default vs custom servers + HTTP sessions section.
docs/guides/creating-abilities.md Adds tool naming/sanitization documentation and filter hook details.
docs/architecture/overview.md Rewrites architecture docs to describe schema DTOs vs adapter layer and new utilities.
docs/README.md Updates docs index/nav and adds migration guide links.
README.md Updates component tree and references php-mcp-schema + migration docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Tool names now show MCP-sanitized form (hyphens) with a note explaining
the ability registration name (slashes) vs MCP tool name distinction.
Session flow clarifies GET/SSE is reserved for future support. Protocol
version corrected to 2025-11-25 in troubleshooting example. Interface
snippet aligned with actual McpRestTransportInterface signature.
Comment on lines +71 to +73
| `my-plugin/my-tool` | `my-plugin-my-tool` |
| `fluent/get-posts` | `fluent-get-posts` |
| `café/résumé-tool` | `cafe-resume-tool` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make any difference in how the tool name is created from the ability name? With the current implementation, there is a tiny risk of name clash. It's rather academic consideration but it could happen with the number of plugin WordPress hosts in the directory. In particular now that multiple / can be used in the ability name:

  1. fluent/get-posts -> fluent-get-posts.
  2. fluent/get/posts -> fluent-get-posts.

Just something to keep in mind. If you would go with _ which is alsow allowed the problem doesn't exist:

  1. fluent/get-posts -> fluent_get-posts.
  2. fluent/get/posts -> fluent_get_posts.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed everything and all changes look good. I can't say much about the migration guide as I'm not deeply familiar with the changes, but assuming it's correct, it's going to be extremely helpful, so kudos for including it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants