---
summary: Expose sourceUrl override on Tool/Resource/Prompt definitions — closes the type/runtime gap for landing-page view-source links
breaking: false
---

# 0.6.3 — 2026-04-21

The manifest builder has always read `sourceUrl` off each definition at runtime, and the landing page renders it for per-definition view-source links. But the consumer-facing `ToolDefinition` / `ResourceDefinition` / `PromptDefinition` interfaces never declared the field, so TypeScript rejected it as an excess property — leaving consumers to either rename files to match the `snake_case → kebab-case` derivation convention or reach for `as any`. This release closes the gap.

Closes [#42](https://github.com/cyanheads/mcp-ts-core/issues/42).

## Added

- **`sourceUrl?: string` on `ToolDefinition`, `ResourceDefinition`, `PromptDefinition`** — per-definition override for the landing page view-source link. Bypasses the `landing.repoRoot`-based auto-derivation (which assumes `<repoRoot>/blob/main/src/mcp-server/<kind>/definitions/<kebab-name>.<suffix>.ts`). Use this when your file path diverges from the convention — domain-namespaced subdirectories or a filename that doesn't mirror `name`. JSDoc added to all three interfaces.

## Changed

- **`src/core/serverManifest.ts`** — dropped the three `& { sourceUrl?: string }` intersection casts that previously worked around the type gap. Simplified the resource and prompt branches to use `def` directly (the intersections were the only reason for the `d` alias). Removed a redundant `override` local in the tool branch. No behavior change — pure cleanup that the type fix enables.
- **`tests/unit/core/serverManifest.test.ts`** — replaced the `as Parameters<typeof buildServerManifest>[0]['tools']` escape hatch in the `sourceUrl` override test with real `tool()` / `resource()` / `prompt()` builders. Added parallel override tests for resources and prompts (previously only the tool path was covered), plus a fallback-derivation test that exercises the full override → `deriveSourceUrl` flow via the builder.

## Notes

- `TaskToolDefinition` intentionally not updated. Task tools aren't yet exercised by mainstream MCP clients; revisit when adoption warrants it. The `AnyToolDefinition` narrowing cast in `serverManifest.ts` silently drops `sourceUrl` for task tools today.
