Skip to content

docs: MCP/OpenAPI metadata authoring for harper#1095#516

Open
kylebernhardy wants to merge 4 commits into
mainfrom
docs-mcp-metadata-1095
Open

docs: MCP/OpenAPI metadata authoring for harper#1095#516
kylebernhardy wants to merge 4 commits into
mainfrom
docs-mcp-metadata-1095

Conversation

@kylebernhardy

Copy link
Copy Markdown
Member

Summary

Docs sibling for HarperFast/harper#1095 (implementation: HarperFast/harper#1167). Documents the class-level metadata surface that drives both the MCP tool descriptors and the OpenAPI document from a single set of statics.

  • reference/database/schema.md — new "Documenting Types and Fields" section covering """docstring""" conventions on @table @export types and fields; @hidden directive documented at both type level and field level, with explicit framing as metadata-visibility (not access control). Trust-model note that docstrings reach LLMs and public OpenAPI consumers verbatim.
  • reference/resources/resource-api.md — new "Class-level metadata for MCP and OpenAPI" section covering static description, static properties (Record), static outputSchemas, static hidden, static mcp.annotations, and static mcpTools. Inheritance pattern via spread. Under-annotate-before-mis-annotate note for idempotentHint.
  • New learn/developers/mcp-and-openapi-metadata.mdx — how-to with before/after MCP tools/list output; GraphQL-first path; programmatic-Resource path; inheritance example; @hidden example; RBAC notes; verification steps.
  • New reference/mcp/tool-metadata.md — per-profile sourcing reference for every tool-descriptor field; sample descriptors for get_Product and add_user; catalog of harper://* synthetic resources.

Where to put attention

The content claims behaviors that should match the implementation PR. Worth spot-checking:

  • The before/after get_Product outputSchema JSON in the how-to — generated structure should match what harper#1167's deriveGetOutputSchema actually emits.
  • The add_user sample in reference/mcp/tool-metadata.md — uses a curated description; should match the catalog entry that ships with harper#1167.
  • The note that idempotentHint is omitted on add_*/create_* — should match harper#1167's IDEMPOTENT_OPERATIONS set (currently empty).

Should ride with the implementation PR

Don't merge ahead of harper#1167; the docs reference APIs that don't exist until that lands. After Kris approves both, order doesn't matter.

🤖 Generated with Claude Code using model claude-opus-4-7.

Document Harper's class-level metadata surface that drives both the MCP
tool descriptors and the OpenAPI document from a single source of truth.

- reference/database/schema.md:
  - New "Documenting Types and Fields" section covering GraphQL
    "" "" docstring conventions on @table @export types and their fields,
    with notes on which MCP/OpenAPI surfaces they reach.
  - @hidden directive documented at both type level (under Type
    Directives) and field level (under Field Directives), with explicit
    framing as metadata-visibility — not access control.
  - Trust-model note: docstrings reach LLMs and public OpenAPI
    consumers verbatim; treat them as code.

- reference/resources/resource-api.md:
  - New "Class-level metadata for MCP and OpenAPI" section covering
    static description, static properties (Record), static outputSchemas
    (per-verb overrides), static hidden, static mcp.annotations (narrow
    MCP override), and static mcpTools (custom non-verb methods).
  - Inheritance pattern: extending @table @export Resources composes via
    spread (static properties = { ...Parent.properties, foo: {...} }).
  - Under-annotate-before-mis-annotate note for idempotentHint.

- learn/developers/mcp-and-openapi-metadata.mdx (new):
  - Full how-to with before/after MCP tools/list output.
  - GraphQL-first path for @table @export Resources.
  - Programmatic Resource path for class-statics authoring.
  - Inheritance example, @hidden example, RBAC notes, verification steps.

- reference/mcp/tool-metadata.md (new):
  - Per-profile sourcing reference for every tool-descriptor field
    (operations vs application, verb tools vs custom mcpTools).
  - Sample descriptors for get_Product (with docstrings) and add_user.
  - Catalog of harper://* synthetic resources.

Companion to HarperFast/harper feat-mcp-metadata-1095 (the
implementation PR).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kylebernhardy kylebernhardy requested a review from kriszyp June 8, 2026 19:09

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds comprehensive documentation and reference guides for authoring Model Context Protocol (MCP) and OpenAPI metadata in Harper, covering GraphQL docstrings, class-level statics, and the @hidden directive. The review feedback suggests minor improvements to the documentation files, such as removing unused imports in the MDX guide, resolving duplicate headers in the schema reference to avoid fragile auto-generated anchors, and replacing an incomplete placeholder type in the Resource API reference with a more descriptive type.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread learn/developers/mcp-and-openapi-metadata.mdx Outdated
Comment thread reference/database/schema.md Outdated
Comment thread reference/database/schema.md Outdated
Comment thread reference/database/schema.md Outdated
Comment thread reference/resources/resource-api.md Outdated
kylebernhardy and others added 2 commits June 8, 2026 13:16
Prettier --check on Docusaurus' configured profile flagged style issues
across all four files in the docs PR. No content changes — just spacing,
indentation, and line-break conventions to match the existing repo style.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Docusaurus's strict broken-link check rejected relative paths that
resolved without the /v5/ versioning prefix the existing docs use.
Switched the two inter-doc links to absolute paths matching the
established pattern.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pr-516 June 8, 2026 19:36 Inactive
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-516

This preview will update automatically when you push new commits.

@kylebernhardy kylebernhardy marked this pull request as ready for review June 8, 2026 19:55
@kylebernhardy kylebernhardy requested a review from a team as a code owner June 8, 2026 19:55
Five medium-priority polish findings:

1. Removed unused Tabs / TabItem imports from
   learn/developers/mcp-and-openapi-metadata.mdx — no <Tabs> usage in the
   guide.

2. Disambiguated the type-level @hidden header from the field-level one
   in reference/database/schema.md to prevent the duplicate TOC entries
   and fragile #hidden / #hidden-1 anchors Docusaurus auto-generates.
   Now `@hidden (Type Directive)` and `@hidden (Field Directive)`.

3. Updated the intra-doc link from #hidden-1 to #hidden-field-directive
   to match the new explicit anchor.

4. Replaced the placeholder `ReadonlyArray<...>` type signature for
   `static mcpTools` in reference/resources/resource-api.md with a
   descriptive type name `McpToolDefinition[]`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-516

This preview will update automatically when you push new commits.

@Ethan-Arrowood Ethan-Arrowood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like it! Lets make sure your new section is actually showing up in the navigation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like we have a new section! Nice! This needs to be added to the /reference/index.md and sidebarsReference.ts. All sections also have an overview.md. This technically doesn't have to be a requirement so I'm happy to let this section be hip and cool and break the mold... But yeah may be worth doing an overview.md here to share high-level information for the feature and then have this file too for more detail around too metadata specifically.

kriszyp added a commit that referenced this pull request Jun 13, 2026
* docs(v5.1): release notes, deployment tracking ops, deploy_component updates

- Add 5.1.md release notes covering: models/AI, @embed directive, MCP server,
  deployment tracking, HNSW int8 quantization, and replication improvements
- Update deploy_component docs: urlPath, install_allow_scripts params, deployment_id response
- Document new deployment operations: list_deployments, get_deployment,
  get_deployment_payload, delete_deployment_payload
- Document hdb_deployment record schema (fields, phases, peer_results)

Note: models/AI detail, MCP reference, and HNSW quantization have separate PRs
(#523, #507/#516, #508) — this PR adds the release notes overview and the
deployment tracking operations which had no coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: run prettier on changed files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove cross-plugin MCP link that breaks Docusaurus build

The release-notes and reference doc plugins are separate; relative .md
links between them resolve incorrectly. Removing until PR #507 (MCP
reference section) merges and can be linked with an absolute path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(5.1): expand release notes — middleware/routing, caching, LOCAL_ONLY, HARPER_CONFIG, RocksDB, migrateOnStart, upgrade improvements

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants