Skip to content

fix(capabilities): separate capability declarations from definitions#40

Merged
Jpisnice merged 1 commit into
Jpisnice:masterfrom
Zcehtro:fix/capabilities-separate-definitions
Dec 17, 2025
Merged

fix(capabilities): separate capability declarations from definitions#40
Jpisnice merged 1 commit into
Jpisnice:masterfrom
Zcehtro:fix/capabilities-separate-definitions

Conversation

@Zcehtro

@Zcehtro Zcehtro commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

fix(capabilities): separate capability declarations from definitions

Summary

  • Split the MCP capabilities declaration from the detailed definitions to satisfy the MCP SDK types and fix a TypeScript compile error.

What I changed

  • File: capabilities.ts — replaced the single mixed capabilities object with:
    • capabilities (declaration-only: { resources: {}, prompts: {}, tools: {} })
    • resourceDefinitions (detailed resource metadata)
    • promptDefinitions (detailed prompt metadata)
    • toolDefinitions (detailed tool metadata)

Why

  • The MCP SDK expects capabilities to only declare supported categories (e.g., that prompts are supported); providing full prompt definitions in capabilities caused a type mismatch and a TS compilation error. Separating declarations from definitions keeps detailed metadata available for handlers while satisfying the SDK types.

Verification

  • Ran build locally: pnpm build — TypeScript compiles with no errors.

How to test

# from repository root
pnpm install
pnpm build
# optionally run any existing test script if present
pnpm test

Notes for reviewers

  • This is a refactor that preserves all previous data but moves detailed definitions to named exports. Server initialization and handlers can import the detailed definitions (e.g., promptDefinitions) and register them with the server as-needed.
  • The change is safe and limited to one file; no runtime behavior is modified besides how definitions are exported.
  • Branch: fix/capabilities-separate-definitions → target master

@github-actions github-actions 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.

Thanks for the pr,it's now under review

@Jpisnice Jpisnice left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the change @Zcehtro

@Jpisnice Jpisnice merged commit 55a81d1 into Jpisnice:master Dec 17, 2025
1 of 2 checks passed
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