Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

feat: export McpTool from package index#1108

Open
brianstrauch wants to merge 1 commit into
strands-agents:mainfrom
brianstrauch:export-mcp-tool
Open

feat: export McpTool from package index#1108
brianstrauch wants to merge 1 commit into
strands-agents:mainfrom
brianstrauch:export-mcp-tool

Conversation

@brianstrauch

Copy link
Copy Markdown

Description

McpTool is already a public class in tools/mcp-tool.ts, but it isn't re-exported from the package index, so it's unreachable from outside the package: the exports field only whitelists ., and Node's subpath enforcement blocks any deeper imports. This makes it impossible to subclass McpClient (which is exported) and return McpTool instances from a custom listTools(), since the McpTool constructor reference isn't accessible.

Note that the Python SDK exports this as MCPAgentTool so this gives us compatibility.

Related Issues

Documentation PR

Type of Change

New feature

Testing

How have you tested the change?

  • I ran npm run check

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

McpTool is already a public class in `tools/mcp-tool.ts`, but it isn't
re-exported from the package index, so it's unreachable from outside the
package: the `exports` field only whitelists `.`, and Node's subpath
enforcement blocks any deeper imports. This makes it impossible to
subclass McpClient (which is exported) and return McpTool instances from
a custom `listTools()`, since the McpTool constructor reference isn't
accessible.

Surface McpTool alongside the other tool exports (FunctionTool, ZodTool,
tool factory) so external code can construct it directly.
@strands-agent

Copy link
Copy Markdown
Collaborator

This repository has been merged into the strands-agents/harness-sdk monorepo and will be archived shortly. All new development happens there.

If this PR is still relevant, please recreate it against the monorepo. The code now lives under strands-ts/. Full commit history was preserved, so your base should be findable.

Apologies for the disruption, and thank you for contributing!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants